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

[PATCHv2 1/3] lib-rebase: Provide clearer debugging info about what the editor did

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Jan 12, 2010, 15:38 UTC
Message-ID
<a6ef19853c00263c2875026cb438ce46d3fcf950.1263310175.git.mhagger@alum.mit.edu>
In-Reply-To
<7vr5pw3pwp.fsf@alter.siamese.dyndns.org>

(For testing "rebase -i"): Output the "rebase -i" command script before and after the edits, to make it clearer what the editor did.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
 t/lib-rebase.sh |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh
index f4dda02..0fce595 100644
--- a/t/lib-rebase.sh
+++ b/t/lib-rebase.sh
@@ -29,6 +29,7 @@ test -z "$EXPECT_COUNT" ||
 test -z "$FAKE_LINES" && exit
 grep -v '^#' < "$1" > "$1".tmp
 rm -f "$1"
+echo 'rebase -i script before editing:'
 cat "$1".tmp
 action=pick
 for line in $FAKE_LINES; do
@@ -36,12 +37,12 @@ for line in $FAKE_LINES; do
 	squash|fixup|edit|reword)
 		action="$line";;
 	*)
-		echo sed -n "${line}s/^pick/$action/p"
-		sed -n "${line}p" < "$1".tmp
 		sed -n "${line}s/^pick/$action/p" < "$1".tmp >> "$1"
 		action=pick;;
 	esac
 done
+echo 'rebase -i script after editing:'
+cat "$1"
 EOF
 
 	test_set_editor "$(pwd)/fake-editor.sh"
-- 
1.6.6.140.ga53ad
Previous: Johannes SchindelinNext: Junio C Hamano
Message 3 of 6 in “[PATCHv2 0/3] rebase-i: Ignore comments and blank lines among squash/fixup commands”
  1. Michael HaggertyJan 12, 2010
  2. Johannes SchindelinJan 12, 2010
  3. 1/3 lib-rebase: Provide clearer debugging info about what the editor didMichael Haggerty, Jan 12, 2010
  4. Junio C HamanoJan 13, 2010
  5. 2/3 lib-rebase: Allow comments and blank lines to be added to the rebase scriptMichael Haggerty, Jan 12, 2010
  6. 3/3 rebase-i: Ignore comments and blank lines in peek_next_commandMichael Haggerty, Jan 12, 2010

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.