From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Cc: Daniel Hahler <genml+zsh-workers@thequod.de>
Subject: [PATCH] vcs_info git: rfc822-unfold rebase-apply patch subjects when msg-clean is unavailable.
Date: Sat, 3 Dec 2016 10:34:46 +0000 [thread overview]
Message-ID: <1480761286-17098-1-git-send-email-danielsh@fujitsu.shahaf.local2> (raw)
In-Reply-To: <c5a88588-1928-4b42-bbe0-de5cdcec7630@thequod.de>
Example (in this repository):
git -c merge.merge-changelog.driver=/bin/false rebase --onto=1955cce^^ 1955cce^ 1955cce
---
I think this patch covers all the "other places" Daniel referred to.
Daniel
Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 1560d7f..a92261f 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -237,14 +237,11 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then
if [[ -f "${patchdir}/msg-clean" ]]; then
subject="${$(< "${patchdir}/msg-clean")[(f)1]}"
elif [[ -f "${patchdir}/${(l:4::0:)cur}" ]]; then
- local maxlines=10 line
- while IFS= read -r line; do
- if [[ "$line" == "Subject:"* ]]; then
- subject=${line/(#s)Subject: /}
- break
- fi
- (( --maxlines )) || break
- done < "${patchdir}/${(l:4::0:)cur}"
+ () {
+ local REPLY
+ VCS_INFO_patch2subject "${patchdir}/${(l:4::0:)cur}"
+ subject=$REPLY
+ }
fi
if [[ -f "${patchdir}/original-commit" ]]; then
if [[ -n $subject ]]; then
@@ -270,6 +267,7 @@ elif [[ -f "${gitdir}/MERGE_HEAD" ]]; then
# This is 'git merge --no-commit'
local -a heads=( ${(@f)"$(<"${gitdir}/MERGE_HEAD")"} )
local subject;
+ # TODO: maybe read up to the first blank line
IFS='' read -r subject < "${gitdir}/MERGE_MSG"
# $subject is the subject line of the would-be commit
# Maybe we can get the subject lines of MERGE_HEAD's commits cheaply?
@@ -295,6 +293,7 @@ elif [[ -f "${gitdir}/CHERRY_PICK_HEAD" ]]; then
# ### be "1". The %u/%c tuple will assume the values [(1,2), (1,1), (1,0)],
# ### whereas the correct sequence would be [(1,2), (2,1), (3,0)].
local subject
+ # TODO: maybe read up to the first blank line
IFS='' read -r subject < "${gitdir}/MERGE_MSG"
git_patches_applied=( "$(<${gitdir}/CHERRY_PICK_HEAD) ${subject}" )
if [[ -f "${gitdir}/sequencer/todo" ]]; then
next prev parent reply other threads:[~2016-12-03 10:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20161120013325.12113-1-genml+zsh-workers@thequod.de>
2016-11-20 1:33 ` [PATCH] [RFC] Get subject of current patch in rebase-apply mode Daniel Hahler
2016-11-20 1:43 ` Daniel Hahler
2016-11-21 0:16 ` Frank Terbeck
2016-11-22 4:13 ` Daniel Shahaf
2016-11-28 22:59 ` Daniel Hahler
2016-11-29 6:15 ` Daniel Shahaf
2016-12-02 23:20 ` Daniel Hahler
2016-12-03 10:34 ` Daniel Shahaf [this message]
2016-12-01 17:28 ` Daniel Shahaf
2016-11-28 22:56 ` [PATCH] fixup! " Daniel Hahler
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=1480761286-17098-1-git-send-email-danielsh@fujitsu.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=genml+zsh-workers@thequod.de \
--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).