Re: [PATCH] rebase -i: avoid 'git reset' when possible
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 3, 2009, 00:57 UTC
- Message-ID
- <7v1vtfl8xi.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.DEB.1.00.0903012242180.10279@pacific.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 19 quoted lines
> Or even > > current=$ONTO > fd=3 > while read command sha1 rest > do > case "$fd,$command,$current" in > 3,pick,"$sha1"*|t,p,"$sha1"*) > current=$sha1 > ;; > *) > fd=1 > ;; > esac > echo "$command $sha1 $rest" >&$fd > done < "$TODO" > "$TODO.new" 3>> "$DONE" && > mv "$TODO.new" "$TODO" > > Hmm?
Certainly.
Even though "3 means we haven't found a non-pick yet" feels slightly hacky, the logic is contained in this small loop and I do not see it as a problem. As long as you are sure $ONTO and all sha1 can be compared without running them through rev-parse, avoiding rev-parse per iteration is a very attractive optimization.