git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] contrib/git-resurrect.sh: do not write \t for HT in sed scripts

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 1, 2017, 04:14 UTC
Message-ID
<xmqqd1cwwyr5.fsf_-_@gitster.mtv.corp.google.com>
In-Reply-To
<CAPc5daWU5XDVNiYk_pTFk_qziuDr6W2XDHXXH-0oR49_KiCUYA@mail.gmail.com>

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
Previous: Junio C HamanoNext: Jakub Narębski
Message 9 of 11 in “name-hash: fix buffer overrun”
  1. name-hash: fix buffer overrungit@jeffhostetler.com, Mar 31, 2017
  2. name-hash: fix buffer overrungit@jeffhostetler.com, Mar 31, 2017
  3. Junio C HamanoMar 31, 2017
  4. Junio C HamanoMar 31, 2017
  5. Junio C HamanoMar 31, 2017
  6. Junio C HamanoApr 1, 2017
  7. Johannes SchindelinApr 1, 2017
  8. Junio C HamanoApr 1, 2017
  9. contrib/git-resurrect.sh: do not write \t for HT in sed scriptsJunio C Hamano, Apr 1, 2017
  10. Jakub NarębskiApr 2, 2017
  11. Junio C HamanoApr 2, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.