{"thread":{"id":"32108","subject":"push branch descriptions","startedAt":"2012-11-14T07:20:27Z","lastAt":"2012-11-14T17:58:27Z","messageCount":7,"participants":["Angelo Borsotti","Ramkumar Ramachandra","Michael J Gruber","Junio C Hamano","Pyeron, Jason J CTR (US)"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"203172","messageId":"CAB9Jk9ABenaj=R0a6OW2GCsin8PdDCW3ZbuQbu6G0jnGG3s+sA@mail.gmail.com","threadId":"32108","inReplyTo":null,"subject":"push branch descriptions","fromName":"Angelo Borsotti","fromEmail":"angelo.borsotti@gmail.com","sentAt":"2012-11-14T07:20:27Z","receivedAt":"2012-11-14T07:20:27Z","isPatch":false,"sender":{"key":"angelo.borsotti@gmail.com","avatar":null},"body":"Hi\n\ncurrently, there is no means to push a branch description to a remote\nrepository. It is possible to create a branch, but not to set its\ndescription.\nWould not be more correct to push also branch descriptions when\nbranches are pushed?\n\n-Angelo Borsotti\n"},{"id":"203180","messageId":"CALkWK0meYVEe8OezEU2Oe-dQSZuo0ETwxXq3qWXzopH7x3msJA@mail.gmail.com","threadId":"32108","inReplyTo":"CAB9Jk9ABenaj=R0a6OW2GCsin8PdDCW3ZbuQbu6G0jnGG3s+sA@mail.gmail.com","subject":"Re: push branch descriptions","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-11-14T10:33:54Z","receivedAt":"2012-11-14T10:33:54Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\nAngelo Borsotti wrote:\n> currently, there is no means to push a branch description to a remote\n> repository. It is possible to create a branch, but not to set its\n> description.\n> Would not be more correct to push also branch descriptions when\n> branches are pushed?\n\nBranch descriptions are currently stored in .git/config (see\nbranch.<branchname>.description), and are hence intended to be local.\nBut yes, it would be nice to have it synced with the remote- I have no\nclue how to make that possible though.\n\nRam\n"},{"id":"203190","messageId":"50A3A217.3000902@drmicha.warpmail.net","threadId":"32108","inReplyTo":"CALkWK0meYVEe8OezEU2Oe-dQSZuo0ETwxXq3qWXzopH7x3msJA@mail.gmail.com","subject":"Re: push branch descriptions","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2012-11-14T13:52:23Z","receivedAt":"2012-11-14T13:52:23Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Ramkumar Ramachandra venit, vidit, dixit 14.11.2012 11:33:\n> Hi,\n> \n> Angelo Borsotti wrote:\n>> currently, there is no means to push a branch description to a remote\n>> repository. It is possible to create a branch, but not to set its\n>> description.\n>> Would not be more correct to push also branch descriptions when\n>> branches are pushed?\n> \n> Branch descriptions are currently stored in .git/config (see\n> branch.<branchname>.description), and are hence intended to be local.\n> But yes, it would be nice to have it synced with the remote- I have no\n> clue how to make that possible though.\n\nI find that nice, too, but back then I seemed to be the only one, \"then\"\nbeing the time when I proposed (and implemented) branch notes as notes\n(git notes) being attached to the (sha1 of the) branch name (or any\nother refname). They are versioned/shareable/syncable just like notes\nare. I had all of this working (git branch --notes display, git\nformat-patch --cover-letter and such); what was missing was a way to\nattach/look-up notes for remote branches, which is related to our\ncurrent lack of default handling of remote notes refs. That's not a\nfundamental problem, just a matter of agreeing about a proper default\nsetup for remote notes refs.\n\nAs I said, others preferred local branch descriptions (no git notes) in\nconfig, and that's what is in git.git now.\n\nMichael\n"},{"id":"203191","messageId":"7vr4nwb832.fsf@alter.siamese.dyndns.org","threadId":"32108","inReplyTo":"CAB9Jk9ABenaj=R0a6OW2GCsin8PdDCW3ZbuQbu6G0jnGG3s+sA@mail.gmail.com","subject":"Re: push branch descriptions","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-14T13:57:37Z","receivedAt":"2012-11-14T13:57:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Angelo Borsotti <angelo.borsotti@gmail.com> writes:\n\n> currently, there is no means to push a branch description to a remote\n> repository. It is possible to create a branch, but not to set its\n> description.\n\nCorrect.  You have to go to the remote repository and run \"git\nbranch --edit-description\" there; there is currently no way to do\nthis remotely, which may be an issue, but...\n\n> Would not be more correct to push also branch descriptions when\n> branches are pushed?\n\n... I do not think \"git push\" is the best place to do so, given the\ninherently local nature of branches and branch descriptions.\n\nImagine the project creates a branch \"magic\" to enhance its system\nwith magic words.  The description for the \"magic\" branch in the\nproject may say \"support magic words\" or something.\n\nYou and your friend are tasked to add a handful of magic words,\ne.g. \"xyzzy\", \"frotz\" and \"nitfol\".  You may start your work like so\non your \"magic-xyzzy\" branch:\n\n    $ git clone git://example.com/zork.git/\n    $ git checkout -b magic-xyzzy -t origin/magic\n\nAnd you say something like \"add xyzzy magic\" in its branch\ndescription.\n\n    $ git branch --edit-description magic-xyzzy\n\nAfter finishing your work, you may push it\n\n    $ git push origin magic-xyzzy:magic\n\nShould the description of the subtask \"add xyzzy magic\" overwrite\nthe purpose of the project wide \"magic\" branch \"support magic words\"?\nMost likely not.\n\nThe local nature of the description becomes even more clear if you\nimagine the case where the push at the last stage gets rejected due\nto non-fast-forward error (in other words, your friend has already\npushed her support of the \"frotz\" magic to the \"magic\" branch.\n\nIn fact, you would normally not directly push your magic-xyzzy\nbranch to the magic branch, but you would do something like this\nonce you are done:\n\n    $ git checkout -b magic -t origin/magic\n    $ git pull origin ;# to update with her work\n    $ git merge magic-xyzzy\n    $ git push origin magic\n\nAnd the last \"merge\" is where the description for your magic-xyzzy\nis used to fill the commit log template for you to explain your\nmerge (that is, you are merging a branch whose description is \"add\nxyzzy magic\").  There is no reason to propagate the description of\nyour magic-xyzzy topic to the description of shared magic branch\nwhen you push, as this merge commit already records what the branch\nthat was merged was about.\n\nSo you could modify \"git push\" to set the branch description when\nyou push to create a branch remotely, but in general, \"git push\"\nshould not be updating the branch description with the description\nof your local branch.  This comes as a consequence of the fact that\nthe purpose of the branch in the remote central repository is, more\noften than not, different from the purpose of the corresponding\nbranch in your repository.\n\nIt would conceptually be a lot cleaner to treat updating of remote\nbranch description as a separate \"repository management\" class of\noperation, similar to setting the repository description stored in\n$GIT_DIR/description.\n"},{"id":"203192","messageId":"CAB9Jk9BN6vTnpPa8rv1Yumn2Os=XU=tEn3=j2QJJK1GpajY=VQ@mail.gmail.com","threadId":"32108","inReplyTo":"7vr4nwb832.fsf@alter.siamese.dyndns.org","subject":"Re: push branch descriptions","fromName":"Angelo Borsotti","fromEmail":"angelo.borsotti@gmail.com","sentAt":"2012-11-14T14:51:01Z","receivedAt":"2012-11-14T14:51:01Z","isPatch":false,"sender":{"key":"angelo.borsotti@gmail.com","avatar":null},"body":"Hi Junio,\n\n> It would conceptually be a lot cleaner to treat updating of remote\n> Ibranch description as a separate \"repository management\" class of\n> Ioperation, similar to setting the repository description stored in\n> I$GIT_DIR/description.\n\nI agree, it should be a distinct operation. I was thinking that when\nyou have a remote bare repository, the normal way of adding contents\nto it is to push to it, and thus also adding a description should be\ndone with some sort of pushing. Creating branches is also normally\ndone with a push (think how difficult it is to create a branch in a\nbare repository when the HEAD is not set ...).\n\n-Angelo\n\nOn 14 November 2012 14:57, Junio C Hamano <gitster@pobox.com> wrote:\n> Angelo Borsotti <angelo.borsotti@gmail.com> writes:\n>\n>> currently, there is no means to push a branch description to a remote\n>> repository. It is possible to create a branch, but not to set its\n>> description.\n>\n> Correct.  You have to go to the remote repository and run \"git\n> branch --edit-description\" there; there is currently no way to do\n> this remotely, which may be an issue, but...\n>\n>> Would not be more correct to push also branch descriptions when\n>> branches are pushed?\n>\n> ... I do not think \"git push\" is the best place to do so, given the\n> inherently local nature of branches and branch descriptions.\n>\n> Imagine the project creates a branch \"magic\" to enhance its system\n> with magic words.  The description for the \"magic\" branch in the\n> project may say \"support magic words\" or something.\n>\n> You and your friend are tasked to add a handful of magic words,\n> e.g. \"xyzzy\", \"frotz\" and \"nitfol\".  You may start your work like so\n> on your \"magic-xyzzy\" branch:\n>\n>     $ git clone git://example.com/zork.git/\n>     $ git checkout -b magic-xyzzy -t origin/magic\n>\n> And you say something like \"add xyzzy magic\" in its branch\n> description.\n>\n>     $ git branch --edit-description magic-xyzzy\n>\n> After finishing your work, you may push it\n>\n>     $ git push origin magic-xyzzy:magic\n>\n> Should the description of the subtask \"add xyzzy magic\" overwrite\n> the purpose of the project wide \"magic\" branch \"support magic words\"?\n> Most likely not.\n>\n> The local nature of the description becomes even more clear if you\n> imagine the case where the push at the last stage gets rejected due\n> to non-fast-forward error (in other words, your friend has already\n> pushed her support of the \"frotz\" magic to the \"magic\" branch.\n>\n> In fact, you would normally not directly push your magic-xyzzy\n> branch to the magic branch, but you would do something like this\n> once you are done:\n>\n>     $ git checkout -b magic -t origin/magic\n>     $ git pull origin ;# to update with her work\n>     $ git merge magic-xyzzy\n>     $ git push origin magic\n>\n> And the last \"merge\" is where the description for your magic-xyzzy\n> is used to fill the commit log template for you to explain your\n> merge (that is, you are merging a branch whose description is \"add\n> xyzzy magic\").  There is no reason to propagate the description of\n> your magic-xyzzy topic to the description of shared magic branch\n> when you push, as this merge commit already records what the branch\n> that was merged was about.\n>\n> So you could modify \"git push\" to set the branch description when\n> you push to create a branch remotely, but in general, \"git push\"\n> should not be updating the branch description with the description\n> of your local branch.  This comes as a consequence of the fact that\n> the purpose of the branch in the remote central repository is, more\n> often than not, different from the purpose of the corresponding\n> branch in your repository.\n>\n> It would conceptually be a lot cleaner to treat updating of remote\n> branch description as a separate \"repository management\" class of\n> operation, similar to setting the repository description stored in\n> $GIT_DIR/description.\n"},{"id":"203201","messageId":"871B6C10EBEFE342A772D1159D13208537AABCCA@umechphj.easf.csd.disa.mil","threadId":"32108","inReplyTo":"CAB9Jk9BN6vTnpPa8rv1Yumn2Os=XU=tEn3=j2QJJK1GpajY=VQ@mail.gmail.com","subject":"RE: push branch descriptions","fromName":"Pyeron, Jason J CTR (US)","fromEmail":"jason.j.pyeron.ctr@mail.mil","sentAt":"2012-11-14T17:21:03Z","receivedAt":"2012-11-14T17:21:03Z","isPatch":false,"sender":{"key":"jason.j.pyeron.ctr@mail.mil","avatar":null},"body":"> -----Original Message-----\n> From: Angelo Borsotti\n> Sent: Wednesday, November 14, 2012 9:51 AM\n> \n> Hi Junio,\n> \n> > It would conceptually be a lot cleaner to treat updating of remote\n> > Ibranch description as a separate \"repository management\" class of\n> > Ioperation, similar to setting the repository description stored in\n> > I$GIT_DIR/description.\n> \n> I agree, it should be a distinct operation. I was thinking that when\n> you have a remote bare repository, the normal way of adding contents\n> to it is to push to it, and thus also adding a description should be\n> done with some sort of pushing. Creating branches is also normally\n> done with a push (think how difficult it is to create a branch in a\n> bare repository when the HEAD is not set ...).\n\nOnly if the push were to create the branch...\n\n\n> On 14 November 2012 14:57, Junio C Hamano <gitster@pobox.com> wrote:\n> > Angelo Borsotti <angelo.borsotti@gmail.com> writes:\n> >\n> >> currently, there is no means to push a branch description to a\n> remote\n> >> repository. It is possible to create a branch, but not to set its\n> >> description.\n> >\n> > Correct.  You have to go to the remote repository and run \"git\n> > branch --edit-description\" there; there is currently no way to do\n> > this remotely, which may be an issue, but...\n> >\n> >> Would not be more correct to push also branch descriptions when\n> >> branches are pushed?\n> >\n> > ... I do not think \"git push\" is the best place to do so, given the\n> > inherently local nature of branches and branch descriptions.\n> >\n> > Imagine the project creates a branch \"magic\" to enhance its system\n> > with magic words.  The description for the \"magic\" branch in the\n> > project may say \"support magic words\" or something.\n> >\n> > You and your friend are tasked to add a handful of magic words,\n> > e.g. \"xyzzy\", \"frotz\" and \"nitfol\".  You may start your work like so\n> > on your \"magic-xyzzy\" branch:\n> >\n> >     $ git clone git://example.com/zork.git/\n> >     $ git checkout -b magic-xyzzy -t origin/magic\n\nAnd here the branch description should copy from origin/magic.\n\n> >\n> > And you say something like \"add xyzzy magic\" in its branch\n> > description.\n> >\n> >     $ git branch --edit-description magic-xyzzy\n> >\n\nAnd now it is edited\n\n> > After finishing your work, you may push it\n> >\n> >     $ git push origin magic-xyzzy:magic\n> >\n> > Should the description of the subtask \"add xyzzy magic\" overwrite\n> > the purpose of the project wide \"magic\" branch \"support magic words\"?\n> > Most likely not.\n\nNever overwrite anything.\n\n> >\n> > The local nature of the description becomes even more clear if you\n> > imagine the case where the push at the last stage gets rejected due\n> > to non-fast-forward error (in other words, your friend has already\n> > pushed her support of the \"frotz\" magic to the \"magic\" branch.\n> >\n> > In fact, you would normally not directly push your magic-xyzzy\n> > branch to the magic branch, but you would do something like this\n> > once you are done:\n> >\n> >     $ git checkout -b magic -t origin/magic\n> >     $ git pull origin ;# to update with her work\n> >     $ git merge magic-xyzzy\n> >     $ git push origin magic\n> >\n> > And the last \"merge\" is where the description for your magic-xyzzy\n> > is used to fill the commit log template for you to explain your\n> > merge (that is, you are merging a branch whose description is \"add\n> > xyzzy magic\").  There is no reason to propagate the description of\n> > your magic-xyzzy topic to the description of shared magic branch\n> > when you push, as this merge commit already records what the branch\n> > that was merged was about.\n> >\n> > So you could modify \"git push\" to set the branch description when\n> > you push to create a branch remotely, but in general, \"git push\"\n> > should not be updating the branch description with the description\n> > of your local branch.  This comes as a consequence of the fact that\n> > the purpose of the branch in the remote central repository is, more\n> > often than not, different from the purpose of the corresponding\n> > branch in your repository.\n> >\n\nBut pulling such into a new branch should copy the description (unless explicitly set)\n\n> > It would conceptually be a lot cleaner to treat updating of remote\n> > branch description as a separate \"repository management\" class of\n> > operation, similar to setting the repository description stored in\n> > $GIT_DIR/description.\n\n"},{"id":"203204","messageId":"7vbof0awxo.fsf@alter.siamese.dyndns.org","threadId":"32108","inReplyTo":"871B6C10EBEFE342A772D1159D13208537AABCCA@umechphj.easf.csd.disa.mil","subject":"Re: push branch descriptions","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-14T17:58:27Z","receivedAt":"2012-11-14T17:58:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Pyeron, Jason J CTR (US)\" <jason.j.pyeron.ctr@mail.mil> writes:\n\n>> > Imagine the project creates a branch \"magic\" to enhance its system\n>> > with magic words.  The description for the \"magic\" branch in the\n>> > project may say \"support magic words\" or something.\n>> >\n>> > You and your friend are tasked to add a handful of magic words,\n>> > e.g. \"xyzzy\", \"frotz\" and \"nitfol\".  You may start your work like so\n>> > on your \"magic-xyzzy\" branch:\n>> >\n>> >     $ git clone git://example.com/zork.git/\n>> >     $ git checkout -b magic-xyzzy -t origin/magic\n>\n> And here the branch description should copy from origin/magic.\n\nI doubt it should.  The purpose of the \"magic\" branch at the remote\nin my example were to \"support magic words\" (without limiting which\nmagic words the project wants to support) and that is what the\ndescription over there may say, while the purpose of the local\n\"magic-xyzzy\" branch you create in order to add the support for\n\"xyzzy\" magic is just one small subtask of it.\n\nThat is what I meant by \"the inherently local nature of the branches\nand branch descriptions\".  Git as a distributed system works well\nexactly because what each repository has is inherently local, and\npeople can do whatever they want in their own repositories, while\nallowing collaboration among participants by pulling and pushing\nhistories that share compatible (note: not necessarily \"identical\")\ngoals.  \"support magic words\" being a superset of \"add xyzzy magic\"\nis an example of this principle.  They have different goals (and\nthat is why propagating the description of your \"magic-xyzzy\" to the\nproject global \"magic\" is a wrong thing to do), but from the point\nof view of the project global \"magic\" branch, what your \"magic-xyzzy\"\nbranch wanted to do is compatible with its larger goal (and that is\nwhy merging to \"magic\" from \"magic-xyzzy\" is a good thing, while\nmerging the other way is frowned upon in general).\n"}]}