{"thread":{"id":"36984","subject":"Triangular workflow with Central repo","startedAt":"2014-06-23T23:37:22Z","lastAt":"2014-06-25T17:32:31Z","messageCount":2,"participants":["Mark Ferrell","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"244905","messageId":"CANR0-ag4ZKmHBNPxYkohBJEpXierFV+K3Ub4tH8YYD7FK73FdA@mail.gmail.com","threadId":"36984","inReplyTo":null,"subject":"Triangular workflow with Central repo","fromName":"Mark Ferrell","fromEmail":"major@homeonderanged.org","sentAt":"2014-06-23T23:37:22Z","receivedAt":"2014-06-23T23:37:22Z","isPatch":false,"sender":{"key":"major@homeonderanged.org","avatar":null},"body":"I was trying to setup a git client to deal with our version of a\ntriangular workflow and found that there where no configuration\ndirectives which supported our use case.\n\nDevelopers create and commit to branches named dev/<user>/TOPIC\n(Branch permissions are handled by Gitolite).  If the topic is\nprefixed with 'pqm/' then the revisions are treated as \"proposals\" for\nchanging the head of a higher-level branch.  E.g. pushing to\ndev/bob/pqm/master results in the PQM software checking out that\nrevision and running tests upon the source.  If all tests pass then\nthe 'master' branch is updated to point at the submitted revision. The\nbenefit for us using this approach is that it gives developers a\nprivate sandbox in which they can push/pull code between one another\nw/out needing a separate repository per-developer (or setting up a\nrepo on everyones workstation), and if they choose to submit code\nchanges to be a new baseline they simply create a PQM branch and\nsubmit to it.\n\nI found that it is possible to setup git to easily deal with this\nwork-flow (triangular) if the pull repository is different than the\npush repository, but our use case relies on the pull branch being\ndifferent than the push branch.  It would seem that git would need a\nbranch.<name>.push directive for this to work out.\n"},{"id":"244973","messageId":"xmqqionoao9c.fsf@gitster.dls.corp.google.com","threadId":"36984","inReplyTo":"CANR0-ag4ZKmHBNPxYkohBJEpXierFV+K3Ub4tH8YYD7FK73FdA@mail.gmail.com","subject":"Re: Triangular workflow with Central repo","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-25T17:32:31Z","receivedAt":"2014-06-25T17:32:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Ferrell <major@homeonderanged.org> writes:\n\n> push repository, but our use case relies on the pull branch being\n> different than the push branch.  It would seem that git would need a\n> branch.<name>.push directive for this to work out.\n\nI thought that you can tell recent versions of Git to pay attention\nto the remote.*.push patterns and use them as a refmap even when you\nare pushing a single branch?\n\nHere is a demonstration:\n\n $ (git init src && cd src && git commit --allow-empty -m foo)\n $ git clone src dst\n $ cd dst\n $ edit .git/config ; cat .git/config\n [core]\n         repositoryformatversion = 0\n         filemode = true\n         bare = false\n         logallrefupdates = true\n [remote \"origin\"]\n         url = ../src\n         fetch = +refs/heads/*:refs/remotes/origin/*\n         push = refs/heads/*:refs/heads/dev/me/*\n # note that I edited out [branch \"master\"] section to show that\n # you do not even need per-branch configuration.\n $ git commit --allow-empty -m bar\n $ git push\n Counting objects: 1, done.\n Writing objects: 100% (1/1), 184 bytes | 0 bytes/s, done.\n Total 1 (delta 0), reused 0 (delta 0)\n To ../src\n  * [new branch]      master -> dev/me/master\n\nFor simplicity I used two local repositories and used a random\npattern \"refs/heads/dev/me/*\", trusting that the readers are capable\nof updating the example to use remote URLs and different hierarchies\nas needed.\n"}]}