All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH] contrib/git-resurrect.sh: do not write \t for HT in sed scripts
Date: Fri, 31 Mar 2017 21:14:06 -0700	[thread overview]
Message-ID: <xmqqd1cwwyr5.fsf_-_@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAPc5daWU5XDVNiYk_pTFk_qziuDr6W2XDHXXH-0oR49_KiCUYA@mail.gmail.com> (Junio C. Hamano's message of "Fri, 31 Mar 2017 16:18:29 -0700")

Just like we did in 0d1d6e50 ("t/t7003: replace \t with literal tab
in sed expression", 2010-08-12), avoid writing "\t" for HT in sed
scripts, which is not portable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * This should hopefully kill the last instances of the same issue
   to make sure people do not copy-and-paste this unportable
   construct.

 contrib/git-resurrect.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/git-resurrect.sh b/contrib/git-resurrect.sh
index c364dda696..3b78ffd079 100755
--- a/contrib/git-resurrect.sh
+++ b/contrib/git-resurrect.sh
@@ -24,13 +24,13 @@ n,dry-run            don't recreate the branch"
 . git-sh-setup
 
 search_reflog () {
-        sed -ne 's~^\([^ ]*\) .*\tcheckout: moving from '"$1"' .*~\1~p' \
+	sed -ne 's~^\([^ ]*\) .*	checkout: moving from '"$1"' .*~\1~p' \
                 < "$GIT_DIR"/logs/HEAD
 }
 
 search_reflog_merges () {
 	git rev-parse $(
-		sed -ne 's~^[^ ]* \([^ ]*\) .*\tmerge '"$1"':.*~\1^2~p' \
+		sed -ne 's~^[^ ]* \([^ ]*\) .*	merge '"$1"':.*~\1^2~p' \
 			< "$GIT_DIR"/logs/HEAD
 	)
 }
-- 
2.12.2-752-g2215051a9e


  parent reply	other threads:[~2017-04-01  4:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 17:32 [PATCH] name-hash: fix buffer overrun git
2017-03-31 17:32 ` git
2017-03-31 19:35   ` Junio C Hamano
2017-03-31 21:18     ` Junio C Hamano
2017-03-31 23:18       ` Junio C Hamano
2017-04-01  4:12         ` Junio C Hamano
2017-04-01 12:12           ` Johannes Schindelin
2017-04-01 18:16             ` Junio C Hamano
2017-04-01  4:14         ` Junio C Hamano [this message]
2017-04-02  9:58           ` [PATCH] contrib/git-resurrect.sh: do not write \t for HT in sed scripts Jakub Narębski
2017-04-02 16:46             ` Junio C Hamano

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=xmqqd1cwwyr5.fsf_-_@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.