pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/48844: git-rebase does not work



>Number:         48844
>Category:       pkg
>Synopsis:       git rebase is broken because dot commands are broken in sh(1)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 29 00:00:00 +0000 2014
>Originator:     Jarmo Jaakkola
>Release:        NetBSD 6.1.2_PATCH
>Organization:
>Environment:
System: NetBSD kotoisa.roskakori.fi 6.1.2_PATCH NetBSD 6.1.2_PATCH (KOTOISA) 
#5: Mon Jan 20 17:01:44 EET 2014 
jammuli%kotoisa.roskakori.fi@localhost:/usr/src/sys/arch/amd64/compile/KOTOISA 
amd64
Architecture: x86_64
Machine: amd64
git: git-base-1.8.5.1nb1
>Description:
After git rebase -i, HEAD is left in the wrong place, seemingly losing
commits.  The commits can be seen in reflog and the branch can be reset.

This is caused by sh(1) misbehaving when a dot command is executed in
a function and the dot command contains a return that is supposed
to return from the dot command.  See PR bin/48843.

To be exact:
    1) Line 181,
          . git-rebase--$type
       is executed in git-rebase's run_specific_rebase_internal().
    2) Line 860,
          return 0 
       is executed in a case statement in git-rebase--interactive
       because $action is continue.
    3) Bug #48843 steps in, effectively nullifying the return.
       Instead of returning from git-rebase--interactive, evaluation
       continues after the case, evaluating some of the commands.
    4) Evaluation ends up to line 181 in git-rebase--interactive,
       where
          shortupstream=$(git rev-parse --short $upstream)
       results in an error, because $upstream is not set (as it
       shouldn't be).
    5) And then things get worse some time later (I didn't debug
       further)

>How-To-Repeat:
$ mkdir example; cd example; git init
$ touch a; git commit -m a a
$ touch b; git commit -m b b
$ git rebase -i HEAD~1    # choose to edit the commit
$ git rebase --continue   # make no changes

This is where you get a rebase-todo to edit with the contents "noop".
After exiting the editor, this is seen:

    Successfully rebased and updated refs/heads/master.
    fatal: Needed a single revision
    Successfully rebased and updated refs/heads/master.

$ git log
commit 64b402544f30b020b388a834ca8728628de71328
Author: Jarmo Jaakkola <jarmo.jaakkola%roskakori.fi@localhost>
Date:   Thu May 29 02:10:07 2014 +0300

    a

The b commit is nowhere to be seen.

>Fix:
To fix the root of the problem, apply the patch in PR bin/48843 to sh(1).
How to fix git(1) instead of sh, that I do not know.  Patch git to use
another shell?



Home | Main Index | Thread Index | Old Index