git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Brian Gernhardt <benji@silverinsanity.com>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH] Make rebase save ORIG_HEAD if using current branch
Date: Wed, 07 May 2008 07:30:21 -0700	[thread overview]
Message-ID: <7vbq3ifapu.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <482164F6.4010205@viscovery.net> (Johannes Sixt's message of "Wed, 07 May 2008 10:14:46 +0200")

Johannes Sixt <j.sixt@viscovery.net> writes:

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

Very true.  If the purpose of this is to view "diff/log ORIG_HEAD.." after
"pull --rebase", setting it there does not make much sense.  In any case,
"diff/log branch@{1}..." will give you the same information unless you are
rebasing an already detached HEAD, so letting ORIG_HEAD get overwritten
like this patch does is not the end of the world, but then the original
issue of the lack of ORIG_HEAD is not much of an issue either with that
logic.

What the patch implements would be an ORIG_HEAD that only sometimes works
(iow, does not work if you did reset during rebasing session), which is
not what people can rely on.  Teaching people a more reliable way of using
reflog, which incidentally is also a consistent way between "pull" and
"pull --rebase", might be better than that.  I would agree that the ideal
thing is an ORIG_HEAD that always works, because it gives us the
consistency between the normal "pull" and "pull --rebase", though.

>> ...  Also, might you want to access the original HEAD during a
>> rebase conflict?  (Although that would argue that ORIG_HEAD should be
>> set for all rebases, to $upstream.)

I often find it useful to say "show-branch HEAD topic" while rebasing the
topic (gitk HEAD...topic would work equally well), taking advantage of the
fact that the topic stays at the original position until rebase completes.
You do not need ORIG_HEAD pointing at anywhere to help that history
inspection.

I do not think setting ORIG_HEAD to $upstream (actually, it should be
"onto") makes much sense.  After a normal "pull", what you can inspect
with "diff/log ORIG_HEAD" is the newly acquired history.  If we were to
allow ORIG_HEAD to be used after a "pull --rebase" in a similar way, if
you make it point at "the onto" commit, "diff/log ORIG_HEAD" would show
the changes _you_ had before you did rebase that you carried forward, not
the new history you acquired with the "pull --rebase" operation.

      reply	other threads:[~2008-05-07 14:31 UTC|newest]

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

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=7vbq3ifapu.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=benji@silverinsanity.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).