git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ye Xiaolong <xiaolong.ye@intel.com>
Cc: git@vger.kernel.org, fengguang.wu@intel.com,
	ying.huang@intel.com, philip.li@intel.com, julie.du@intel.com
Subject: Re: [PATCH v3 3/4] format-patch: introduce --base=auto option
Date: Tue, 05 Apr 2016 00:21:21 -0700	[thread overview]
Message-ID: <xmqqk2kc34i6.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160405063609.GB10110@yexl-desktop> (Ye Xiaolong's message of "Tue, 5 Apr 2016 14:36:09 +0800")

Ye Xiaolong <xiaolong.ye@intel.com> writes:

>       ---1---o---A
>      /    \ /
>  ---O      X
>      \    / \
>       ---2---o---o---B
>
> For this criss-cross merges, as neither merge base(like 1) is better
> than the other(both 1 and 2 are 'best' merge bases), I think it should
> be fine to pick a random one as base commit(Or you prefer to show all of
> them?) and I'll add this part of discusstion into documentation.

I think you should error out; it would give you blatantly wrong to
pick either one at random.

Suppose A is where your remote-tracking branch is, and B is where
the user started working on her serie.  We are sending patches built
on top of B (not depicted) with "format-patch --base=A B..".

If you picked '1' as the base, you'll include commits on the ===
stretch as prerequisite patches (think of any non-merge --o-- in the
picture to consist of multiple commits), but you won't be showing
what the merge 'M' between '1' and '2' did to the tree of '1' to
arrive at the resulting tree of 'M'.

       ---1---o---A
      /    \ /
  ---O      X
      \    / \
       ---2---M===o===B...your.patches.here...

If you picked '2' as the base, you'll include commits on the ===
stretch as prerequisite patches, but again you won't be showing what
the merge 'M' between '1' and '2' did to the tree of '2' to arrive
at the resulting tree of 'M'..

       ---1---o---A
      /    \ /
  ---O      X
      \    / \
       ---2===M===o===B...your.patches.here...

So either case, you cannot rebuild the tree of B by going from the
base and piling on patches in such a case, because you won't have
"patch" for merge 'M'.

  reply	other threads:[~2016-04-05  7:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31  1:46 [PATCH v3 0/4] Add an option to git-format-patch to record base tree info Xiaolong Ye
2016-03-31  1:46 ` [PATCH v3 1/4] patch-ids: make commit_patch_id() a public helper function Xiaolong Ye
2016-03-31  1:46 ` [PATCH v3 2/4] format-patch: add '--base' option to record base tree info Xiaolong Ye
2016-03-31 17:38   ` Junio C Hamano
2016-04-01 13:38     ` Ye Xiaolong
2016-04-01 16:00       ` Junio C Hamano
2016-04-05  5:52         ` Ye Xiaolong
2016-04-09 15:56     ` Ye Xiaolong
2016-03-31  1:46 ` [PATCH v3 3/4] format-patch: introduce --base=auto option Xiaolong Ye
2016-03-31 17:43   ` Junio C Hamano
2016-04-01 13:52     ` Ye Xiaolong
2016-04-01 16:06       ` Junio C Hamano
2016-04-05  6:36         ` Ye Xiaolong
2016-04-05  7:21           ` Junio C Hamano [this message]
2016-03-31  1:46 ` [PATCH v3 4/4] format-patch: introduce format.base configuration Xiaolong Ye
2016-03-31 17:45 ` [PATCH v3 0/4] Add an option to git-format-patch to record base tree info Junio C Hamano

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=xmqqk2kc34i6.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=fengguang.wu@intel.com \
    --cc=git@vger.kernel.org \
    --cc=julie.du@intel.com \
    --cc=philip.li@intel.com \
    --cc=xiaolong.ye@intel.com \
    --cc=ying.huang@intel.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).