From: Junio C Hamano <gitster@pobox.com>
To: Jon Loeliger <jdl@freescale.com>
Cc: Miles Bader <miles@gnu.org>, Git List <git@vger.kernel.org>
Subject: Re: "git pull REMOTE" question
Date: Wed, 22 Aug 2007 13:29:36 -0700 [thread overview]
Message-ID: <7vmywjia8f.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1187801063.15321.4.camel@ld0161-tx32> (Jon Loeliger's message of "Wed, 22 Aug 2007 11:44:23 -0500")
Jon Loeliger <jdl@freescale.com> writes:
> On Wed, 2007-08-22 at 00:11, Junio C Hamano wrote:
> ...
>> ;; new -- when on "master', and the user says to pull from "usb"
>> ;; without saying which branch to merge, use '[remote "usb"] url'
>> ;; and '[remote "usb"] fetch' to decide where to fetch from,
>> ;; and merge their refs/heads/xprm to our branch.
>> [branch "master:usb"]
>> merge = refs/heads/xprm
>>
>> The trick in the new syntax is that you cannot have a colon in
>> refname, so there is no way for existing [branch $name] section
>> to crash with the new style definition.
>
> Wasn't there was a brief alternate notion to add a "for <remote>"
> clause and allowing something like this?:
>
> [branch "master"]
> merge = refs/heads/xprm for usb
> merge = refs/heads/stuff for otherremote
Yeah, I remember that one (I do not think nobody implemented it,
though). Thanks for reminding.
So...
[branch "master"]
remote = origin
merge = refs/heads/xprm for usb
merge = refs/heads/stuff for otherremote
merge = refs/heads/master
and when you are on your "master",
$ git fetch
$ git pull
goes to "origin" (because you did not even say the remote name).
$ git fetch usb
$ git pull usb
goes to "usb". And "git pull" from such a nicknamed remote
looks up merge lines with "for nickname" to find the branch(es)
to merge. If there is no merge line with "for nickname" for the
remote (e.g. "git pull origin" in the above example does not
have any), and if there is a merge line without "for nickname",
then that line can be used (e.g. "git pull" which is exactly the
same as "git pull origin" will use the 'master' branch from the
remote).
I think that is much easier to understand and maintain for the
end users than the [branch "master:usb"]. The latter is wrong
to begin with -- it is not about branch anymore.
prev parent reply other threads:[~2007-08-22 20:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-22 4:23 "git pull REMOTE" question Miles Bader
2007-08-22 4:35 ` Junio C Hamano
2007-08-22 4:44 ` Miles Bader
2007-08-22 5:11 ` Junio C Hamano
2007-08-22 16:44 ` Jon Loeliger
2007-08-22 20:29 ` Junio C Hamano [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vmywjia8f.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jdl@freescale.com \
--cc=miles@gnu.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 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 NNTP newsgroup(s).