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

[PATCH] rebase--interactive: Replace unportable 'tac' by a sed script.

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Apr 28, 2008, 07:44 UTC
Message-ID
<48158070.7090007@viscovery.net>
In-Reply-To
<739FA851-F7F5-4CF9-B384-25AA7022B0C2@silverinsanity.com>
From: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
Brian Gernhardt schrieb:
> -    tac | \
> +    perl -e 'print reverse <>' | \
Here's my try, which avoids the perl hammer. ;)

Sorry, I can't test this at the moment due to an unrelated breakage that I first have to chase down.

-- Hannes
PS: I picked the sed script from this patch by Simon 'corecode' Schubert:
http://article.gmane.org/gmane.comp.version-control.git/37074
 git-rebase--interactive.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 1751b08..a9ac332 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -469,7 +469,7 @@ create_extended_todo_list () {
 	test -n "${last_parent:-}" -a "${last_parent:-}" != $SHORTUPSTREAM && \
 		echo reset $last_parent
 	) | \
-	tac | \
+	sed -ne '1!G;$p;h' | \
 	while read cmd args
 	do
 		: ${commit_mark_list:=} ${last_commit:=000}
-- 
1.5.5.1.930.g66f94.dirty
Previous: Brian GernhardtNext: Junio C Hamano
Message 4 of 30 in “Use of tac in git-rebase--interactive”
  1. Brian GernhardtApr 27, 2008
  2. Jeff KingApr 27, 2008
  3. Use perl instead of tacBrian Gernhardt, Apr 27, 2008
  4. rebase--interactive: Replace unportable 'tac' by a sed script.Johannes Sixt, Apr 28, 2008
  5. Junio C HamanoApr 28, 2008
  6. Paolo BonziniApr 28, 2008
  7. Jeff KingApr 28, 2008
  8. Andreas EricssonApr 28, 2008
  9. Jörg SommerApr 28, 2008
  10. Randal L. SchwartzApr 28, 2008
  11. David SymondsApr 28, 2008
  12. Paolo BonziniApr 28, 2008
  13. Brian GernhardtApr 28, 2008
  14. Johannes SchindelinApr 28, 2008
  15. Jörg SommerApr 28, 2008
  16. Avery PennarunApr 28, 2008
  17. Matthieu MoyApr 28, 2008
  18. Brian GernhardtApr 28, 2008
  19. Brian GernhardtApr 28, 2008
  20. Jörg SommerApr 30, 2008
  21. Jörg SommerApr 30, 2008
  22. Brian GernhardtApr 30, 2008
  23. Brian GernhardtApr 30, 2008
  24. Jörg SommerMay 4, 2008
  25. Brian GernhardtMay 6, 2008
  26. Johannes SchindelinApr 28, 2008
  27. Brian GernhardtApr 28, 2008
  28. Johannes SchindelinApr 28, 2008
  29. しらいしななこApr 27, 2008
  30. Junio C HamanoApr 30, 2008

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.