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

2013-07-26 Thread Jeff King
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 b

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

2013-07-26 Thread Jeff King
On Sat, Jul 27, 2013 at 12:29:47AM +0200, Carlos Martín Nieto wrote: > > Is it nonsensical? It does not make sense for the @{upstream} magic > > token, because we will not have a branch in tracking branch refs/remotes > > This was the main point, yes; the only time I've seen it used is by > mista

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

2013-07-26 Thread Carlos Martín Nieto
On Fri, 2013-07-26 at 14:43 -0400, Jeff King wrote: > On Fri, Jul 26, 2013 at 07:39:37PM +0200, Carlos Martín Nieto wrote: > > > A command of e.g. > > > > git push --set-upstream /tmp/t master > > > > will call install_branch_config() with a remote name of "/tmp/t". This > > function will se

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

2013-07-26 Thread Jeff King
On Fri, Jul 26, 2013 at 02:43:11PM -0400, Jeff King wrote: > On Fri, Jul 26, 2013 at 07:39:37PM +0200, Carlos Martín Nieto wrote: > > > A command of e.g. > > > > git push --set-upstream /tmp/t master > > > > will call install_branch_config() with a remote name of "/tmp/t". This > > function

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

2013-07-26 Thread Jeff King
On Fri, Jul 26, 2013 at 07:39:37PM +0200, Carlos Martín Nieto wrote: > A command of e.g. > > git push --set-upstream /tmp/t master > > will call install_branch_config() with a remote name of "/tmp/t". This > function will set the 'branch.master.remote' key to, which is > nonsensical as there

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

2013-07-26 Thread Carlos Martín Nieto
A command of e.g. git push --set-upstream /tmp/t master will call install_branch_config() with a remote name of "/tmp/t". This function will set the 'branch.master.remote' key to, which is nonsensical as there is no remote by that name. Instead, make sure that the remote given does exist whe