git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 3/8] cherry-pick: add --skip-empty option

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jun 4, 2013, 17:10 UTC
Message-ID
<CAMP44s2DvtiT6hi-RoPt_bVdGr01S367usz=089E1Ht+Bvh-tA@mail.gmail.com>
In-Reply-To
<7vehcidg1i.fsf@alter.siamese.dyndns.org>
On Mon, Jun 3, 2013 at 4:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 53 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> On Mon, Jun 3, 2013 at 1:40 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>>
>>>> Pretty much what it says on the tin.
>>>>
>>>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>>>> ---
>>>>  Documentation/git-cherry-pick.txt   |  3 +++
>>>>  builtin/revert.c                    |  2 ++
>>>>  sequencer.c                         |  6 ++++++
>>>>  sequencer.h                         |  1 +
>>>>  t/t3508-cherry-pick-many-commits.sh | 13 +++++++++++++
>>>>  5 files changed, 25 insertions(+)
>>>>
>>>> diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
>>>> index c205d23..fccd936 100644
>>>> --- a/Documentation/git-cherry-pick.txt
>>>> +++ b/Documentation/git-cherry-pick.txt
>>>> @@ -129,6 +129,9 @@ effect to your index in a row.
>>>>       redundant commits are ignored.  This option overrides that behavior and
>>>>       creates an empty commit object.  Implies `--allow-empty`.
>>>>
>>>> +--skip-empty::
>>>> +     Instead of failing, skip commits that are or become empty.
>>>
>>> Not quite sure.  Is this "instead of recording an empty commit,"
>>> (which may or may not fail depending on the allow-empty settings)?
>>
>> We are explaining --skip-empty, not --allow-empty.
>
> Exactly.  That is why I found the "Instead of failing" questionable.
> It is very easy to read the above as "commits that are or become
> empty usually causes the command to fail, and this is a way to cause
> it not to fail.".
>
> It is true that
>
>     cherry-pick A
>
> when A becomes empty, dies.  But
>
>     cherry-pick --allow-empty A
>
> when A becomes empty, does not fail, but still does create an empty
> commit.  A large difference with --skip-empty, which applies to use
> scenario different from --allow-empty was meant to address, is that
>
>     cherry-pick --skip-empty A
>
> when A becomes empty, does not fail and does not create an empty
> commit, either.
We are not explaining --allow-empty.

What happens when you do --skip-empty --allow-empty? Somebody suggested a new option, so we could do --foo-empty=skip,allow to clarify that.

> I think just "Skip commits that are or become empty" without saying
> "Instead of failing," is fine, too.

I think "Instead of failing" makes perfect sense, because it's not our job to describe what other options do, simply explain what this option do. If the user is interested in other options, he can read them in the help for those.

-- 
Felipe Contreras
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 33 in “cherry-pick: improvements”
  1. 0/8 cherry-pick: improvementsFelipe Contreras, May 29, 2013
  2. 1/8 sequencer: remove useless indentationFelipe Contreras, May 29, 2013
  3. 2/8 sequencer: trivial fixFelipe Contreras, May 29, 2013
  4. 3/8 cherry-pick: add --skip-empty optionFelipe Contreras, May 29, 2013
  5. Junio C HamanoJun 3, 2013
  6. Junio C HamanoJun 3, 2013
  7. Felipe ContrerasJun 3, 2013
  8. Junio C HamanoJun 3, 2013
  9. Felipe ContrerasJun 4, 2013
  10. Junio C HamanoJun 4, 2013
  11. Felipe ContrerasJun 4, 2013
  12. Junio C HamanoJun 4, 2013
  13. Felipe ContrerasJun 5, 2013
  14. Junio C HamanoJun 5, 2013
  15. Felipe ContrerasJun 6, 2013
  16. Antoine PelisseJun 4, 2013
  17. 4/8 cherry-pick: store rewritten commitsFelipe Contreras, May 29, 2013
  18. Junio C HamanoJun 3, 2013
  19. Felipe ContrerasJun 3, 2013
  20. 5/8 sequencer: run post-rewrite hookFelipe Contreras, May 29, 2013
  21. Junio C HamanoJun 3, 2013
  22. Felipe ContrerasJun 3, 2013
  23. Thomas RastJun 4, 2013
  24. 6/8 cherry-pick: add support to copy notesFelipe Contreras, May 29, 2013
  25. 7/8 revert/cherry-pick: add --quiet optionFelipe Contreras, May 29, 2013
  26. Ramkumar RamachandraMay 29, 2013
  27. Felipe ContrerasMay 29, 2013
  28. Ramkumar RamachandraMay 29, 2013
  29. Felipe ContrerasMay 29, 2013
  30. Junio C HamanoJun 3, 2013
  31. 8/8 revert/cherry-pick: add --skip optionFelipe Contreras, May 29, 2013
  32. Ramkumar RamachandraMay 29, 2013
  33. Felipe ContrerasMay 29, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.