From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: [PATCH 2/3] vcs_info git: Make sure applied-patches is of the form "$hash $subject" --- that is, has a space and a non-empty second argument --- even with future 'git rebase -i' verbs.
Date: Tue, 2 Oct 2018 15:20:53 +0000 [thread overview]
Message-ID: <20181002152054.28358-2-danielsh@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <20181002152054.28358-1-danielsh@tarpaulin.shahaf.local2>
Use of '?' is consistent with these precedents:
Backends/VCS_INFO_get_data_git:220: printf -v "git_patches_applied[$p]" "%04d ?" "$p"
Backends/VCS_INFO_get_data_git:242: git_patches_applied+=("? $subject")
Backends/VCS_INFO_get_data_git:244: git_patches_applied+=("?")
VCS_INFO_quilt:160: applied[$i]+=" ?"
VCS_INFO_quilt:168: unapplied[$i]+=" ?"
---
Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index af7466be5..f38a0d370 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -202,6 +202,11 @@ elif [[ -d "${gitdir}/rebase-merge" ]]; then
# "$hash $subject", but I hope this counts as making an effort.
p=${p/x /exec }
;;
+ (*)
+ # Forward compatibility with not-yet-existing 'git rebase -i' verbs.
+ if [[ $p != *\ * ]]; then
+ p+=" ?"
+ fi
esac
git_patches_applied+=("$p")
done
next prev parent reply other threads:[~2018-10-02 15:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-02 15:20 [PATCH 1/3] vcs_info git: Reformat to minimise next diff. No functional change Daniel Shahaf
2018-10-02 15:20 ` Daniel Shahaf [this message]
2018-10-02 15:20 ` [PATCH 3/3] vcs_info git: In 'git rebase -i', when computing subjects of applied-patches, handle an edge case where the subject is not available 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=20181002152054.28358-2-danielsh@tarpaulin.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--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).