Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 1/3] vcs_info git: Reformat to minimise next diff.  No functional change.
- X-seq: zsh-workers 43586
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 1/3] vcs_info git: Reformat to minimise next diff.  No functional change.
- Date: Tue,  2 Oct 2018 15:20:52 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=	daniel.shahaf.name; h=date:from:message-id:subject:to	:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=6G4K2hrRd4WnGwLlh	lKGuK4dTw9SuHrJU8Qjm7SMbn4=; b=XmAL2K0W8ClXWqjk2AZ1oJjlcinMXYldG	Io3PQRhvzWpx1kKyJ6uOjMsM60kD6GOGuVeN6EkiCH9WkNjszjIOj5Cpk+SDn7oK	C0oln25DY/8V54a4sCYwS0qD3MAjLl+7dBzqy//pjp4gitxkctC/C5Az4xolkiSq	HeBULjy9QHRuOYzaAn7HkrtYkLv0pbCz9NQwCfEZxDFT21YUC3WvBQtJIZjEbYwy	2pCPWlGQ+MeBVGEqchKs9GiYR15dewPncsdzK8mXyEJOiuJkHPBANum6biR/Er4+	wYMtd3b/WMqJab2gv5a1XCTMzA4OkILSRrDhWL/g3G2KrLUaL9inQ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=	messagingengine.com; h=date:from:message-id:subject:to	:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=6G4K2hrRd4WnGwLlh	lKGuK4dTw9SuHrJU8Qjm7SMbn4=; b=dWwSOjg7Lyt80Z2f9XbyX8VZhCxqtol4C	7N5k4qlfoeyikGuWVb0Prloaf1cOrjCjNAqJVGRVP9x3sD/LcpM3mhLuXBzT02Db	ueRyu5YpznRADr8XVg3nxyqiZtYW4I2nDo2u3HpqM1zbiak8VQry55qLMNPSllrL	UB4OgQcCuLTi8TJxTUQe3QIceglK85927Xs4cHzp4taEr/i/B251L+7+JZfIiEvA	mgdNhqdzuyR1ANo+sQDFoQGas1dj5U3m0MaoWhNd81WFFwr2qA0+wP/Z/WbMsBQJ	nujeLwd7/tVmcHnLQ5HwRDgZbR6PAJBhbKJhbIP5t1w1MOss40vFQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index c3e62db3a..af7466be5 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -190,8 +190,19 @@ elif [[ -d "${gitdir}/rebase-merge" ]]; then
         # 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 }
+        case $p in
+            ((p|pick|e|edit|r|reword|f|fixup|s|squash)' '*)
+                # The line is of the form "pick $hash $subject".
+                # Just strip the verb and we're good to go.
+                p=${p#* }
+                ;;
+            (x *)
+                # The line is of the form 'exec foo bar baz' where 'foo bar
+                # baz' is a shell command.  There's no way to map _that_ to
+                # "$hash $subject", but I hope this counts as making an effort.
+                p=${p/x /exec }
+                ;;
+        esac
         git_patches_applied+=("$p")
     done
     if [[ -f "${patchdir}/git-rebase-todo" ]] ; then
Messages sorted by:
Reverse Date,
Date,
Thread,
Author