From: Johannes Sixt <j.sixt@viscovery.net>
To: Brian Gernhardt <benji@silverinsanity.com>
Cc: Git List <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] Make rebase save ORIG_HEAD if using current branch
Date: Wed, 07 May 2008 10:14:46 +0200 [thread overview]
Message-ID: <482164F6.4010205@viscovery.net> (raw)
In-Reply-To: <54536F65-3A06-482E-9806-2E4F643C1024@silverinsanity.com>
Brian Gernhardt schrieb:
> On May 6, 2008, at 2:32 AM, Johannes Sixt wrote:
>> Brian Gernhardt schrieb:
>>> + echo "$branch" > "$GIT_DIR/ORIG_HEAD"
>>
>> 1. You should be using 'git update-ref' here, I think.
>> 2. You should detect errors.
>
> This is exactly how git-merge.sh does it. While that's not a good
> argument for adding this, perhaps merge should be updated as well. And
> presumably update-ref will make detecting errors easy. But is being
> unable to set ORIG_HEAD an error that should stop the entire process?
Probably not.
>> 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.
>
> I put it where I did because I thought it would only make sense when
> rebasing the current HEAD (instead of the two argument version that
> switches first). Duplicating the logic to determine that later seemed
> wasteful. 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.)
Well, I can't think of a use-case where ORIG_HEAD would be extremly useful
for _me_, but you argued for one (git pull --rebase), so you make it so
that it suits you. I'm just drawing a scenario where ORIG_HEAD possibly is
not what you expect.
-- Hannes
next prev parent reply other threads:[~2008-05-07 8:15 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 [this message]
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=482164F6.4010205@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=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 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).