Re: [PATCH 3/3] Add a command "fix" to rebase --interactive.
From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:47:49
Hi, On Fri, 4 Dec 2009, Michael Haggerty wrote:
The command is like "squash", except that it discards the commit message of the corresponding commit. Signed-off-by: Michael Haggerty <redacted>
The only part which made me a bit uneasy was this one:
quoted hunk ↗ jump to hunk
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 0bd3bf7..539413d 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh@@ -302,7 +302,7 @@ nth_string () { make_squash_message () { if test -f "$SQUASH_MSG"; then - COUNT=$(($(sed -n "s/^# This is [^0-9]*\([1-9][0-9]*\).*/\1/p" \ + COUNT=$(($(sed -n "s/^# Th[^0-9]*\([1-9][0-9]*\)\(th\|st\|nd\|rd\) commit message.*:/\1/p" \ < "$SQUASH_MSG" | sed -ne '$p')+1)) echo "# This is a combination of $COUNT commits." sed -e 1d -e '2,/^./{
But it is fine. (Took this idiot a couple of seconds to figure out why; I'd have put "th" last, being a mathematician instead of a computer scientist, so my natural numbers start with 1, not 0 ;-) To be honest, I never thought of "fix" as something I want, but patiently deleted the respective commit messages of my fixup commits (usually called "amend" or "amend.<something helpful>"). This is brilliant. ACK