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

RFC: indicating diff strategy in format-patch message headers

From
Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Date
Jun 5, 2024, 18:01 UTC
Message-ID
<20240605-hilarious-dramatic-mushroom-7fd941@lemur>
Hello, all:

When developing tooling that attempts to map commits to patches, we often don't have more than just the git-patch-id to go by. The problem is, there is any number of ways to generate patches from commits:

- using a different strategy (--histogram, --patience, etc)
- using a different number of context lines (-U5)

Without knowing what options were used by the original author, we cannot be certain that we'll create a patch with the same git-patch-id, even if it's from the exact same commit.

Would it make sense to have git-format-patch (and friends) include an additional header hinting at the options used to generate the patch? E.g.:

    X-git-diff-options: algo=myers; context=3;

It won't help for all cases where we need to make a match (e.g. when we match from git commits to a patch query), but it will help matching the other way.

Any thoughts?
-K
Next: Junio C Hamano
Message 1 of 6 in “RFC: indicating diff strategy in format-patch message headers”
  1. Konstantin RyabitsevJun 5, 2024
  2. Junio C HamanoJun 5, 2024
  3. Konstantin RyabitsevJun 5, 2024
  4. Eric WongJun 5, 2024
  5. Konstantin RyabitsevJun 7, 2024
  6. Eric WongJun 16, 2024

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.