Re: branch annotations?
- From
Johan Herland <johan@herland.net>
- Date
- Nov 25, 2013, 14:55 UTC
- Message-ID
- <CALKQrgdTxYmy2ncXNB29B0-05g8CK=-jxWfDVPbUjHTPsm1yOw@mail.gmail.com>
- In-Reply-To
- <20131125084644.350bd4f7@bigbox.christie.dr>
On Mon, Nov 25, 2013 at 3:46 PM, Tim Chase <git@tim.thechases.com> wrote:
Show 19 quoted lines
> Is there any way to associate some sort of note with a branch that > would be shown when listing them? While I currently have things like > "issue/QA-42", it would be nice to have a note associated with it so > I could do something like > > $ git branch --show-notes > issue/CR-88: make sure NoSQL engines support .CSV file backends > issue/QA-31: add missile launch codes > * issue/QA-42: support flying cars > master > > as I currently need to flip back and forth between my git/terminal > and my issue-tracker to know that, if I need to be adding missile > launch codes, I need to be working on QA-31. I know there are "note" > features elsewhere for commits, and I know that git-branch supports > showing the most recent commit (that's not always enough info to > discern the branch's purpose). > > Thanks for any ideas on how to ease this pain-point, :-)
"git branch --edit-description" allows you to write a descriptive string for your branch. AFAICS, however, it currently only shows up when using request-pull. It does not show up in any git branch command. IMHO that should be fixed.
As a workaround, you can use this one-liner:
git for-each-ref --format "%(refname:short)" refs/heads/ | while read branch; do echo "$branch - $(git config branch.$branch.description)"; done
I guess that could even be turned into an alias...
Hope this helps,
...Johan
-- Johan Herland, <johan@herland.net> www.herland.net