Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15

Re: [PATCH] Make rebase save ORIG_HEAD if using current branch

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:44:34

Brian Gernhardt schrieb:
quoted hunk ↗ jump to hunk
diff --git a/git-rebase.sh b/git-rebase.sh
index 9b13b83..8d54d9f 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -342,6 +342,7 @@ case "$#" in
 		branch_name=HEAD ;# detached
 	fi
 	branch=$(git rev-parse --verify "${branch_name}^0") || exit
+	echo "$branch" > "$GIT_DIR/ORIG_HEAD"
1. You should be using 'git update-ref' here, I think.
2. You should detect errors.
3. Should ORIG_HEAD better be set at the end of the rebase, not at the
beginning? Because if the rebase stops for some reason, and then you do a
'git reset', you'll have overwritten the ORIG_HEAD that you have set here.

-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help