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

[PATCH v3] Make rebase save ORIG_HEAD if changing current branch

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Jul 6, 2008, 16:16 UTC
Message-ID
<1215360963-85805-1-git-send-email-benji@silverinsanity.com>
In-Reply-To
<1215333658-84938-1-git-send-email-benji@silverinsanity.com>

This makes rebase act a little more like merge when working on the current branch. This is particularly useful for `git pull --rebase`

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
---
 Okay, I apparently should stop coding after midnight, even if I think I'm
 awake enough.  This version uses the correct variable.  $orig_head looks like
 the right name, but it stores the symbolic ref.  $prev_head stores the actual
 SHA1, which is what I was looking for.
 git-rebase.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index e2d85ee..44db7e6 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -434,3 +434,4 @@ do
 done
 
 finish_rb_merge
+git update-ref ORIG_HEAD $orig_head
-- 
1.5.6.2.337.gf6537
Previous: Brian Gernhardt
Message 2 of 2 in “Make rebase save ORIG_HEAD if changing current branch”
  1. Make rebase save ORIG_HEAD if changing current branchBrian Gernhardt, Jul 6, 2008
  2. Make rebase save ORIG_HEAD if changing current branchBrian Gernhardt, Jul 6, 2008

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.