{"thread":{"id":"37073","subject":"Branch list by date","startedAt":"2014-07-08T04:54:55Z","lastAt":"2014-07-09T05:21:14Z","messageCount":2,"participants":["Jeremy Apthorp","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"245507","messageId":"CAMxk9GhQs_kF5573MS1SJ6a7UZuPu+oquXidOOvibznLQ7_FWw@mail.gmail.com","threadId":"37073","inReplyTo":null,"subject":"Branch list by date","fromName":"Jeremy Apthorp","fromEmail":"nornagon@nornagon.net","sentAt":"2014-07-08T04:54:55Z","receivedAt":"2014-07-08T04:54:55Z","isPatch":false,"sender":{"key":"nornagon@nornagon.net","avatar":null},"body":"I built this terribly-written alias because I wanted to see a list of\nbranches by date of commit. The output looks like this:\n\n$ git bbd\n  11 months ago  pipette_editor\n    7 weeks ago  ensure-ie-rendering-edge\n    6 weeks ago  strings-yml\n    5 weeks ago  message-when-validation-fails\n    4 weeks ago  new-parsers\n    11 days ago  tax\n    8 hours ago  search\n    7 hours ago  browse\n 16 minutes ago  master\n  8 seconds ago  org-read\n\nAnd the alias, in all its glory:\n\n[alias]\n  bbd = \"!export head=$(git symbolic-ref HEAD); git for-each-ref\n--sort=committerdate --format 'color=$(if [[ %(refname) = $head ]];\nthen printf \\\"\\\\e[32m\\\"; fi); printf \\\"\\\\e[01;30m%%15s\\\\e(B\\\\e[m\n%%s%%s\\\\n\\\" %(committerdate:relative) $color %(refname:short)'\nrefs/heads/ --shell | sh\"\n\nI write this missive with dual purpose: firstly to share a potentially\nuseful tool, and secondly to suggest that this feature (with a less\nmind-wrenchingly disgusting implementation) might be included in\nmainline git, as for example `git branch [-t] | [--by-time]`.\n\nUntil the ocean swallows us all,\nj\n"},{"id":"245568","messageId":"20140709052114.GC2318@sigill.intra.peff.net","threadId":"37073","inReplyTo":"CAMxk9GhQs_kF5573MS1SJ6a7UZuPu+oquXidOOvibznLQ7_FWw@mail.gmail.com","subject":"Re: Branch list by date","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-07-09T05:21:14Z","receivedAt":"2014-07-09T05:21:14Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jul 07, 2014 at 09:54:55PM -0700, Jeremy Apthorp wrote:\n\n> I write this missive with dual purpose: firstly to share a potentially\n> useful tool, and secondly to suggest that this feature (with a less\n> mind-wrenchingly disgusting implementation) might be included in\n> mainline git, as for example `git branch [-t] | [--by-time]`.\n\nI think what we should aim for is:\n\n  1. Teaching git-branch the same sorting as for-each-ref. So first\n     --sort, and then possibly \"-t\" as an alias for \"--sort=committerdate\".\n\n  2. Teaching git-branch custom output formats. We have \"-v\" and \"-vv\",\n     but it should support the full power of for-each-ref's --format\n     atoms.\n\n  3. Teach branch and for-each-ref to support readable colors in their\n     formats, like we do for \"log --format\".\n\n  4. Optionally add config options to configure defaults for the above,\n     so \"git branch\" shows what you want.\n\nI'm (slowly) working on a refactor that will unify for-each-ref and\nbranch, which would accomplish (1) and (2).\n\n-Peff\n"}]}