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 29, 2013, 03:22 UTC
Message-ID
<CACsJy8CyocXvjqM5BYgdnhYJPB8wyZ2+qcM9_7EU-WDmw+F5Qw@mail.gmail.com>
In-Reply-To
<CALkWK0k=2NZsbSnxS50w+bux8q9mZh7GZzpCqhTP=2jqyHnBSg@mail.gmail.com>

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

Show 6 quoted lines
> Also, a couple of minor annoyances:
>
> 1. When f-e-r is invoked with refs/tags, we get stray output.  Atleast
> it doesn't segfault, thanks to your ignore-commit patch.  Maybe
> printing stray output is the right thing to do, as opposed to erroring
> out.
What format did you use?
> 2. %>(*) only works with f-e-r atoms, not with pretty-format atoms.
> This is ofcourse obvious from the implementation, but isn't it a
> little consistent?

It is not. I think it's documented as well as a known implementation limitation. It's not hard to be fixed (we could call format_commit_message again for all entries, this time with a single placeholder, to collect the best width). If anybody does need %>(*)%H to work, we could do it. BTW, the way I implement get_atom_width() is not really optimal. For n lines, we call print_value() in get_atom_width n^2 times. We could cache the calculated width instead and reduce that to n times.

> Should we start off a new pretty-ref-formats document, where we
> explicitly exclude things like %ae (because of the hex overriding
> thing)?  I don't think it's a problem if documented properly.

And this one is doucmented as well, I think. I'd really like to introduce a new --pretty option (or something) that does not accept %xx as a hex notion, so %ae and friends won't be hidden. It's also a good thing for compatibility because currently %H in --format produces %H. After this, %H produces something else. It's unlikely that anybody has done that. But it's even better if we avoid that possibility entirely with a new option. -- Duy

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