git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dominique Quatravaux <domq@google.com>
To: git@vger.kernel.org, Thomas Rast <trast@inf.ethz.ch>,
	Johannes Sixt <j.sixt@viscovery.net>
Cc: Dominique Quatravaux <domq@google.com>
Subject: [PATCHv2 1/2] rebase -i: optimize the creation of the todo file
Date: Thu,  8 Mar 2012 14:52:56 +0100	[thread overview]
Message-ID: <1331214777-9455-1-git-send-email-domq@google.com> (raw)

Instead of obtaining short SHA1's from "git rev-list" and hitting the repository
once more with "git rev-parse" for the full-size SHA1's, obtain both short and
long SHA1's from "git log" at once.
---
 git-rebase--interactive.sh |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 5812222..e408e94 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -774,17 +774,16 @@ else
 	revisions=$onto...$orig_head
 	shortrevisions=$shorthead
 fi
-git rev-list $merges_option --pretty=oneline --abbrev-commit \
+git rev-list $merges_option --format="%m%H %h %s" --abbrev-commit \
 	--abbrev=7 --reverse --left-right --topo-order \
 	$revisions | \
 	sed -n "s/^>//p" |
-while read -r shortsha1 rest
+while read -r sha1 shortsha1 rest
 do
 	if test t != "$preserve_merges"
 	then
 		printf '%s\n' "pick $shortsha1 $rest" >> "$todo"
 	else
-		sha1=$(git rev-parse $shortsha1)
 		if test -z "$rebase_root"
 		then
 			preserve=t
-- 
1.7.7.3

             reply	other threads:[~2012-03-08 13:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 13:52 Dominique Quatravaux [this message]
2012-03-08 13:52 ` [PATCHv2 2/2] rebase -i: new option --name-rev Dominique Quatravaux
2012-03-09  5:00 ` [PATCHv2 1/2] rebase -i: optimize the creation of the todo file David Barr
2012-03-09  9:18   ` Dominique Quatravaux
2012-03-09  9:21     ` Dominique Quatravaux
2012-03-09  9:47   ` Junio C Hamano
2012-03-09  9:52     ` Dominique Quatravaux

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=1331214777-9455-1-git-send-email-domq@google.com \
    --to=domq@google.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=trast@inf.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).