{"thread":{"id":"38190","subject":"Improving git branch","startedAt":"2014-12-17T11:10:10Z","lastAt":"2014-12-21T16:36:00Z","messageCount":9,"participants":["John Tapsell","Michael J Gruber","Junio C Hamano","Jeff King","Moritz Neeb"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"253761","messageId":"CAHQ6N+qBUcBcG8RC6Co+k_GmJDXCynmyfZmvTjz4bQyH1wG3DA@mail.gmail.com","threadId":"38190","inReplyTo":null,"subject":"Improving git branch","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2014-12-17T11:10:10Z","receivedAt":"2014-12-17T11:10:10Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"Hi all,\n\n  I'm interested in putting in some time and effort into improving the\noutput of \"git branch\".\n\n  What I'm thinking is an output like this:\n\n$ git branch\n\n2014-12-17 * (detached from origin/master)     deaba04 Do stuff\n2014-12-15   john.ta/add_timing_info                6edbcfa  Add timing stuff\n2014-12-14   master                                          8537316\n[origin/master: ahead 1, behind 16] Some stuff\n2014-12-12   john.ta/new_reduce_memory       99d84db Reintroduce: memory stuff\n2014-12-05   john.ta/bugfixes                            e15c95e Add stuff\n2014-12-03   john.ta/container                           e9fd4e5 This\nbranch is a test bed for containers\n\n\n(These columns are supposed to be all aligned nicely..)\n\nSo, features:\n\n1. Show the date of the last commit\n2. Sort by date.  Most recently used branches at the top\n3. Show the branch name, including your current \"branch\", with a * to\nindicate that it's checked out.\n4. Show the sha\n5. Show the branch DESCRIPTION - and if that's not available, show the\nshort-line of the most recent commit.\n\nThere is also a small amount of color here that I can't paste here, to\nfollow the coloring in the current git branch.\n\nBefore I start making patches etc, what do people think?  Would I have\na chance of getting this in?  Should I change some aspects etc?\n\nThanks,\n\nJohn Tapsell\n"},{"id":"253762","messageId":"549168DD.1080906@drmicha.warpmail.net","threadId":"38190","inReplyTo":"CAHQ6N+qBUcBcG8RC6Co+k_GmJDXCynmyfZmvTjz4bQyH1wG3DA@mail.gmail.com","subject":"Re: Improving git branch","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-12-17T11:28:29Z","receivedAt":"2014-12-17T11:28:29Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"John Tapsell schrieb am 17.12.2014 um 12:10:\n> Hi all,\n> \n>   I'm interested in putting in some time and effort into improving the\n> output of \"git branch\".\n> \n>   What I'm thinking is an output like this:\n> \n> $ git branch\n> \n> 2014-12-17 * (detached from origin/master)     deaba04 Do stuff\n> 2014-12-15   john.ta/add_timing_info                6edbcfa  Add timing stuff\n> 2014-12-14   master                                          8537316\n> [origin/master: ahead 1, behind 16] Some stuff\n> 2014-12-12   john.ta/new_reduce_memory       99d84db Reintroduce: memory stuff\n> 2014-12-05   john.ta/bugfixes                            e15c95e Add stuff\n> 2014-12-03   john.ta/container                           e9fd4e5 This\n> branch is a test bed for containers\n> \n> \n> (These columns are supposed to be all aligned nicely..)\n> \n> So, features:\n> \n> 1. Show the date of the last commit\n> 2. Sort by date.  Most recently used branches at the top\n> 3. Show the branch name, including your current \"branch\", with a * to\n> indicate that it's checked out.\n> 4. Show the sha\n> 5. Show the branch DESCRIPTION - and if that's not available, show the\n> short-line of the most recent commit.\n> \n> There is also a small amount of color here that I can't paste here, to\n> follow the coloring in the current git branch.\n> \n> Before I start making patches etc, what do people think?  Would I have\n> a chance of getting this in?  Should I change some aspects etc?\n> \n> Thanks,\n> \n> John Tapsell\n> \n\nI support the general goal, we have quite some way to go there.\n\nAs to the method: \"git branch\" in list mode, \"git tag\" in list mode and\n\"git for-each-ref\" all do similar things and are in turn not dissimilar\nfrom \"git log --no-walk\" with appropriate formatting and rev options.\n\nRather than extending \"git branch\" any further[*], I suggest a bolder\nstrategy:\n\n- unify/merge for-each-ref and pretty formats (and code) as far as possible\n- leverage that for the list modes of branch and tag\n\nThat would allow everyone to get their favourite listing, just like for\nlogs. Otherwise it would be very difficult to agree on *the* proper\nformat for an extended branch or tag list.\n\nMichael\n\n\n[*] I know I'm a sinner, too.\n"},{"id":"253763","messageId":"CAHQ6N+pjT9zCdbvjJnFTmJEM=btjDxn8LTRV-j1vbqGfqwks5A@mail.gmail.com","threadId":"38190","inReplyTo":"549168DD.1080906@drmicha.warpmail.net","subject":"Re: Improving git branch","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2014-12-17T11:51:32Z","receivedAt":"2014-12-17T11:51:32Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"I don't fully understand - if I did that, then what difference would\nan average user actually see?\n\nOn 17 December 2014 at 11:28, Michael J Gruber <git@drmicha.warpmail.net> wrote:\n> John Tapsell schrieb am 17.12.2014 um 12:10:\n>> Hi all,\n>>\n>>   I'm interested in putting in some time and effort into improving the\n>> output of \"git branch\".\n>>\n>>   What I'm thinking is an output like this:\n>>\n>> $ git branch\n>>\n>> 2014-12-17 * (detached from origin/master)     deaba04 Do stuff\n>> 2014-12-15   john.ta/add_timing_info                6edbcfa  Add timing stuff\n>> 2014-12-14   master                                          8537316\n>> [origin/master: ahead 1, behind 16] Some stuff\n>> 2014-12-12   john.ta/new_reduce_memory       99d84db Reintroduce: memory stuff\n>> 2014-12-05   john.ta/bugfixes                            e15c95e Add stuff\n>> 2014-12-03   john.ta/container                           e9fd4e5 This\n>> branch is a test bed for containers\n>>\n>>\n>> (These columns are supposed to be all aligned nicely..)\n>>\n>> So, features:\n>>\n>> 1. Show the date of the last commit\n>> 2. Sort by date.  Most recently used branches at the top\n>> 3. Show the branch name, including your current \"branch\", with a * to\n>> indicate that it's checked out.\n>> 4. Show the sha\n>> 5. Show the branch DESCRIPTION - and if that's not available, show the\n>> short-line of the most recent commit.\n>>\n>> There is also a small amount of color here that I can't paste here, to\n>> follow the coloring in the current git branch.\n>>\n>> Before I start making patches etc, what do people think?  Would I have\n>> a chance of getting this in?  Should I change some aspects etc?\n>>\n>> Thanks,\n>>\n>> John Tapsell\n>>\n>\n> I support the general goal, we have quite some way to go there.\n>\n> As to the method: \"git branch\" in list mode, \"git tag\" in list mode and\n> \"git for-each-ref\" all do similar things and are in turn not dissimilar\n> from \"git log --no-walk\" with appropriate formatting and rev options.\n>\n> Rather than extending \"git branch\" any further[*], I suggest a bolder\n> strategy:\n>\n> - unify/merge for-each-ref and pretty formats (and code) as far as possible\n> - leverage that for the list modes of branch and tag\n>\n> That would allow everyone to get their favourite listing, just like for\n> logs. Otherwise it would be very difficult to agree on *the* proper\n> format for an extended branch or tag list.\n>\n> Michael\n>\n>\n> [*] I know I'm a sinner, too.\n"},{"id":"253764","messageId":"549175AF.7070803@drmicha.warpmail.net","threadId":"38190","inReplyTo":"CAHQ6N+pjT9zCdbvjJnFTmJEM=btjDxn8LTRV-j1vbqGfqwks5A@mail.gmail.com","subject":"Re: Improving git branch","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-12-17T12:23:11Z","receivedAt":"2014-12-17T12:23:11Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Also, please don't top-post here.\n\nThat would allow everyone to get their favourite listing, just like for\nlogs.\n\nJohn Tapsell schrieb am 17.12.2014 um 12:51:\n> I don't fully understand - if I did that, then what difference would\n> an average user actually see?\n> \n> On 17 December 2014 at 11:28, Michael J Gruber <git@drmicha.warpmail.net> wrote:\n>> John Tapsell schrieb am 17.12.2014 um 12:10:\n>>> Hi all,\n>>>\n>>>   I'm interested in putting in some time and effort into improving the\n>>> output of \"git branch\".\n>>>\n>>>   What I'm thinking is an output like this:\n>>>\n>>> $ git branch\n>>>\n>>> 2014-12-17 * (detached from origin/master)     deaba04 Do stuff\n>>> 2014-12-15   john.ta/add_timing_info                6edbcfa  Add timing stuff\n>>> 2014-12-14   master                                          8537316\n>>> [origin/master: ahead 1, behind 16] Some stuff\n>>> 2014-12-12   john.ta/new_reduce_memory       99d84db Reintroduce: memory stuff\n>>> 2014-12-05   john.ta/bugfixes                            e15c95e Add stuff\n>>> 2014-12-03   john.ta/container                           e9fd4e5 This\n>>> branch is a test bed for containers\n>>>\n>>>\n>>> (These columns are supposed to be all aligned nicely..)\n>>>\n>>> So, features:\n>>>\n>>> 1. Show the date of the last commit\n>>> 2. Sort by date.  Most recently used branches at the top\n>>> 3. Show the branch name, including your current \"branch\", with a * to\n>>> indicate that it's checked out.\n>>> 4. Show the sha\n>>> 5. Show the branch DESCRIPTION - and if that's not available, show the\n>>> short-line of the most recent commit.\n>>>\n>>> There is also a small amount of color here that I can't paste here, to\n>>> follow the coloring in the current git branch.\n>>>\n>>> Before I start making patches etc, what do people think?  Would I have\n>>> a chance of getting this in?  Should I change some aspects etc?\n>>>\n>>> Thanks,\n>>>\n>>> John Tapsell\n>>>\n>>\n>> I support the general goal, we have quite some way to go there.\n>>\n>> As to the method: \"git branch\" in list mode, \"git tag\" in list mode and\n>> \"git for-each-ref\" all do similar things and are in turn not dissimilar\n>> from \"git log --no-walk\" with appropriate formatting and rev options.\n>>\n>> Rather than extending \"git branch\" any further[*], I suggest a bolder\n>> strategy:\n>>\n>> - unify/merge for-each-ref and pretty formats (and code) as far as possible\n>> - leverage that for the list modes of branch and tag\n>>\n>> That would allow everyone to get their favourite listing, just like for\n>> logs. Otherwise it would be very difficult to agree on *the* proper\n>> format for an extended branch or tag list.\n>>\n>> Michael\n>>\n>>\n>> [*] I know I'm a sinner, too.\n"},{"id":"253777","messageId":"xmqqzjam80fb.fsf@gitster.dls.corp.google.com","threadId":"38190","inReplyTo":"CAHQ6N+qBUcBcG8RC6Co+k_GmJDXCynmyfZmvTjz4bQyH1wG3DA@mail.gmail.com","subject":"Re: Improving git branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-17T20:51:36Z","receivedAt":"2014-12-17T20:51:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Tapsell <johnflux@gmail.com> writes:\n\n>   I'm interested in putting in some time and effort into improving the\n> output of \"git branch\".\n>\n>   What I'm thinking is an output like this:\n>\n> $ git branch\n>\n> 2014-12-17 * (detached from origin/master)     deaba04 Do stuff\n> 2014-12-15   john.ta/add_timing_info                6edbcfa  Add timing stuff\n> 2014-12-14   master                                          8537316\n> [origin/master: ahead 1, behind 16] Some stuff\n> 2014-12-12   john.ta/new_reduce_memory       99d84db Reintroduce: memory stuff\n> 2014-12-05   john.ta/bugfixes                            e15c95e Add stuff\n> 2014-12-03   john.ta/container                           e9fd4e5 This\n> branch is a test bed for containers\n>\n>\n> (These columns are supposed to be all aligned nicely..)\n>\n> So, features:\n>\n> 1. Show the date of the last commit\n> 2. Sort by date.  Most recently used branches at the top\n> 3. Show the branch name, including your current \"branch\", with a * to\n> indicate that it's checked out.\n> 4. Show the sha\n> 5. Show the branch DESCRIPTION - and if that's not available, show the\n> short-line of the most recent commit.\n>\n> There is also a small amount of color here that I can't paste here, to\n> follow the coloring in the current git branch.\n>\n> Before I start making patches etc, what do people think?  Would I have\n> a chance of getting this in?  Should I change some aspects etc?\n\nThree random points:\n\n * A single output format can never be favourite of everybody, so\n   this needs to be more like\n\n\t$ git branch --format='%(committerdate) %(refname) %(subject)'\n\n   optionally with branch.format configuration variable to let the\n   user specify the default.\n\n * I am not sure if the \"current\" marker should be anywhere but the\n   frontmost column in the recommended default.  The output from the\n   command obviously is not meant for machine processing\n   (e.g. sorting or grepping), so this point is minor, though.\n\n * I do not think the object name should take valuable screen real\n   estate, again in the built-in default (I wouldn't mind people\n   hurting themselves with their configuration at all ;-).  After\n   looking at \"git branch --pretty-long\" output, people can give any\n   command john.ta/bugfixes instead of e15c95e, no?\n"},{"id":"253778","messageId":"xmqqvbla80bm.fsf@gitster.dls.corp.google.com","threadId":"38190","inReplyTo":"549168DD.1080906@drmicha.warpmail.net","subject":"Re: Improving git branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-17T20:53:49Z","receivedAt":"2014-12-17T20:53:49Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> Rather than extending \"git branch\" any further[*], I suggest a bolder\n> strategy:\n>\n> - unify/merge for-each-ref and pretty formats (and code) as far as possible\n> - leverage that for the list modes of branch and tag\n>\n> That would allow everyone to get their favourite listing, just like for\n> logs. Otherwise it would be very difficult to agree on *the* proper\n> format for an extended branch or tag list.\n>\n> Michael\n>\n>\n> [*] I know I'm a sinner, too.\n\nActually this is not a \"bolder\" strategy, but the unification has\nbeen discussed and agreed to be the longer-term direction for quite\na while, I think.  Didn't Peff have this in his \"things to do when\nabsolutely bored\" box?\n"},{"id":"253779","messageId":"20141217210148.GA26551@peff.net","threadId":"38190","inReplyTo":"xmqqvbla80bm.fsf@gitster.dls.corp.google.com","subject":"Re: Improving git branch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-12-17T21:01:48Z","receivedAt":"2014-12-17T21:01:48Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Dec 17, 2014 at 12:53:49PM -0800, Junio C Hamano wrote:\n\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n> \n> > Rather than extending \"git branch\" any further[*], I suggest a bolder\n> > strategy:\n> >\n> > - unify/merge for-each-ref and pretty formats (and code) as far as possible\n> > - leverage that for the list modes of branch and tag\n> >\n> > That would allow everyone to get their favourite listing, just like for\n> > logs. Otherwise it would be very difficult to agree on *the* proper\n> > format for an extended branch or tag list.\n> >\n> > Michael\n> >\n> >\n> > [*] I know I'm a sinner, too.\n> \n> Actually this is not a \"bolder\" strategy, but the unification has\n> been discussed and agreed to be the longer-term direction for quite\n> a while, I think.  Didn't Peff have this in his \"things to do when\n> absolutely bored\" box?\n\nYes. It is not even in my \"absolutely bored\" box, but rather the \"I\nwould like to work on this but somehow other crap keeps coming up\" box.\n\nThe last blocker I ran into was that we need to unify the \"--contains\"\nimplementation for \"git tag\" and \"git branch\". If anybody wants to push\nthis forward, I think that is the best place to start. I can dig up\nreferences if anybody is interested.\n\n-Peff\n"},{"id":"253800","messageId":"5492A6D8.8060509@drmicha.warpmail.net","threadId":"38190","inReplyTo":"xmqqvbla80bm.fsf@gitster.dls.corp.google.com","subject":"Re: Improving git branch","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2014-12-18T10:05:12Z","receivedAt":"2014-12-18T10:05:12Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano schrieb am 17.12.2014 um 21:53:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n> \n>> Rather than extending \"git branch\" any further[*], I suggest a bolder\n>> strategy:\n>>\n>> - unify/merge for-each-ref and pretty formats (and code) as far as possible\n>> - leverage that for the list modes of branch and tag\n>>\n>> That would allow everyone to get their favourite listing, just like for\n>> logs. Otherwise it would be very difficult to agree on *the* proper\n>> format for an extended branch or tag list.\n>>\n>> Michael\n>>\n>>\n>> [*] I know I'm a sinner, too.\n> \n> Actually this is not a \"bolder\" strategy, but the unification has\n> been discussed and agreed to be the longer-term direction for quite\n> a while, I think.  Didn't Peff have this in his \"things to do when\n> absolutely bored\" box?\n> \n\nIf \"waiting for Peff to be bored\" is not a bold strategy then I don't\nknow what would be one ;)\n\nSeriously, I didn't feel bold enough to claim that this is agreed upon\nbut I am more than happy that it is!\n\nIf I can squeeze out some more git time from my other obligations I'll\ntry and help.\n\nMichael\n"},{"id":"253890","messageId":"loom.20141221T170822-647@post.gmane.org","threadId":"38190","inReplyTo":"20141217210148.GA26551@peff.net","subject":"Re: Improving git branch","fromName":"Moritz Neeb","fromEmail":"lists@moritzneeb.de","sentAt":"2014-12-21T16:36:00Z","receivedAt":"2014-12-21T16:36:00Z","isPatch":false,"sender":{"key":"lists@moritzneeb.de","avatar":null},"body":"Jeff King <peff <at> peff.net> writes:\n\n> \n> On Wed, Dec 17, 2014 at 12:53:49PM -0800, Junio C Hamano wrote:\n> \n> > Michael J Gruber <git <at> drmicha.warpmail.net> writes:\n> > \n> > > Rather than extending \"git branch\" any further[*], I suggest a bolder\n> > > strategy:\n> > >\n> > > - unify/merge for-each-ref and pretty formats (and code) as far as\npossible\n> > > - leverage that for the list modes of branch and tag\n> > >\n> > > That would allow everyone to get their favourite listing, just like for\n> > > logs. Otherwise it would be very difficult to agree on *the* proper\n> > > format for an extended branch or tag list.\n> > >\n> > > Michael\n> > >\n> > >\n> > > [*] I know I'm a sinner, too.\n> > \n> > Actually this is not a \"bolder\" strategy, but the unification has\n> > been discussed and agreed to be the longer-term direction for quite\n> > a while, I think.  Didn't Peff have this in his \"things to do when\n> > absolutely bored\" box?\n> \n> Yes. It is not even in my \"absolutely bored\" box, but rather the \"I\n> would like to work on this but somehow other crap keeps coming up\" box.\n\nIs this box public somewhere?\n\n> The last blocker I ran into was that we need to unify the \"--contains\"\n> implementation for \"git tag\" and \"git branch\". If anybody wants to push\n> this forward, I think that is the best place to start. I can dig up\n> references if anybody is interested.\n> \n\nYes, I would be interested in references. I already found something in\nJunio's leftover bits [1] that seems related:\n  \"git tag --contains\" should not consider a tag as the anchor point to\n  describe the commit, when it can reach another tag that can also be used\n  to describe the commit. Cf. [2]\n\nRegards,\nMoritz\n\n[1] http://git-blame.blogspot.fr/p/leftover-bits.html\n[2] http://thread.gmane.org/gmane.comp.version-control.git/246381/focus=246423\n"}]}