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
Jun 4, 2013, 13:11 UTC
Message-ID
<CACsJy8BpeP0y+wFbNJioR-TwyV1P77moz0x2ZDXzqz2ZKWTahg@mail.gmail.com>
In-Reply-To
<CALkWK0kGrCDhDFL5THBTTVARTnfY2xucbJaGJGKj8OYv3Q1pBA@mail.gmail.com>
On Tue, Jun 4, 2013 at 7:52 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 10 quoted lines
> Duy Nguyen wrote:
>> Nobody should ever parse these output
>> with scripts. The color can be generated from color.branch.*.
>
> How do we implement color.branch.(current|local|remote|plain)?  In the
> current code, we take a crude approach by hand-constructing argc, argv
> strings and passing it to cmd_for_each_ref().  There are no
> conditionals in the format syntax (and introducing one is probably not
> a good idea either): so, I'm guessing these configuration variables
> have to be read by for-each-ref?

Maybe. I don't really like the idea that for-each-ref reads _branch_ config. We could introduce the same set of keys but in color.for-each-ref namespace. %C(auto) will take care of the logic and choose the correct color key. When we replace branch's listing code with for-each-ref, I think we could somehow override for-each-ref keys with branch ones in-core. Too hacky?

Show 5 quoted lines
>> A bigger
>> problem is show_detached(), --[no-]merged, --with and --contains. We
>> need to move some of those code over to for-each-ref.
>
> I saw that you fixed this.

Nope. --[no-]merged and --contains seem easy. show_detached is still WIP, mostly because detached HEAD may or may not show when you provide a pattern to git-branch (e.g. git branch --list 'foo*') and because HEAD is always the first item, regardless of sorting order. get_head_description also seems more porcelain-ish than a plumbing feature..

Show 5 quoted lines
>> 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.
>
> Does your track-responsiveness patch fix this?
Yes.
Show 5 quoted lines
>> I checked out
>> your branch, made some more updates and pushed out to my
>> for-each-ref-pretty again. Changes are:
>
> *pants* Sorry, I'm finding it hard to keep up.

Sorry that branch was in a better shape the day I sent my previous email. Then I kind of used it as a playground with --[no-]merged, --contains and stuff :-P -- Duy

Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 27 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.