Re: Cherry-pick dangles and forgets helpful advice in next

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

 



Phil Hord <hordp@xxxxxxxxx> writes:

> In git.git 'master' when I cherry-pick a commit which is eventually
> empty, git gives me a friendly description of my supposed error, leaves
> my cherry-pick "pending" and exits with an error code.
>
>
> $ git cherry-pick a0aff2d                          
> # On branch master
> nothing to commit (working directory clean)
> The previous cherry-pick is now empty, possibly due to conflict resolution.
> If you wish to commit it anyway, use:
>
>     git commit --allow-empty
>
> Otherwise, please use 'git reset'
>
> In 'next' this is broken.  Now git does not tell me anything and it does
> not exit with an error code.

There probably is something else that is broken in _your_ build.  The test
t3505.2 is about failing an attempt to cherry-pick an empty commit:

        test_expect_success 'cherry-pick an empty commit' '
                git checkout master && {
                        git cherry-pick empty-branch^
                        test "$?" = 1
                }
        '

If I insert an "exit" immediately after this test and run the test with
"-i -v" option, it ends like this:

    $ make && cd t && sh t3505-cherry-pick-empty.sh -i -v
    ...
    ok 1 - setup

    expecting success:
            git checkout master && {
                    git cherry-pick empty-branch^
                    test "$?" = 1
            }

    Switched to branch 'master'
    Already up-to-date!
    # On branch master
    nothing to commit (working directory clean)
    The previous cherry-pick is now empty, possibly due to conflict
    resolution.
    If you wish to commit it anyway, use:

        git commit --allow-empty

    Otherwise, please use 'git reset'
    ok 2 - cherry-pick an empty commit

    FATAL: Unexpected exit with code 0

It does fail with non-zero exit code (it might be better to test with
test_expect_failure, but that is a minor point here), and we see the error
message.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]