From: Johannes Schindelin Date: Fri, 04 Dec 2009 16:57:46 GMT Subject: Re: [PATCH 3/3] Add a command "fix" to rebase --interactive. Message-ID: In-Reply-To: <6d779d2c244bf5d5b7924cdc5daf66a8186e4bc7.1259934977.git.mhagger@alum.mit.edu> 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 The only part which made me a bit uneasy was this one: > 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."). This is brilliant. ACK