Skip to content

Commit

Permalink
lib-rebase: Provide clearer debugging info about what the editor did
Browse files Browse the repository at this point in the history
(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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Jan 12, 2010
1 parent 0205e72 commit f64b485
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions t/lib-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@ 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
case $line in
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"
Expand Down

0 comments on commit f64b485

Please sign in to comment.