From: Junio C Hamano <junkio@cox.net>
To: hanwen@xs4all.nl
Cc: git@vger.kernel.org
Subject: Re: Pulling from refs/remotes/ ?
Date: Thu, 24 May 2007 20:06:43 -0700 [thread overview]
Message-ID: <7vwsyxsit8.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <465648EA.8070608@xs4all.nl> (Han-Wen Nienhuys's message of "Thu, 24 May 2007 23:24:42 -0300")
Han-Wen Nienhuys <hanwen@xs4all.nl> writes:
>> If somebody else (or yourself) did:
>>
>> $ git pull $dir LOCAL-BRANCH
>>
>> (replace $dir with the `pwd` you would get in your repository),
>> that would work. Why shouldn't it work for yourself?
>
> Because
>
> "You are treating your local repository as if it is a remote
> repository somewhere else, namely, '.' (current repository)."
>
> that was the justification for not being able to pull in a remote
> branch. This justification (which I disagree with) applies to this
> case as well.
Ah, so "forbidding a pull of local branch" was tongue-in-cheek
comment, and what you really wanted was to allow pulling remote
tracking branch with pull, either inside or outside of a
repository, like...
$ git pull $somebody_elses_repo remotes/origin/master
without having to say "remotes/"?
That one comes from a different design issue. refs/remotes/
hierarchy is local to your repository, and is not subject to
remote operation.
> I understand that we don't want people committing to
> remotes, because fetches will then later fail, but other than
> that, why should there be limitations on using a remote?
My stance on this is that what I track as my upstream to
maintain my repository is none of other people's business. I
have remote tracking branches because I use them to track
others; I do not necessarily have them with an intention to
publish them.
You could pull from my remote tracking branches using the fuller
refspec ("remotes/origin/master" in the example above) if you
really wanted to, and ls-remote lets you take a peek at them, so
the above "none of your business" is not in the sense of being
secretive, but is to reduce clutter and to avoid potential
confusion.
But this is an ancient design choice, and I am open to
suggestions loosening it, as long as we are aware of
implications.
One thing that comes to mind if we allow it is if a clone should
have refs/remotes/origin/remotes/origin/* that keeps track of
the remote that is being tracked by your origin.
I think it is insane to do so, but if somebody says "git pull
somewhere-else origin/master", we would not know if he meant
remotes/origin/master or remotes/origin/remotes/origin/master.
And the reason it is "insane" is the same as why we currently do
not interpret "git pull $repo origin/master" as a request to
pull from remotes/origin/master. It really is none of your
business what kind of remote branches the other end is
interacting with.
next prev parent reply other threads:[~2007-05-25 3:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-25 1:12 Pulling from refs/remotes/ ? Han-Wen Nienhuys
2007-05-25 1:19 ` Junio C Hamano
2007-05-25 1:35 ` Han-Wen Nienhuys
2007-05-25 1:53 ` Junio C Hamano
2007-05-25 2:24 ` Han-Wen Nienhuys
2007-05-25 3:06 ` Junio C Hamano [this message]
2007-05-26 19:47 ` Han-Wen Nienhuys
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=7vwsyxsit8.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=hanwen@xs4all.nl \
/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.