From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Philip Oakley <philipoakley@iee.org>, GitList <git@vger.kernel.org>
Subject: Re: [PATCH] doc: format-patch: don't use origin as a branch name
Date: Fri, 01 Aug 2014 13:08:30 -0700 [thread overview]
Message-ID: <xmqq8un8ug5d.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140801193614.GR12427@google.com> (Jonathan Nieder's message of "Fri, 1 Aug 2014 12:36:14 -0700")
Jonathan Nieder <jrnieder@gmail.com> writes:
> Philip Oakley wrote:
>
>> Historically (5 Nov 2005 v0.99.9-46-g28ffb89) the git-format-patch used
>> 'origin' as the upstream branch name. This is now used to name the remote.
>> Use the more modern 'master' as the branch name.
>
> Would 'origin/master' make sense?
It would make a lot more sense than 'master', I think.
The 'origin' will be DWIMmed to whatever the remote designated as
its primary branch, i.e. refs/remotes/origin/HEAD, and the
assumption the examples in question makes is that the user is
following along the simplest workflow to fork from it and upstream
her changes. Between 'origin' and 'origin/master', there isn't much
difference because of it. In the same spirit of following the
simplest workflow, that primary branch is likely to be their
'master', so 'origin/master' is OK but longer than 'origin' [*1*].
On the other hand, 'master' names the local 'master', which may be
very stale with respect to 'origin/master', or may have tons of
unrelated things that are not in origin/master, some of which may
have come from the branch the user is running format-patch to grab
patches to upstream. For this reason, changing 'origin' to 'master'
is not an improvement at all, I would have to say.
We could further adjust the underlying assumption to more modern
"checkout -t -b" era, and use "format-patch @{u}", but I suspect
that the readers of these examples are not yet ready for magic
before the basics to spell out things more explicitly is covered.
[Footnote]
*1* Also using 'origin' will cover the case when the primary branch
at the remote were not named 'master', so in that sense it is
slightly better and more generally applicable.
next prev parent reply other threads:[~2014-08-01 20:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 19:20 [PATCH] doc: format-patch: don't use origin as a branch name Philip Oakley
2014-08-01 19:36 ` Jonathan Nieder
2014-08-01 20:08 ` Junio C Hamano [this message]
2014-08-01 22:26 ` Philip Oakley
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=xmqq8un8ug5d.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=philipoakley@iee.org \
/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.