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

Re: [PATCH v3 7/7] documentation: format-patch: clarify requirements for patch-ids to match

From
Jerry Zhang <jerry@skydio.com>
Date
Oct 18, 2022, 21:57 UTC
Message-ID
<CAMKO5CuqLSowSo3fhOux-fY8ek-CL4zudgA0fBjXAt+9CBhs9g@mail.gmail.com>
In-Reply-To
<xmqqo7ua1nrz.fsf@gitster.g>
On Mon, Oct 17, 2022 at 8:19 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 21 quoted lines
>
> "Jerry Zhang via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> >  The 'base commit' is shown as "base-commit: " followed by the 40-hex of
> >  the commit object name.  A 'prerequisite patch' is shown as
> >  "prerequisite-patch-id: " followed by the 40-hex 'patch id', which can
> > -be obtained by passing the patch through the `git patch-id --stable`
> > -command.
> > +be obtained by passing the patch (generated with -U3 --full-index) through
> > +the `git patch-id --stable` command.
>
> This is not incorrect per-se, but I wonder how much it would help or
> mislead people in practice.
>
> I understand that the update means well to help those who complain
> "'patch-id' produces wrong result when I feed the output of 'git
> diff -U1'" by making them suspect that their -U1 may be the culprit.
> But the new description does not cover everything that can affect
> the resulting patch ID (the choice of --diff-algorithm affects how
> common lines are matched up between the preimage and the postimage,
> for example).

I can add a note about diff algorithm as well. Its slightly different from the other two options in that there should be fewer cases where diff algorithm is a problem. U3 and full-index aren't the default options to "git diff" so people are more likely to have the wrong options, whereas they would explicitly have to run the two diffs with different algorithms to run into a problem. But there's no harm in being more specific.

>
> So, I dunno.

Keeping patch-ids the same is difficult especially between different git versions, as changes could be made to "diff" that seem like improvements but would slightly change patch-id even with the same args. I expect that people generally aren't keeping the compatibility of patch-id in mind when changing diff. Nevertheless since we've already advertised that they would match, we ought to give users the best advice possible to minimize if not eliminate confusion.

Previous: Junio C HamanoNext: Junio C Hamano
Message 18 of 46 in “update internal patch-id to use "stable" algorithm”
  1. 0/2 update internal patch-id to use "stable" algorithmJerry Zhang via GitGitGadget, Sep 20, 2022
  2. 2/2 patch-id: use stable patch-id for rebasesJerry Zhang via GitGitGadget, Sep 20, 2022
  3. 1/2 patch-id: fix stable patch id for binary / header-onlyJerry Zhang via GitGitGadget, Sep 20, 2022
  4. 0/2 update internal patch-id to use "stable" algorithmJerry Zhang via GitGitGadget, Sep 20, 2022
  5. 1/2 patch-id: fix stable patch id for binary / header-onlyJerry Zhang via GitGitGadget, Sep 20, 2022
  6. 2/2 patch-id: use stable patch-id for rebasesJerry Zhang via GitGitGadget, Sep 20, 2022
  7. 0/7 patch-id fixes and improvementsJerry Zhang via GitGitGadget, Oct 14, 2022
  8. 1/7 patch-id: fix stable patch id for binary / header-onlyJerry Zhang via GitGitGadget, Oct 14, 2022
  9. 2/7 patch-id: use stable patch-id for rebasesJerry Zhang via GitGitGadget, Oct 14, 2022
  10. 3/7 builtin: patch-id: fix patch-id with binary diffsJerry Zhang via GitGitGadget, Oct 14, 2022
  11. Junio C HamanoOct 14, 2022
  12. Jerry ZhangOct 14, 2022
  13. Junio C HamanoOct 14, 2022
  14. Jerry ZhangOct 14, 2022
  15. Junio C HamanoOct 17, 2022
  16. 7/7 documentation: format-patch: clarify requirements for patch-ids to matchJerry Zhang via GitGitGadget, Oct 14, 2022
  17. Junio C HamanoOct 17, 2022
  18. Jerry ZhangOct 18, 2022
  19. Junio C HamanoOct 19, 2022
  20. 4/7 patch-id: fix patch-id for mode changesJerry Zhang via GitGitGadget, Oct 14, 2022
  21. Junio C HamanoOct 14, 2022
  22. 6/7 builtin: patch-id: remove unused diff-tree prefixJerry Zhang via GitGitGadget, Oct 14, 2022
  23. Junio C HamanoOct 14, 2022
  24. 5/7 builtin: patch-id: add --include-whitespace as a command modeJerry Zhang via GitGitGadget, Oct 14, 2022
  25. Junio C HamanoOct 14, 2022
  26. Jerry ZhangOct 14, 2022
  27. Junio C HamanoOct 17, 2022
  28. Jerry ZhangOct 18, 2022
  29. 0/6 patch-id fixes and improvementsJerry Zhang via GitGitGadget, Oct 20, 2022
  30. 1/6 patch-id: fix stable patch id for binary / header-onlyJerry Zhang via GitGitGadget, Oct 20, 2022
  31. 2/6 patch-id: use stable patch-id for rebasesJerry Zhang via GitGitGadget, Oct 20, 2022
  32. 3/6 builtin: patch-id: fix patch-id with binary diffsJerry Zhang via GitGitGadget, Oct 20, 2022
  33. 4/6 patch-id: fix patch-id for mode changesJerry Zhang via GitGitGadget, Oct 20, 2022
  34. 5/6 builtin: patch-id: add --verbatim as a command modeJerry Zhang via GitGitGadget, Oct 20, 2022
  35. 6/6 builtin: patch-id: remove unused diff-tree prefixJerry Zhang via GitGitGadget, Oct 20, 2022
  36. Junio C HamanoOct 21, 2022
  37. 0/6 patch-id fixes and improvementsJerry Zhang via GitGitGadget, Oct 24, 2022
  38. 4/6 patch-id: fix patch-id for mode changesJerry Zhang via GitGitGadget, Oct 24, 2022
  39. 5/6 builtin: patch-id: add --verbatim as a command modeJerry Zhang via GitGitGadget, Oct 24, 2022
  40. 1/6 patch-id: fix stable patch id for binary / header-onlyJerry Zhang via GitGitGadget, Oct 24, 2022
  41. 2/6 patch-id: use stable patch-id for rebasesJerry Zhang via GitGitGadget, Oct 24, 2022
  42. 3/6 builtin: patch-id: fix patch-id with binary diffsJerry Zhang via GitGitGadget, Oct 24, 2022
  43. 6/6 builtin: patch-id: remove unused diff-tree prefixJerry Zhang via GitGitGadget, Oct 24, 2022
  44. Junio C HamanoOct 24, 2022
  45. Junio C HamanoSep 21, 2022
  46. Jerry ZhangSep 21, 2022

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.