git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Elijah Newren <newren@gmail.com>
Cc: Wang Yugui <wangyugui@e16-tech.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: git format-patch lost the last part when branch merge
Date: Tue, 23 Feb 2021 23:50:42 -0500	[thread overview]
Message-ID: <YDXbIk5TLrHWQhwv@coredump.intra.peff.net> (raw)
In-Reply-To: <CABPp-BFa3CnOHMg4t99xMHWif8kMZJFcmHtLSNxZgAPaw1Cd=Q@mail.gmail.com>

On Tue, Feb 23, 2021 at 08:24:24PM -0800, Elijah Newren wrote:

> > You could imagine ways for format-patch to represent the conflict
> > resolution done in a merge, but it's not quite trivial, and nobody has
> > done it yet.
> 
> Are you referring to something like this (in the git.git repository)?
> 
> $ git show --oneline --remerge-diff 42342b3ee6
> 42342b3ee6 Merge branch 'ab/mailmap'
> diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
> index 1bce961e07..6fb18a34b0 100755
> --- a/t/t4203-mailmap.sh
> +++ b/t/t4203-mailmap.sh
> @@ -257,16 +257,8 @@ test_expect_success 'No mailmap files, but configured' '
> 
>  test_expect_success 'setup mailmap blob tests' '
>         git checkout -b map &&
> -<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 60ecad090d (Merge branch 'ps/fetch-atomic')
>         test_when_finished "git checkout main" &&
> -       cat >just-bugs <<- EOF &&
> -|||||||||||||||||||||||||||||||| 72c4083ddf
> -       test_when_finished "git checkout master" &&
> -       cat >just-bugs <<- EOF &&
> -================================
> -       test_when_finished "git checkout master" &&
>         cat >just-bugs <<-\EOF &&
> ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 4e168333a8 (shortlog: remove
> unused(?) "repo-abbrev" feature)
>         Blob Guy <bugs@company.xx>
>         EOF
>         cat >both <<-EOF &&
> 
> 
> I agree that representing the conflict done in a merge is more
> difficult than it sounds, but if you mean what I think you mean then I
> disagree with the "nobody has done it yet" half of your statement.
> :-)
> 
> That said, I haven't attempted to tie this into format-patch in any
> way, and have absolutely no plans to.  (And --remerge-diff hasn't been
> submitted upstream, because it depends on ort, and that still needs
> reviews...)

I certainly was thinking of remerge-diff when I was writing all of that,
but didn't want to get too far into the details. I think it's an
absolutely wonderful way of showing off conflict resolution, and I'm
excited to see it as a feature in Git. But:

  - as you note, it isn't a public feature yet ;)

  - while format-patch will learn about it because it knows all of the
    diff formats, the fundamental point of format-patch is to produce
    output that can be applied with git-am. So we'd only be halfway
    there.

  - it does still get weird specifying a merge at all as part of a
    series. Merging _what_ exactly? The topic branch made of the patches
    that were just sent?  A back-merge from some other commit on master
    into the topic branch? And if the latter, wouldn't that depend
    heavily on the base commit that the patches are applied on top of?

So I left it as "you could imagine" and "it's not quite trivial". ;)

-Peff

      reply	other threads:[~2021-02-24  4:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 13:16 git format-patch lost the last part when branch merge Wang Yugui
2021-02-22 22:57 ` Jeff King
2021-02-22 23:08   ` [PATCH] docs/format-patch: mention handling of merges Jeff King
2021-02-22 23:31     ` Junio C Hamano
2021-02-22 23:40       ` Jeff King
2021-02-23  1:24         ` Junio C Hamano
2021-02-23  1:48           ` Jeff King
2021-02-22 23:25   ` git format-patch lost the last part when branch merge Junio C Hamano
2021-02-24  4:24   ` Elijah Newren
2021-02-24  4:50     ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YDXbIk5TLrHWQhwv@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=wangyugui@e16-tech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).