git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv2 1/2] rebase -i: optimize the creation of the todo file

From
Dominique Quatravaux <domq@google.com>
Date
Mar 8, 2012, 13:52 UTC
Message-ID
<1331214777-9455-1-git-send-email-domq@google.com>
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
Next: Dominique Quatravaux
Message 1 of 7 in “[PATCHv2 1/2] rebase -i: optimize the creation of the todo file”
  1. Dominique QuatravauxMar 8, 2012
  2. 2/2 rebase -i: new option --name-revDominique Quatravaux, Mar 8, 2012
  3. David BarrMar 9, 2012
  4. Dominique QuatravauxMar 9, 2012
  5. Dominique QuatravauxMar 9, 2012
  6. Junio C HamanoMar 9, 2012
  7. Dominique QuatravauxMar 9, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.