Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

git branch -v output ambiguous for parser

From: Thibault Kruse <hidden>
Date: 2016-06-15 23:05:51

Hi,

trying to write a git wrapper, I wanted to parse the output of git branch -v

However, I realized that the output prints the last commit message at
the end of the line, without any disambigution char, or hyphens.
This makes it possible to have these outputs:

  foo                 6d29736 [foo/bar] test123
  master              9726de6 [ahead 2, behind 2] line 1 line 2 line 3

where foo is a branch that does not track another branch, and the last
commit message on branch foo is '[foo/bar] test123'.
The opening brackets '[' are even aligned in the output, making that
distinction also difficult for the human eye.

So as a small improvement I would suggest some separating char or
hyphens around the commit message, e.g.:

  foo                 6d29736 '[foo/bar] test123'
  foo                 6d29736 | [foo/bar] test123

regards,
  Thibault Kruse
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help