All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Gernhardt <benji@silverinsanity.com>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] Make rebase save ORIG_HEAD if using current branch
Date: Tue, 6 May 2008 01:19:20 -0400	[thread overview]
Message-ID: <20080506051920.GA9165@Hermes.local> (raw)

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>
---

 I was trying to figure out why reviewing the new changes in git was so
 hard using my `git log ORIG_HEAD..` alias.  Turns out my ORIG_HEAD
 hadn't been updated since Feburary, which is when I set
 branch.master.rebase to true.

 I think ORIG_HEAD should be set every time a pull changes HEAD, whether
 by a merge or rebase.  Making rebase act like merge seemed more elegant
 than having git-pull set ORIG_HEAD iff using rebase.

 git-rebase.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

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"
 	;;
 esac
 orig_head=$branch
-- 
1.5.5.1.242.g558e8

             reply	other threads:[~2008-05-06  5:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06  5:19 Brian Gernhardt [this message]
2008-05-06  6:32 ` [PATCH] Make rebase save ORIG_HEAD if using current branch Johannes Sixt
2008-05-06 17:45   ` Brian Gernhardt
2008-05-07  8:14     ` Johannes Sixt
2008-05-07 14:30       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080506051920.GA9165@Hermes.local \
    --to=benji@silverinsanity.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.