Re: [PATCH 1/4] sequencer: Do not require `allow_empty` for redundant commit options

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

 



Hi Brian

On 23/01/2024 14:23, Phillip Wood wrote:

rebase always sets "opts->allow_empty = 1" in builtin/rebase.c:get_replay_opts() and if the user passes --no-keep-empty drops commits that start empty from the list of commits to be picked. This is slightly confusing but is more efficient as we don't do waste time trying to pick a commit we're going to drop. Can we do something similar for "git cherry-pick"? When cherry-picking a sequence of commits I think it should just work because the code is shared with rebase, for a single commit we'd need to add a test to see if it is empty in single_pick() before calling pick_commits().

Having thought about this again I don't think we can reuse the same approach as rebase because cherry-pick and rebase have different behaviors. "git rebase --no-keep-empty" drops empty commits whereas "git cherry-pick" wants to error out if it sees an empty commit. So I think your approach of reworking allow_empty() in the sequencer is the right approach.

Sorry for the confusion

Phillip





[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