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

Re: [PATCH v6 0/10] port tag.c to use ref-filter APIs

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jul 30, 2015, 09:44 UTC
Message-ID
<vpqzj2e9dyj.fsf@anie.imag.fr>
In-Reply-To
<xmqqbneu907l.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> "Currently we do not need it to reimplement the canned 'tag -l'
> format" is an OK and sensible justification to stick to the current
> implementation of %(padright:N), but we'd need to think if we would
> want to keep this limited and strange form that applies to a single
> atom that comes next (ignoring any literal spans) as a private
> implementation detail between ref-filter and "git tag".  Opening it
> up to end-users would not mean we cannot add a correctly operating
> variant of "pad this string to the right" later, but it does mean we
> have to maintain %(padright) in this limited form forever.
>
> My knee-jerk reaction is that we probably should not want to expose
> this to the end users, and to discourage its use, perhaps name it
> somewhat strangely (e.g. "%(x-padright:N)" or something).

I disagree. The current %(padright) fits 99.9% needs. It's handy for the user if he wants a column-display with --format. It's consistant with the "git log" %<() atoms.

Sure, if the user wants really advanced formatting, it's not sufficient. But first I believe this is a case of YAGNI, "right-pad an arbitrary string" is a funny coding exercice, but not very useful in real-life. And then, if one really has a use-case for advanced formatting, I think a much better approach is to dump an easy-to-parse language (XML/JSON/CSV/...) and pipe it to a formatter written in a real programming language. It will always be more powerful than having to chose in a limited set of %(atoms).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Karthik Nayak
Message 30 of 42 in “port tag.c to use ref-filter APIs”
  1. 0/10 port tag.c to use ref-filter APIsKarthik Nayak, Jul 28, 2015
  2. 01/10 ref-filter: introduce 'ref_formatting_state'Karthik Nayak, Jul 28, 2015
  3. 02/10 ref-filter: add option to pad atoms to the rightKarthik Nayak, Jul 28, 2015
  4. Eric SunshineJul 29, 2015
  5. Karthik NayakJul 30, 2015
  6. 03/10 ref-filter: add option to filter only tagsKarthik Nayak, Jul 28, 2015
  7. 04/10 ref-filter: support printing N lines from tag annotationKarthik Nayak, Jul 28, 2015
  8. 05/10 ref-filter: add support to sort by versionKarthik Nayak, Jul 28, 2015
  9. Eric SunshineJul 29, 2015
  10. Karthik NayakJul 30, 2015
  11. 06/10 ref-filter: add option to match literal patternKarthik Nayak, Jul 28, 2015
  12. 07/10 tag.c: use 'ref-filter' data structuresKarthik Nayak, Jul 28, 2015
  13. 08/10 tag.c: use 'ref-filter' APIsKarthik Nayak, Jul 28, 2015
  14. 09/10 tag.c: implement '--format' optionKarthik Nayak, Jul 28, 2015
  15. 10/10 tag.c: implement '--merged' and '--no-merged' optionsKarthik Nayak, Jul 28, 2015
  16. Matthieu MoyJul 28, 2015
  17. Karthik NayakJul 29, 2015
  18. Matthieu MoyJul 29, 2015
  19. Karthik NayakJul 29, 2015
  20. Matthieu MoyJul 29, 2015
  21. 01/10 ref-filter: introduce 'ref_formatting_state'Eric Sunshine, Jul 29, 2015
  22. Junio C HamanoJul 29, 2015
  23. Junio C HamanoJul 29, 2015
  24. Karthik NayakJul 30, 2015
  25. Matthieu MoyJul 30, 2015
  26. Matthieu MoyJul 29, 2015
  27. Karthik NayakJul 30, 2015
  28. Eric SunshineJul 29, 2015
  29. Junio C HamanoJul 29, 2015
  30. Matthieu MoyJul 30, 2015
  31. Karthik NayakJul 30, 2015
  32. 01/11 ref-filter: introduce 'ref_formatting_state'Karthik Nayak, Jul 30, 2015
  33. 02/11 ref-filter: make `color` use `ref_formatting_state`Karthik Nayak, Jul 30, 2015
  34. 03/11 ref-filter: add option to pad atoms to the rightKarthik Nayak, Jul 30, 2015
  35. 04/11 ref-filter: add option to filter only tagsKarthik Nayak, Jul 30, 2015
  36. 05/11 ref-filter: support printing N lines from tag annotationKarthik Nayak, Jul 30, 2015
  37. 06/11 ref-filter: add support to sort by versionKarthik Nayak, Jul 30, 2015
  38. 07/11 ref-filter: add option to match literal patternKarthik Nayak, Jul 30, 2015
  39. 08/11 tag.c: use 'ref-filter' data structuresKarthik Nayak, Jul 30, 2015
  40. 09/11 tag.c: use 'ref-filter' APIsKarthik Nayak, Jul 30, 2015
  41. 10/11 tag.c: implement '--format' optionKarthik Nayak, Jul 30, 2015
  42. 11/11 tag.c: implement '--merged' and '--no-merged' optionsKarthik Nayak, Jul 30, 2015

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.