Subject: Re: git push (mis ?)behavior

From: Jan Hudec <[email-masked]>
Date: Tue, 9 Oct 2007 07:05:33 +0200

On Fri, Sep 28, 2007 at 00:07:27 -0700, Junio C Hamano wrote:
> Steffen Prohaska <[email-masked]> writes:
> 
> > When "remote.<name>.push" is set I'd expect "git push" to
> > choose only the 'right' remote.<name>.push lines, that is
> > the lines that have the current branch as the local ref.

I would like this for another reason and maybe in slightly different way.
Basically I would have configured something along the lines:
    [remote "origin"]
    push = refs/heads/*:refs/heads/jahu/*
and would want to choose, via option, whether I want to push all the branches
or just the current one, but in any case with the renaming specified.

The idea behind this is to have a shared repository, but not shared branches.
Everybody would have a subdirectory in refs/heads where he could push
anything that the others should see and than somebody else (either designated
integrator, or just anybody different) would do a quick review and merge it
into master.

Now I could of course push out everything, but usually I'd want to push
exactly the current branch, renaming it by the rule given, whether it already
existed in origin or not. Than there can be eg. a post-receive hook notifying
the integrator that there is something for review.

> That would break the existing setup so it would not fly as a
> default, although it could be added as an option.

We can have an option and/or we can have some new parameter in .git/config.
Maybe:
    push = refs/heads/*:refs/heads/jahu/*
would mean to push always (ie. everything under refs/heads) and eg.:
    push = !refs/heads/*:refs/heads/jahu/*
would mean to push just current branch if it matches. Mixed setups would be
possible:
    push = refs/heads/*:refs/heads/jahu/* !master:master !next:next
would mean push everything to jahu/ and if current is master, push it to
master, or if current is next, push it to next.

-- 
						 Jan 'Bulb' Hudec <[email-masked]>