zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <danielsh@apache.org>
To: zsh-workers@zsh.org
Subject: [PATCH 2/3] vcs_info git: In interactive rebases, properly support the full form of the "exec" verb.
Date: Thu, 12 Mar 2020 18:48:52 +0000	[thread overview]
Message-ID: <20200312184853.21654-2-danielsh@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <20200312184853.21654-1-danielsh@tarpaulin.shahaf.local2>

The code before this commit happened to have done the right thing:
"exec" lines were handled by the catchall forward compatibility case,
which happened to have had virtually the same effect as the correct
case.  However, that was merely an accidental result.  This patch makes
the code do the right thing deliberately, rather than by accident.
---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 4 ++--
 1 file changed, 2 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 a8f49e24a..d8e5d1ff1 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -229,11 +229,11 @@ elif [[ -d "${gitdir}/rebase-merge" ]]; then
                         p="${p%% *} ?"
                 fi
                 ;;
-            (x *)
+            ((x|exec) *)
                 # 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 }
+                p=${p/#x /exec }
                 ;;
             (*)
                 # Forward compatibility with not-yet-existing 'git rebase -i' verbs.

  reply	other threads:[~2020-03-12 18:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 18:48 [PATCH 1/3] vcs_info git: In interactive rebases, ignore comment lines Daniel Shahaf
2020-03-12 18:48 ` Daniel Shahaf [this message]
2020-03-12 18:48 ` [PATCH 3/3] vcs_info git: In interactive rebases, process gen-unapplied-string arguments like gen-applied-string arguments are processed Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200312184853.21654-2-danielsh@tarpaulin.shahaf.local2 \
    --to=danielsh@apache.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).