zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Hahler <genml+zsh-workers@thequod.de>
To: zsh-workers@zsh.org
Subject: [PATCH] fixup! [RFC] Get subject of current patch in rebase-apply mode
Date: Mon, 28 Nov 2016 23:56:06 +0100	[thread overview]
Message-ID: <20161128225606.22536-1-genml+zsh-workers@thequod.de> (raw)
In-Reply-To: <20161120013325.12113-2-genml+zsh-workers@thequod.de>

From: Daniel Hahler <git@thequod.de>

---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 93172fc..1560d7f 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -236,15 +236,15 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then
         done
         if [[ -f "${patchdir}/msg-clean" ]]; then
             subject="${$(< "${patchdir}/msg-clean")[(f)1]}"
-        else
-            local maxlines=10
-            while IFS='\n' read -r;  do
-                if [[ "$REPLY" == "Subject:"* ]]; then
-                    subject=${REPLY/(#s)Subject: /}
+        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}/$(printf "%04d" $cur)"
+            done < "${patchdir}/${(l:4::0:)cur}"
         fi
         if [[ -f "${patchdir}/original-commit" ]]; then
             if [[ -n $subject ]]; then
-- 
2.10.2


      parent reply	other threads:[~2016-11-28 23:01 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] " 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           ` [PATCH] vcs_info git: rfc822-unfold rebase-apply patch subjects when msg-clean is unavailable Daniel Shahaf
2016-12-01 17:28       ` [PATCH] [RFC] Get subject of current patch in rebase-apply mode Daniel Shahaf
2016-11-28 22:56   ` Daniel Hahler [this message]

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=20161128225606.22536-1-genml+zsh-workers@thequod.de \
    --to=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).