Re: git symbolic-ref vs. reflog (vs. rebase)
- From
Csaba Henk <csaba@lowlife.hu>
- Date
- Apr 29, 2011, 17:21 UTC
- Message-ID
- <BANLkTi=yDECQs=mVkEfrkrFfy0dgFf4U3Q@mail.gmail.com>
- In-Reply-To
- <7vk4edyqqn.fsf@alter.siamese.dyndns.org>
On Fri, Apr 29, 2011 at 9:49 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> Csaba Henk <csaba@lowlife.hu> writes:
>
>> "git symbolic-ref" is a dangerous command in the sense that it can
>> change your HEAD position without updating the reflog. Is it
>> intended behaviour?
>
> Yes, it is. But you can choose to do:
>
> $ git branch side
> $ git symoblic-ref -m "move to side" HEAD refs/heads/side
> $ git log --oneline -g HEAD@{0}
> 05ddb9b HEAD@{0}: move to side
> e69de29 HEAD@{1}: commit (initial): first commit
>
> if you wanted to.So do you think the following patch would be the correct fix for the rebase issue:
diff --git a/git-rebase.sh b/git-rebase.sh index cbb0ea9..10c1727 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -284,7 +284,7 @@ do head_name="$(cat "$dotest"/head-name)" && case "$head_name" in refs/*) - git symbolic-ref HEAD $head_name || + git symbolic-ref -m "rebase: aborting" HEAD $head_name || die "Could not move back to $head_name" ;; esac ? Csaba