* 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
* Re: git-push and $GIT_DIR/branches
[not found] ` <7vljvvh61y.fsf@gitster.siamese.dyndns.org>
@ 2008-11-07 20:44 ` Martin Koegler
2008-11-07 22:27 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Martin Koegler @ 2008-11-07 20:44 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Fri, Nov 07, 2008 at 08:08:57AM -0800, Junio C Hamano wrote:
> mkoegler@auto.tuwien.ac.at (Martin Koegler) writes:
>
> > I think, that the git-push behaviour is a bit unlogical in conjunction
> > with $GIT_DIR/branches.
>
> That is because it is illogical to use $GIT_DIR/branches in conjunction
> with git; the former is a backward compatibility wart with Cogito which is
> now dead.
I'm aware, that $GIT_DIR/branches origins from Cogito and are not
recommended. But eg. Documentation/urls-remotes.txt does not reflect
this.
I asume, that you [and probably many other] are not very interrested
in this feature. But would you accept a patch changing the push
refspec to HEAD:refs/heads/<head>?
mfg Martin Kögler
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: git-push and $GIT_DIR/branches
2008-11-07 20:44 ` Martin Koegler
@ 2008-11-07 22:27 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2008-11-07 22:27 UTC (permalink / raw)
To: Martin Koegler; +Cc: git
mkoegler@auto.tuwien.ac.at (Martin Koegler) writes:
> I asume, that you [and probably many other] are not very interrested
> in this feature. But would you accept a patch changing the push
> refspec to HEAD:refs/heads/<head>?
I believe "git-push foo" with .git/branches/foo has worked the way it does
now from day one, so the above change you suggest breaks peoples'
expectations and documented behaviour, _if_ people are using "branches"
with git-push. It definitely is a no-go to just change the behaviour
without warning and deprecation period, but with a careful transition
plan, I personally do not think there is a fundamental reason not to
improve it (others may disagree).
I do not know what Cogito did when you told it to push with such a
configuration, though. Its "branches" had quite different semantics from
the concept of "remote" in git.
^ 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