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

Re: git format-patch doesn't exclude merged hunks

From
Pádraig Brady <p@draigbrady.com>
Date
May 16, 2012, 20:13 UTC
Message-ID
<4FB40A7E.80705@draigBrady.com>
In-Reply-To
<7v8vgsc544.fsf@alter.siamese.dyndns.org>
On 05/16/2012 08:12 PM, Junio C Hamano wrote:
Show 30 quoted lines
> Pádraig Brady <P@draigBrady.com> writes:
> 
>> On 05/16/2012 07:49 PM, Junio C Hamano wrote:
>>
>>> I am not fundamentally opposed to the idea of (optionally) detecting and
>>> selectively dropping parts of a patch to an entire file or even hunks that
>>> have already applied, but it needs to have a way remind the user somewhere
>>> in the workflow that it did so and the log message may no longer describe
>>> what the change does.  Most likely it would have to be done when producing
>>> format-patch output, but an approach to make it a responsibility to notice
>>> and fix the resulting log message to the person who applies the output, I
>>> would imagine.
>>
>> Yep agreed, it would have to be optional.
>> Maybe --ignore-duplicate-changes ?
>>
>> Appending a marker to the commit message of the adjusted patch would make sense,
>> similar to how a 'Conflicts:' list is auto generated for commit messages.
> 
> These existing "conflicts:" are offered when recording manual resolutions
> of a conflicting merge, and the user is actively thrown into an editor
> when running "git commit" to record the result.
> 
> A patch that is reduced in a way you propose will apply to the receiving
> tree cleanly without stopping, and does not offer an editor session to
> adjust the log before making a commit.  "The user has a chance to notice
> and correct" is not sufficient---nobody will spend extra effort to notice
> let alone correct.  The reminder has to be a lot stronger than that, I
> think, to cause the patch application to "fail" and require the user to
> actively look at the situation.

Yes it would make sense for `git am` to balk at such reduced patches, while allowing standard patch utilities to process the patches as normal.

cheers, Pádraig.

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “git format-patch doesn't exclude merged hunks”
  1. Pádraig BradyMay 16, 2012
  2. Junio C HamanoMay 16, 2012
  3. Pádraig BradyMay 16, 2012
  4. Junio C HamanoMay 16, 2012
  5. Pádraig BradyMay 16, 2012
  6. Junio C HamanoMay 16, 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.