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

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 31, 2012, 17:29 UTC
Message-ID
<7vy5o86yy2.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4FC6AFE3.5070805@cisco.com>
Phil Hord <hordp@cisco.com> writes:
Show 21 quoted lines
> Junio C Hamano wrote:
>
>> Instead of reverting the entire thing, perhaps we can fix the
>> regression like this.
>>
>> With this, we no longer unconditionally give "--allow-empty" when we
>> run "git commit", when --allow-empty (which is only about commits
>> that are originally empty) is given to cherry-pick; specifically,
>> when the user did not ask for --keep-redundant-commit, we do not
>> give "--allow-empty" if the original commit is not.
>>
>> Thinking about it again, I _think_ we do not even have to check if
>> the result is an empty commit ourselves ("git commit" will do that
>> for us anyway), so we might want to rip "is_empty_commit()" out of
>> the problematic patch and keep only "is_index_unmodified()" bit, but
>> for now I think this may be good enough.
>>
>> Phil, does it fix your issue?
>
> Yes, it appears to fix my issue.  I don't have the original condition in
> play anymore, but it fixes the test case I cooked up earlier.

OK, I'm planning to merge the fix down before 1.7.11 final. It may have broken the use case Neil wanted to support as a side effect (I tried to be careful but I did not do anything beyond the test cases as I do not deliberately add empty commits to my history); Neil may want to double check the result.

Thanks.
Previous: Phil Hord
Message 10 of 10 in “Cherry-pick dangles and forgets helpful advice in next”
  1. Phil HordMay 23, 2012
  2. Junio C HamanoMay 23, 2012
  3. Junio C HamanoMay 23, 2012
  4. Junio C HamanoMay 23, 2012
  5. Junio C HamanoMay 23, 2012
  6. Phil HordMay 23, 2012
  7. Junio C HamanoMay 23, 2012
  8. Junio C HamanoMay 30, 2012
  9. Phil HordMay 30, 2012
  10. Junio C HamanoMay 31, 2012

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.