From: Johannes Sixt Date: Tue, 03 Mar 2009 11:19:44 GMT Subject: Re: [PATCH v2] rebase -i: avoid 'git reset' when possible Message-ID: <49AD1250.4080708@viscovery.net> In-Reply-To: Johannes Schindelin schrieb: > +# skip picking commits whose parents are unchanged > +skip_unnecessary_picks () { > + fd=3 > + while read command sha1 rest > + do > + # fd=3 means we skip the command > + case "$fd,$command,$(git rev-parse --verify --quiet $sha1^)" in > + 3,pick,"$ONTO"*|t,p,"$ONTO"*) s/t,/3,/ > + # pick a commit whose parent is current $ONTO -> skip > + ONTO=$sha1 > + ;; > + 3,#*|3,,*) > + # copy comments > + ;; > + *) > + fd=1 > + ;; > + esac > + echo "$command${sha1:+ }$sha1${rest:+ }$rest" >&$fd > + done < "$TODO" > "$TODO.new" 3>> "$DONE" && > + mv -f "$TODO".new "$TODO" || > + die "Could not skip unnecessary pick commands" > +} -- Hannes