summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-09-23 06:47:31 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-09-24 07:22:15 +0000
commit889f6690fd678ed2fdeb4d467e5b8db49b9c6667 (patch)
treefa8ea6cdb575a56fbdd203d2fa2bd0d8a4422e25
parent0e01942c07f51f2eb9896625adfec246289851b8 (diff)
downloadzsh-889f6690fd678ed2fdeb4d467e5b8db49b9c6667.tar.gz
zsh-889f6690fd678ed2fdeb4d467e5b8db49b9c6667.zip
39423: vcs_info git: Produce nicer applied-string messages for 'exec' actions.
This changes the behaviour on "unknown" git-rebase actions (those other than pick/reword/edit/fixup/squash/execute).
-rw-r--r--ChangeLog6
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git8
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 608a296e0..8362d3e7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-24 Daniel Shahaf <d.s@daniel.shahaf.name>
+
+ * 39423: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
+ vcs_info git: Produce nicer applied-string messages for 'exec'
+ actions.
+
2016-09-23 Daniel Shahaf <d.s@daniel.shahaf.name>
* 39412: Src/Zle/computil.c: Fix directory completion when
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 472c10d5d..18ba89a9a 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -213,8 +213,12 @@ elif [[ -d "${gitdir}/rebase-merge" ]]; then
local p
[[ -f "${patchdir}/done" ]] &&
for p in ${(f)"$(< "${patchdir}/done")"}; do
- # remove action
- git_patches_applied+=("${${(s: :)p}[2,-1]}")
+ # pick/edit/fixup/squash/reword: Add "$hash $subject" to $git_patches_applied.
+ # exec: Add "exec ${command}" to $git_patches_applied.
+ # (anything else): As 'exec'.
+ p=${p/(#s)(p|pick|e|edit|r|reword|f|fixup|s|squash) /}
+ p=${p/(#s)x /exec }
+ git_patches_applied+=("$p")
done
if [[ -f "${patchdir}/git-rebase-todo" ]] ; then
git_patches_unapplied=(${(f)"$(grep -v '^$' "${patchdir}/git-rebase-todo" | grep -v '^#')"})