Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15
DORMANTno replies

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

From: Dominique Quatravaux <hidden>
Date: 2016-06-15 22:53:15
Subsystem: the rest · Maintainer: Linus Torvalds

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 long SHA1's from
"git rev-list" and truncate them with "cut".
---
 git-rebase--interactive.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 5812222..8dcb8b0 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -774,17 +774,17 @@ else
 	revisions=$onto...$orig_head
 	shortrevisions=$shorthead
 fi
-git rev-list $merges_option --pretty=oneline --abbrev-commit \
-	--abbrev=7 --reverse --left-right --topo-order \
+git rev-list $merges_option --pretty=oneline --no-abbrev-commit \
+	--reverse --left-right --topo-order \
 	$revisions | \
 	sed -n "s/^>//p" |
-while read -r shortsha1 rest
+while read -r sha1 rest
 do
+	shortsha1=$(echo $sha1 | cut -c1-7)
 	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help