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

Re: Simplify-by-decoration with decorate-refs-exclude

From
René Scharfe <l.s.r@web.de>
Date
Aug 2, 2019, 20:36 UTC
Message-ID
<5de287e9-a8e8-780a-7d39-2229b61914ca@web.de>
In-Reply-To
<xmqq36ijl6qu.fsf@gitster-ct.c.googlers.com>
Am 02.08.19 um 21:14 schrieb Junio C Hamano:
> I can see how this would help, but it somehow feels a bit brittle
> to rely on where the decorations get loaded.
Right.
Show 7 quoted lines
> I wonder if it would help to move the ability to handle decoration
> filter down from the log layer to revisions.c API layer.
>
> It looks to me that this caller of setup_revisions() can prepare
> decoration_filter before it calls setup_revisions(); we can let the
> revisions.c layer call load_ref_decorations() in setup_revisions()
> if that is the case, no?

Having cmd_log_init_finish() call load_ref_decorations() before setup_revisions() would indeed solve the issue as well. But we need to call the latter to check if --pretty=raw was given and avoid loading decorations in that case, don't we?

> Other two callers of load_ref_decorations() are deep inside pretty.c
> but I wonder in the longer term if we would want to turn them into
> an "a lot higher level should have already loaded decorations"
> assert.

This would require that higher level to parse the user format to check if %d or %D is present before formatting the first item. Hmm.

René
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 11 in “Simplify-by-decoration with decorate-refs-exclude”
  1. Étienne SERVAISAug 2, 2019
  2. René ScharfeAug 2, 2019
  3. Junio C HamanoAug 2, 2019
  4. René ScharfeAug 2, 2019
  5. Junio C HamanoAug 2, 2019
  6. Jeff KingAug 2, 2019
  7. René ScharfeAug 3, 2019
  8. Junio C HamanoAug 3, 2019
  9. 1/2 log: test --decorate-refs-exclude with --simplify-by-decorationRené Scharfe, Sep 8, 2019
  10. Junio C HamanoSep 9, 2019
  11. 2/2 log-tree: call load_ref_decorations() in get_name_decoration()René Scharfe, Sep 8, 2019

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.