git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 0/3] Towards a useable git-branch

From
Duy Nguyen <pclouds@gmail.com>
Date
May 30, 2013, 04:19 UTC
Message-ID
<CACsJy8DA4oCj3WPmJY6aA7Gq3Xx4xqZ2XxxiZUuR6TqgK=f6Ww@mail.gmail.com>
In-Reply-To
<CALkWK0nFDdfGKeRqKKTTMSm4zqHDOt_iGc1aA7LgD9=y2DJO5A@mail.gmail.com>

On Tue, May 28, 2013 at 9:24 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 23 quoted lines
> Oh, and by the way:
>
> We're pretty close we are to replacing branch -v and branch -vv.
>
> brv = for-each-ref --format='%(HEAD)
> %C(green)%<(*)%(refname:short)%C(reset) %<(*)%(objectname:short)
> %(subject)' refs/heads
>
> brvv = for-each-ref --format='%(HEAD)
> %C(green)%<(*)%(refname:short)%C(reset) %<(*)%(objectname:short)
> %C(blue)%(upstream:short)%C(reset) %(subject)' refs/heads
>
> There are small differences:
>
> 1. In branch -v, the green-color of the branch name is dependent on
> %(HEAD).  Not worth ironing out, in my opinion.
>
> 2. In branch -vv, there are dependent square braces that come on when
> %(refname:short) is set.  We might want to introduce an undocumented
> %(refname:branchvv) for internal use by branch -vv, for backward
> compatibility.
>
> What do you think?

I think we can change -v and -vv format slightly as long as the information remains the same. Nobody should ever parse these output with scripts. The color can be generated from color.branch.*. A bigger problem is show_detached(), --[no-]merged, --with and --contains. We need to move some of those code over to for-each-ref. Another problem is the new "branch -v" seems to less responsive than old "branch -v" because (I think) of sorting, even if we don't need it. I checked out your branch, made some more updates and pushed out to my for-each-ref-pretty again. Changes are:

 - fix segfault with "for-each-ref --format=%something refs/tags/'
 - add --pretty for new format syntax and keep --format unchanged
 - add --[no-]column to for-each-ref (for "git branch" with no arguments)
 - remove branch listing code and use for-each-ref instead (41
inserts, 378 deletes, beautiful).
 - add --sort and --count to git-branch
--
Duy
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 25 of 31 in “Towards a useable git-branch”
  1. 0/3 Towards a useable git-branchRamkumar Ramachandra, May 24, 2013
  2. 1/3 for-each-ref: introduce %C(...) for colorRamkumar Ramachandra, May 24, 2013
  3. Antoine PelisseMay 24, 2013
  4. Ramkumar RamachandraMay 25, 2013
  5. John KeepingMay 25, 2013
  6. Ramkumar RamachandraMay 25, 2013
  7. Antoine PelisseMay 25, 2013
  8. David AguilarMay 24, 2013
  9. Ramkumar RamachandraMay 25, 2013
  10. Eric SunshineMay 25, 2013
  11. 2/3 for-each-ref: introduce %(HEAD) markerRamkumar Ramachandra, May 24, 2013
  12. Philip OakleyMay 24, 2013
  13. 3/3 for-each-ref: introduce %(upstream:track[short])Ramkumar Ramachandra, May 24, 2013
  14. Duy NguyenMay 24, 2013
  15. Ramkumar RamachandraMay 24, 2013
  16. Junio C HamanoMay 24, 2013
  17. Ramkumar RamachandraMay 24, 2013
  18. Ramkumar RamachandraMay 24, 2013
  19. Duy NguyenMay 24, 2013
  20. Duy NguyenMay 25, 2013
  21. Duy NguyenMay 25, 2013
  22. Ramkumar RamachandraMay 25, 2013
  23. Ramkumar RamachandraMay 28, 2013
  24. Ramkumar RamachandraMay 28, 2013
  25. Duy NguyenMay 30, 2013
  26. Ramkumar RamachandraJun 4, 2013
  27. Duy NguyenJun 4, 2013
  28. Ramkumar RamachandraMay 28, 2013
  29. Duy NguyenMay 29, 2013
  30. Ramkumar RamachandraMay 29, 2013
  31. Duy NguyenMay 29, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.