Re: [RFC] sequencer: allow metadata to be saved if using cherry-pick --no-commit

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

 



Edmundo Carmona Antoranz <eantoranz@xxxxxxxxx> writes:

> Currently, if 'git cherry-pick --no-commit' is run _and the cherry-pick
> operation is successful_, the metadata from the original revision is lost and
> to git it's like a cherry-pick operation is not taking place at all. Hence,
> we can't wrap up the cherry-pick operation by calling
> 'git cherry-pick --continue'.

This cuts both ways, though.

I often use the "--no-commit" form of the command as a better
version of the 'git show $that_commit | git apply --index' pipeline,
and what I'll do starting from the working tree that I prepare that
way is often *not* to commit it exactly or even use any data from
the original commit.

So a change like this would make the use of the command for my
usecase more cumbersome---now it leaves cruft behind, so I need to
clean it up later, but with what?  "cherry-pick --abort" would
try to muck with the index and the working tree, but that is not
definitely what I want.

So, personally, I am fairly negative on this line of change.  If the
user says upfront "--no-commit", then user does not want a commit,
so why should we even allow "--continue"?

Before dismissing the idea totally, let's see what potential use
cases this change _could_ benefit, and see if there are already ways
to satisfy these use cases without making this change.  For example,
if the user wants to examine the result before actually "committing"
to move the target branch forward with this change, keeping it an
option to back out if the result of cherry-picking turns out to be
bad, the "--no-commit first, examine, and --continue or --abort"
sequence may help such a workflow.

But the user can already do so without this change:

    $ git checkout target_branch^0 ;#detach
    $ git cherry-pick source_branch
    ... examine the result ...
    ... and if it is satisfactory ...
    $ git checkout -B target_branch
    ... or if it is not, then discard ...
    $ git checkout target_branch

> With this patch, we allow sequencer to save the metadata from the original
> cherry-pick operation so that 'git cherry-pick --continue' can be called.




[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]

  Powered by Linux