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

Re: [PATCH v2] Let format-patch and rebase ignore trivial merges.

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 18, 2009, 18:23 UTC
Message-ID
<7vy6l0xhtf.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20091218151102.GB7211@pcpool00.mathematik.uni-freiburg.de>
"Bernhard R. Link" <brlink@debian.org> writes:

[offtopic: weren't you already asked not to try redirecting away direct responses to you by using M-F-T and wasting time of people who do want to respond directly to you? Please don't.]

Show 7 quoted lines
> As git rebase and git format-patch linearize commits,
> having the same change in different branches causes in the
> best case duplicate patches in the produced series and in the
> worst case conflicts. If there are trivial merges involved
> (i.e. merges that do not change the tree), then this patch
> will cause git to only look at one branch, thereby avoiding
> duplicates and reducing the chance of conflicts.

The patch text itself from the cursory review looks Ok (I haven't thought things through yet, let alone applying it, though).

One issue in the proposed commit log message above is that "trivial merge" is an established technical term that means something very different from "resulting tree of the merge matches exactly one of the parents' tree", and it needs to be reworded. In this case it is easy [*1*]. Drop everything after "If there are ...", and add something like this as a separate paragraph:

    Avoid outputting duplicate patches by ignoring all other parents when
    the merge result matches exactly one of the parents.
The code comment also needs to be adjusted.
Thanks.
[Footnote]

*1* It is a good habit to acquire to question yourself if you can omit "X" altogether and just say "Y" after writing "X (i.e. Y)".

Previous: Bernhard R. Link
Message 11 of 11 in “Let format-patch and rebase ignore trivial merges.”
  1. Let format-patch and rebase ignore trivial merges.Bernhard R. Link, Dec 16, 2009
  2. Johannes SixtDec 16, 2009
  3. Bernhard R. LinkDec 17, 2009
  4. Johannes SixtDec 17, 2009
  5. Bernhard R. LinkDec 17, 2009
  6. Junio C HamanoDec 17, 2009
  7. Bernhard R. LinkDec 18, 2009
  8. Johannes SixtDec 18, 2009
  9. Bernhard R. LinkDec 18, 2009
  10. Let format-patch and rebase ignore trivial merges.Bernhard R. Link, Dec 18, 2009
  11. Junio C HamanoDec 18, 2009

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.