diff options
author | dana <dana@dana.is> | 2019-03-21 16:56:40 -0500 |
---|---|---|
committer | dana <dana@dana.is> | 2019-03-21 17:02:16 -0500 |
commit | 3e67e8347c77c6f455216fc114c6a26f6859bc68 (patch) | |
tree | ab34f8539704d51e36767f174796f42971a222c0 | |
parent | 876dccfe739fd137dc18527bec9c08c8a303e8a6 (diff) | |
download | zsh-3e67e8347c77c6f455216fc114c6a26f6859bc68.tar.gz zsh-3e67e8347c77c6f455216fc114c6a26f6859bc68.tar.xz zsh-3e67e8347c77c6f455216fc114c6a26f6859bc68.zip |
44111: _git: Use `git rev-list` for log messages
This side-steps issues related to `git log` respecting settings like log.showSignature
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Unix/Command/_git | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog index a55eae61c..ea37615da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-03-21 dana <dana@dana.is> + + * 44111: Completion/Unix/Command/_git: Use `git rev-list` for log + messages + 2019-03-19 Peter Stephenson <p.stephenson@samsung.com> * unposted: Make the doc change in the foregoing clearer. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index e5e4ee768..4eb07e921 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -5652,7 +5652,7 @@ __git_describe_branch () { local __c local -a __commits for __c in ${(P)__commits_in}; do - __commits+=("${__c}:${$(_call_program describe git log -1 --oneline $__c)//:/\\:}") + __commits+=("${__c}:${$(_call_program describe git rev-list -1 --oneline $__c)//:/\\:}") done _describe -t $__tag $__desc __commits "$@" else @@ -6493,8 +6493,9 @@ __git_commit_objects () { # Note: the after-the-colon part must be unique across the entire array; # see workers/34768 - commits=(${(f)"$(_call_program commits git --no-pager log -1000 --all --reflog --format='%h:\[%h\]\ %s\ \(%cr\)')"}) + commits=(${(f)"$(_call_program commits git --no-pager rev-list -1000 --all --reflog --format='%h:\[%h\]\ %s\ \(%cr\)' HEAD)"}) __git_command_successful $pipestatus || return 1 + commits=(${commits:#commit [[:xdigit:]](#c40,)}) _describe -Vx -t commits 'commit object name' commits } @@ -6503,7 +6504,7 @@ __git_commit_objects () { __git_recent_commits () { local gitdir expl start declare -a descr tags heads commits argument_array_names commit_opts - local i j k ret + local h i j k ret integer distance_from_head local label local parents @@ -6517,10 +6518,11 @@ __git_recent_commits () { # Careful: most %d will expand to the empty string. Quote properly! # NOTE: we could use %D directly, but it's not available in git 1.9.1 at least. - commits=("${(f)"$(_call_program commits git --no-pager log ${(q)commit_opts} -20 --format='%h%n%d%n%s\ \(%cr\)%n%p')"}") + commits=("${(f)"$(_call_program commits git --no-pager rev-list ${(q)commit_opts} -20 --format='%h%n%d%n%s\ \(%cr\)%n%p' HEAD)"}") __git_command_successful $pipestatus || return 1 - for i j k parents in "$commits[@]" ; do + # h => hard-coded 'commit abcdef1234567890...' -- just discarded + for h i j k parents in "$commits[@]" ; do # Note: the after-the-colon part must be unique across the entire array; # see workers/34768 if (( $#commit_opts )); then |