Ævar Arnfjörð Bjarmason <ava...@gmail.com> writes:

> I was going to submit an update to this, as an additional improvement
> can anyone think of a reason not to always infer that we'd like a new
> branch if the LHS of the refspec starts with refs/remotes/* ?

Depends on what purpose the remote you are pushing into serves.  My
instinct tells me that it may be more likely to be emulating the
case where the remote, which is hosted on a box on which for some
reason it is cumbersome for you to get an interactive shell prompt,
did the same fetch as your local repository and stored the same
value in its remote-tracking branch than creating a local branch.  I
do not say it is entirely unlikely that the push wants to create a
local branch there, though.  It can be a way to "reprint" what
somebody else published as their local branch, which you copied to
your remote-tracking branches, to the destination of your push.  I
just felt that it is less likely.

To put it another way, I would think both of these two have at most
the same probability that the push wants to go to a local branch:

        git push refs/remotes/foo:foo
        git push <any random sha1 expression>:foo

and I would further say that the former is less likely than the
latter that it wants to create a local branch, because it is more
plausible that it wants to create a similar remote-tracking branch
there.

Reply via email to