Re: [PATCH] branch: make sure the upstream remote is configured

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 26, 2013 at 07:12:11PM -0400, Jeff King wrote:

> If that is what you want to prevent, I do not think checking for a named
> remote is sufficient. You can also be pushing to a branch on a named
> remote that is not part of your fetch refspec, in which case you do not
> have a tracking branch. I.e.:
> 
>   git clone $URL repo.git
>   cd repo.git
>   git push --set-upstream HEAD:refs/foo/whatever
> 
> For that matter, I wonder what "--set-upstream" would do if used with
> "refs/tags/foo". You would not do that in general, but what about:
> 
>   git push --set-upstream master:master master:v1.0
> 
> I didn't test.

Ah, nevermind. We already catch the case of non-heads (on both the local
and remote sides) and abort.

So that makes me more confident that your change is a reasonable one; we
are already disallowing a subset of what's possible via "--set-upstream"
in the name of preventing weird accidental configurations. This is just
fixing another such loophole.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]