Re: [PATCH v2 6/9] branch: display publish branch

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

 



Junio C Hamano wrote:
> Jeff King <peff@xxxxxxxx> writes:
> 
> > For instance, it looks like your @{publish} requires config like:
> >
> >   [branch "master"]
> >   pushremote = foo
> >   push = refs/heads/bar
> >
> > to operate. Setting "pushremote" affects what "git push" does; it will
> > go to the "foo" remote.
> 
> OK, and the same thing would happen if branch.*.pushremote is not
> set for any branch, but remote.pushdefault is set to 'foo', right?
> 
> > But the branch.master.push setting does not do
> > anything to "git push".
> 
> I am not sure I understand this.  I thought that the desire behind
> the branch.*.push is to allow something like:
> 
> 	... other things in the config ...
> 	[remote]
>         	pushdefault = foo
> 	[remote "foo"]
> 		url = ...
>         	push = +refs/heads/*:refs/remotes/satellite/*
>                 fetch = +refs/heads/*:refs/remotes/foo/*
> 	[branch "master"]
> 		; pushremote = foo
>         	push = refs/heads/bar
> 
> so that "git push" on 'master' will override the more generic "all
> local branches here will go to their remote-tracking hierarchy for
> this satellite" refspec.  And in that sense branch.master.push would
> do something to "git push".

In my patches the above doesn't work; branch.master.push doesn't do anything if
.pushremote isn't there.

I'm always thinking from the common user's point of view, and the common user
doesn't know what branch.master.push is, but he knows he did
`git branch -p foo/bar master` (or something like that), and
`git branch -v` would corroborate that.

So you would have something like this:

	[remote "foo"]
		url = ...
		push = +refs/heads/*:refs/remotes/satellite/*
		fetch = +refs/heads/*:refs/remotes/foo/*
	[branch "master"]
		pushremote = foo
		push = refs/heads/bar

> I personally think that kind of override adds any more values than
> it causes confusion, so I think it is OK not to support such uses of
> branch.*.push at all.  A configuration without branch.master.push
> may cause "git push" on 'master' to update refs/heads/master at the
> remote,

How? If branch.master.push is not configured, then "git push" would push
'master' to refs/remotes/satellite/master on the remote.

-- 
Felipe Contreras
--
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]