Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [BUG] rebase should desambiguate abbreviated hashes before starting

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:56

Junio C Hamano [off-list ref] writes:
quoted hunk
It could be something as simple like this (not tested).

 git-rebase--interactive.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index f953d8d..6766b44 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -678,6 +678,23 @@ skip_unnecessary_picks () {
 	die "Could not skip unnecessary pick commands"
 }
 
+# expand shortened commit object name to the full form
+expand_todo_commit_names () {
+	while read -r command rest
+	do
+		case "$command" in
+		'#'*)
+			;;
+		*)
+			sha1=$(git rev-parse --verify --quiet ${rest%% *})
+			rest="$sha1 ${rest#* }"
+			;;
In case somebody wants to polish it to a real patch, this part
should at least be:

		case "$command" in
		'#'* | exec)
			# Be careful for oddball commands like 'exec'
			# that do not have a short-SHA-1 at the beginning
			# of $rest.
			;;
		*)
			sha1=$(git rev-parse --verify --quiet ${rest%% *}) &&
			rest="$sha1 ${rest#* }"
			;;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help