From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Sverre Rabbelier <srabbelier@gmail.com>,
Stephen Haberman <stephen@exigencecorp.com>,
"Shawn O. Pearce" <spearce@spearce.org>,
Thomas Rast <trast@student.ethz.ch>,
Git Mailing List <git@vger.kernel.org>,
Stephan Beyer <s-beyer@gmx.net>,
Christian Couder <chriscool@tuxfamily.org>,
Daniel Barkalow <barkalow@iabervon.org>
Subject: Re: [PATCH] rebase -i: avoid 'git reset' when possible
Date: Mon, 02 Mar 2009 16:57:45 -0800 [thread overview]
Message-ID: <7v1vtfl8xi.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: alpine.DEB.1.00.0903012242180.10279@pacific.mpi-cbg.de
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 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.
next prev parent reply other threads:[~2009-03-03 0:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-26 14:55 [RFH] rebase -i optimization Sverre Rabbelier
2009-02-26 14:59 ` Johannes Schindelin
2009-02-26 15:33 ` Sverre Rabbelier
2009-02-27 10:50 ` Johannes Schindelin
2009-02-27 12:29 ` Sverre Rabbelier
2009-02-27 12:56 ` [PATCH] rebase -i: avoid 'git reset' when possible Johannes Schindelin
2009-02-27 13:03 ` Sverre Rabbelier
2009-02-27 13:33 ` Johannes Schindelin
2009-03-01 8:38 ` Junio C Hamano
2009-03-01 21:57 ` Johannes Schindelin
2009-03-03 0:57 ` Junio C Hamano [this message]
2009-03-03 9:24 ` Johannes Schindelin
2009-03-03 9:55 ` [PATCH v2] " Johannes Schindelin
2009-03-03 11:19 ` Johannes Sixt
2009-03-03 11:21 ` Johannes Schindelin
2009-02-27 1:10 ` [RFH] rebase -i optimization Sitaram Chamarty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v1vtfl8xi.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=barkalow@iabervon.org \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=s-beyer@gmx.net \
--cc=spearce@spearce.org \
--cc=srabbelier@gmail.com \
--cc=stephen@exigencecorp.com \
--cc=trast@student.ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.