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

Re: [PATCH] docs: Clarify what git-rebase's "--preserve-merges" does

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 30, 2015, 17:23 UTC
Message-ID
<xmqqfv8mxuuv.fsf@gitster.dls.corp.google.com>
In-Reply-To
<5519178A.6080408@gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 7 quoted lines
> So how about:
>
> [PATCH] docs: Clarify what git-rebase's "-p" / "--preserve-merges" does
>
> Ignoring a merge sounds like ignoring the changes a merge commit
> introduces altogether, as if the merge commit was skipped or dropped from
> history. But that is not what happens if "-p" is not specified.

Every time I read the above (which is essentially the same from your first edition I think) I find the "ignoring the changes a merge commit introduces altogether" and "as if the merge commit was skipped" somehow contradicting with each other. If the latter were "as if the side branch that was merged was skipped or dropped", I do not see the room for such a misinterpretation.

That is, at least to me,
         D---E---F
        /         \
    ---A---B---C---G---H

the former, i.e. "the changes the merge G introdues", is "diff C G", while "merge commit was skipped" would mean a history like this:

    ---A---B---C---D'--E'--F'--H'

And I think with "as if the side branch that was merged was dropped", this misinterpretation will become impossible. It can only mean this history:

    ---A---B---C---.---H'
Show 25 quoted lines
> Instead, what happens is that the individual commits a merge commit
> introduces are replayed in order, and only any possible merge conflict
> resolutions or manual amendments to the merge commit are ignored. Get this
> straight in the docs.
>
> Also, do not say that merge commits are *tried* to be recreated. As that is
> true almost everywhere it is better left unsaid.
>
> Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
> ---
>  Documentation/git-rebase.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
> index d728030..47984e8 100644
> --- a/Documentation/git-rebase.txt
> +++ b/Documentation/git-rebase.txt
> @@ -362,7 +362,9 @@ default is `--no-fork-point`, otherwise the default is `--fork-point`.
>  
>  -p::
>  --preserve-merges::
> -	Instead of ignoring merges, try to recreate them.
> +	Recreate merge commits instead of flattening the history by replaying
> +	commits a merge commit introduces. Merge conflict resolutions or manual
> +	amendments to merge commits are not preserved.
The patch text itself reads fine.
>  +
>  This uses the `--interactive` machinery internally, but combining it
>  with the `--interactive` option explicitly is generally not a good
Previous: Sebastian SchuberthNext: Sebastian Schuberth
Message 15 of 19 in “docs: Clarify what git-rebase's "--preserve-merges" does”
  1. docs: Clarify what git-rebase's "--preserve-merges" doesSebastian Schuberth, Mar 26, 2015
  2. Junio C HamanoMar 26, 2015
  3. Sebastian SchuberthMar 26, 2015
  4. Junio C HamanoMar 26, 2015
  5. Sergey OrganovMar 26, 2015
  6. Johannes SixtMar 26, 2015
  7. Sergey OrganovMar 31, 2015
  8. Junio C HamanoMar 31, 2015
  9. Sergey OrganovMar 31, 2015
  10. Junio C HamanoMar 31, 2015
  11. Sergey OrganovApr 1, 2015
  12. Junio C HamanoApr 1, 2015
  13. Sergey OrganovApr 2, 2015
  14. Sebastian SchuberthMar 30, 2015
  15. Junio C HamanoMar 30, 2015
  16. Sebastian SchuberthMar 30, 2015
  17. Junio C HamanoMar 30, 2015
  18. Junio C HamanoMar 30, 2015
  19. Sebastian SchuberthMar 30, 2015

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.