{"thread":{"id":"16206","subject":"git-push and $GIT_DIR/branches","startedAt":"2008-11-07T08:26:29Z","lastAt":"2008-11-07T22:27:07Z","messageCount":3,"participants":["Martin Koegler","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"95109","messageId":"20081107082629.GA27158@auto.tuwien.ac.at","threadId":"16206","inReplyTo":null,"subject":"git-push and $GIT_DIR/branches","fromName":"Martin Koegler","fromEmail":"mkoegler@auto.tuwien.ac.at","sentAt":"2008-11-07T08:26:29Z","receivedAt":"2008-11-07T08:26:29Z","isPatch":false,"sender":{"key":"mkoegler@auto.tuwien.ac.at","avatar":null},"body":"I think, that the git-push behaviour is a bit unlogical in conjunction\nwith $GIT_DIR/branches.\n\nIf $GIT_DIR/branches/name1 contains \"<repository>#name2\":\n- git-fetch name1\n  will fetch refs/heads/name2 from <repository> and store it in refs/heads/name1\n- git-push name1\n  will push refs/heads/master to refs/heads/master in <repository>\n\nI would expect, that git-push would somehow honour #name2. As far as I remember,\ncg-push name1 would have pushed HEAD to refs/heads/name2 in <repository>.\n\nIn remote.c, function read_branches_file the following code\nwould implement a similar behaviour:\n        strbuf_init(&push, 0);\n        strbuf_addstr(&push, \"HEAD\");\n        if (frag) {\n                strbuf_addf(&push, \":refs/heads/%s\", frag);\n        } else\n                strbuf_addstr(&push, \":refs/heads/master\");\n        add_push_refspec(remote, strbuf_detach(&push, 0));\n\nOptions about this?\n\nmfg Martin Kögler\n"},{"id":"95144","messageId":"20081107204451.GA10394@auto.tuwien.ac.at","threadId":"16206","inReplyTo":"7vljvvh61y.fsf@gitster.siamese.dyndns.org","subject":"Re: git-push and $GIT_DIR/branches","fromName":"Martin Koegler","fromEmail":"mkoegler@auto.tuwien.ac.at","sentAt":"2008-11-07T20:44:51Z","receivedAt":"2008-11-07T20:44:51Z","isPatch":false,"sender":{"key":"mkoegler@auto.tuwien.ac.at","avatar":null},"body":"On Fri, Nov 07, 2008 at 08:08:57AM -0800, Junio C Hamano wrote:\n> mkoegler@auto.tuwien.ac.at (Martin Koegler) writes:\n> \n> > I think, that the git-push behaviour is a bit unlogical in conjunction\n> > with $GIT_DIR/branches.\n> \n> That is because it is illogical to use $GIT_DIR/branches in conjunction\n> with git; the former is a backward compatibility wart with Cogito which is\n> now dead.\n\nI'm aware, that $GIT_DIR/branches origins from Cogito and are not\nrecommended. But eg. Documentation/urls-remotes.txt does not reflect\nthis.\n\nI asume, that you [and probably many other] are not very interrested\nin this feature. But would you accept a patch changing the push\nrefspec to HEAD:refs/heads/<head>?\n\nmfg Martin Kögler\n"},{"id":"95165","messageId":"7vfxm3f9z8.fsf@gitster.siamese.dyndns.org","threadId":"16206","inReplyTo":"20081107204451.GA10394@auto.tuwien.ac.at","subject":"Re: git-push and $GIT_DIR/branches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-07T22:27:07Z","receivedAt":"2008-11-07T22:27:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"mkoegler@auto.tuwien.ac.at (Martin Koegler) writes:\n\n> I asume, that you [and probably many other] are not very interrested\n> in this feature. But would you accept a patch changing the push\n> refspec to HEAD:refs/heads/<head>?\n\nI believe \"git-push foo\" with .git/branches/foo has worked the way it does\nnow from day one, so the above change you suggest breaks peoples'\nexpectations and documented behaviour, _if_ people are using \"branches\"\nwith git-push.  It definitely is a no-go to just change the behaviour\nwithout warning and deprecation period, but with a careful transition\nplan, I personally do not think there is a fundamental reason not to\nimprove it (others may disagree).\n\nI do not know what Cogito did when you told it to push with such a\nconfiguration, though.  Its \"branches\" had quite different semantics from\nthe concept of \"remote\" in git.\n"}]}