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 v2 3/4] format-patch: introduce --base=auto option
Date: Thu, 24 Mar 2016 10:01:58 -0700 [thread overview]
Message-ID: <xmqq37rfajy1.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160324041925.GB26582@yexl-desktop> (Ye Xiaolong's message of "Thu, 24 Mar 2016 12:19:25 +0800")
Ye Xiaolong <xiaolong.ye@intel.com> writes:
> On Wed, Mar 23, 2016 at 11:25:41AM -0700, Junio C Hamano wrote:
>>I also do not see the point of showing "parent id" which as far as I
>>can see is just a random commit object name and show different
>>output that is not even described what it is. It would be better to
>
> Here is our consideration:
> There is high chance that branch_get_upstream will retrun NULL(thus we
> are not able to get exact base commit), since developers may checkout
> branch from a local branch or a commit and haven't set "--set-upstream-to"
> to track a remote branch, in this case, we want to provide likely useful
> info(here is parent commit id and patch id)
I do not agree with that reasoning at all, primarily because your
"likely useful" is not justfied.
Could you explain what makes you think that it is "likely" that the
commit that matches "parent commit id" is available to the recipient
of the patch?
Whatever the reason is, if it _is_ likely, then I do not see a point
in spending cycle to do get-upstream and merge-base, or giving an
option to the user to explicitly specify the base. Given that this
series does these things, I'd have to conclude your "likely useful"
is "might possibly turn out to be useful in some cases if you are
lucky but is no way reliable" at best.
Rather than throwing an unreliable information in the output and
blindly proceeding, I'd think you would want to error out and tell
the user to explicitly give the base without producing the patch
output. That way, you will not get patches with unreliable
information.
Suggesting to use set-upstream-to when you give that error message
may also be helpful.
next prev parent reply other threads:[~2016-03-24 17:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-23 8:52 [PATCH v2 0/4] Add an option to git-format-patch to record base tree info Xiaolong Ye
2016-03-23 8:52 ` [PATCH v2 1/4] patch-ids: make commit_patch_id() a public helper function Xiaolong Ye
2016-03-23 8:52 ` [PATCH v2 2/4] format-patch: add '--base' option to record base tree info Xiaolong Ye
2016-03-23 18:08 ` Junio C Hamano
2016-03-24 3:08 ` Ye Xiaolong
2016-03-23 8:52 ` [PATCH v2 3/4] format-patch: introduce --base=auto option Xiaolong Ye
2016-03-23 18:25 ` Junio C Hamano
2016-03-24 4:19 ` Ye Xiaolong
2016-03-24 17:01 ` Junio C Hamano [this message]
2016-04-01 5:07 ` Ye Xiaolong
2016-04-01 16:36 ` Junio C Hamano
2016-03-23 8:52 ` [PATCH v2 4/4] format-patch: introduce format.base configuration Xiaolong Ye
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq37rfajy1.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.