Git development
 help / color / mirror / Atom feed
* git-push and $GIT_DIR/branches
@ 2008-11-07  8:26 Martin Koegler
       [not found] ` <7vljvvh61y.fsf@gitster.siamese.dyndns.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Koegler @ 2008-11-07  8:26 UTC (permalink / raw)
  To: git

I think, that the git-push behaviour is a bit unlogical in conjunction
with $GIT_DIR/branches.

If $GIT_DIR/branches/name1 contains "<repository>#name2":
- git-fetch name1
  will fetch refs/heads/name2 from <repository> and store it in refs/heads/name1
- git-push name1
  will push refs/heads/master to refs/heads/master in <repository>

I would expect, that git-push would somehow honour #name2. As far as I remember,
cg-push name1 would have pushed HEAD to refs/heads/name2 in <repository>.

In remote.c, function read_branches_file the following code
would implement a similar behaviour:
        strbuf_init(&push, 0);
        strbuf_addstr(&push, "HEAD");
        if (frag) {
                strbuf_addf(&push, ":refs/heads/%s", frag);
        } else
                strbuf_addstr(&push, ":refs/heads/master");
        add_push_refspec(remote, strbuf_detach(&push, 0));

Options about this?

mfg Martin Kögler

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-07 22:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07  8:26 git-push and $GIT_DIR/branches Martin Koegler
     [not found] ` <7vljvvh61y.fsf@gitster.siamese.dyndns.org>
2008-11-07 20:44   ` Martin Koegler
2008-11-07 22:27     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox