zsh-histdb

Check-in [f796c73c8c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use dirname not basename here
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:f796c73c8cb30813508ccb4aa486681131203b3ffc07d29010983fc7204ae0df
User & Date: tom.hinton@cse.org.uk 2017-04-19 14:34:05
Context
2017-04-19
14:37
better long option handling check-in: 385f025876 user: tom.hinton@cse.org.uk tags: master, trunk
14:34
Use dirname not basename here check-in: f796c73c8c user: tom.hinton@cse.org.uk tags: master, trunk
2017-04-18
09:06
Update README.org check-in: 9b1eb8e5c2 user: noreply@github.com tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to sqlite-history.zsh.

117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

histdb-sync () {
    local hist_dir="$(dirname ${HISTDB_FILE})"
    if [[ -d "$hist_dir" ]]; then
        pushd "$hist_dir"
        if [[ $(git rev-parse --is-inside-work-tree) != "true" ]]; then
            git init
            git config merge.histdb.driver "$(basename ${HISTDB_INSTALLED_IN})/histdb-merge %O %A %B"
            echo "$(basename ${HISTDB_FILE}) merge=histdb" >> .gitattributes
            git add .gitattributes
            git add "$(basename ${HISTDB_FILE})"
        fi
        git commit -am "history" && git pull --no-edit && git push
        popd
    fi







|







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

histdb-sync () {
    local hist_dir="$(dirname ${HISTDB_FILE})"
    if [[ -d "$hist_dir" ]]; then
        pushd "$hist_dir"
        if [[ $(git rev-parse --is-inside-work-tree) != "true" ]]; then
            git init
            git config merge.histdb.driver "$(dirname ${HISTDB_INSTALLED_IN})/histdb-merge %O %A %B"
            echo "$(basename ${HISTDB_FILE}) merge=histdb" >> .gitattributes
            git add .gitattributes
            git add "$(basename ${HISTDB_FILE})"
        fi
        git commit -am "history" && git pull --no-edit && git push
        popd
    fi