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

Re: [PATCH v2 06/10] log: add default decoration filter

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 4, 2022, 07:08 UTC
Message-ID
<220804.86iln8e9hl.gmgdl@evledraar.gmail.com>
In-Reply-To
<bec532fb8c63b3ae784d442f438687a4f0bbad37.1659122979.git.gitgitgadget@gmail.com>
On Fri, Jul 29 2022, Derrick Stolee via GitGitGadget wrote:
> From: Derrick Stolee <derrickstolee@github.com>

Thanks for the re-roll in general, there's a lot of good stuff here & I hope I find more time to comment on it in more detail, but just focusing on things that would be hard to back out of once changed:

Show 24 quoted lines
> [...]
> Another alternative would be to exclude the known namespaces that are
> not intended to be shown. This would reduce the visible effect of the
> change for expert users who use their own custom ref namespaces. The
> implementation change would be very simple to swap due to our use of
> ref_namespaces:
>
> 	int i;
> 	struct string_list *exclude = decoration_filter->exclude_ref_pattern;
>
> 	/*
> 	 * No command-line or config options were given, so
> 	 * populate with sensible defaults.
> 	 */
> 	for (i = 0; i < NAMESPACE__COUNT; i++) {
> 		if (ref_namespaces[i].decoration)
> 			continue;
>
> 		string_list_append(exclude, ref_namespaces[i].ref);
> 	}
>
> The main downside of this approach is that we expect to add new hidden
> namespaces in the future, and that means that Git versions will be less
> stable in how they behave as those namespaces are added.

I see that as a feature, and not a downside. If we simply explain this in the documentation as e.g.:

	When adding decorations git will by default exclude certain
	"internal" ref namespaces that it treats specially, such as
	refs/magical-1/*, refs/magical-2/* (or whatever). Other such
	special namespaces may be reserved in the future.

There's no lack of "stability", because the ref hiding only act on what's known to be something we can ignore, because our git version knows about it.

If git v2.40 knows about refs/magical-1/* but not refs/magical-2/*, but git v2.50 knows about both it's not a lack of stability that v2.40 shows one decorated by default, but v2.50 shows neither.

To v2.40 one of them isn't a magical "I know what this is, it's internal & I can hide it" ref.

I'm aware that we disagree, and some of this was discussed in v1. I'm not intending to just repeat what I said before.

But it's not just that I disagree, I genuinely don't get your POV here. We:

 * Know that we have (admittedly probably rare) in-the-wild use of
   non-standard and custom namespaces, and that this series would change
   long-standing log output.
   If I could see a good reason to change the existing "log" behavior
   here I'd probably be sold on it. We try not to change existing output
   in general, but this part isn't "plumbing", and arguably not a very
   "stable" part of the log output either (decorations being optional
   etc).
   But it does rub me the wrong way to sell a change in the name of
   "stability" when it's from the outset doing the exact opposite,
   to....
 * ... are willing to make that one-time change so that we can have
   stability for users that are relying on "decorate" working
   consistently across versions once we're in the new world order,
   because we *might* add new magical refs.

Since the latter group of users don't exist today by definition (this having not been integrated) why isn't it a better win-win solution to give those users some --decorate-only-known-refs option/config?

They'd get their "stability" going forward, and without the needless breaking of existing behavior, no?

Show 14 quoted lines
> +test_expect_success 'log --decorate does not include things outside filter' '
> +	reflist="refs/prefetch refs/rebase-merge refs/bundle" &&
> +
> +	for ref in $reflist
> +	do
> +		git update-ref $ref/fake HEAD || return 1
> +	done &&
> +
> +	git log --decorate=full --oneline >actual &&
> +
> +	for ref in $reflist
> +	do
> +		! grep $ref/fake actual || return 1
> +	done
I haven't tested, but isn't that last for-loop replacable with:
	! grep /fake actual
?
Or do we have other "/fake" refs we want to include?
Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee
Message 48 of 79 in “log: create tighter default decoration filter”
  1. 0/3 log: create tighter default decoration filterDerrick Stolee via GitGitGadget, Jul 26, 2022
  2. 1/3 refs: allow "HEAD" as decoration filterDerrick Stolee via GitGitGadget, Jul 26, 2022
  3. Ævar Arnfjörð BjarmasonJul 26, 2022
  4. Derrick StoleeJul 29, 2022
  5. 2/3 log: add default decoration filterDerrick Stolee via GitGitGadget, Jul 26, 2022
  6. Ævar Arnfjörð BjarmasonJul 26, 2022
  7. Derrick StoleeJul 29, 2022
  8. Ævar Arnfjörð BjarmasonJul 26, 2022
  9. Junio C HamanoJul 27, 2022
  10. Derrick StoleeJul 27, 2022
  11. Junio C HamanoJul 27, 2022
  12. Jeff KingJul 29, 2022
  13. 3/3 maintenance: stop writing log.excludeDecorationDerrick Stolee via GitGitGadget, Jul 26, 2022
  14. Junio C HamanoJul 27, 2022
  15. Ævar Arnfjörð BjarmasonJul 26, 2022
  16. Derrick StoleeJul 26, 2022
  17. Ævar Arnfjörð BjarmasonJul 26, 2022
  18. Derrick StoleeJul 27, 2022
  19. Ævar Arnfjörð BjarmasonJul 27, 2022
  20. 00/10 log: create tighter default decoration filterDerrick Stolee via GitGitGadget, Jul 29, 2022
  21. 01/10 refs: allow "HEAD" as decoration filterDerrick Stolee via GitGitGadget, Jul 29, 2022
  22. Junio C HamanoAug 3, 2022
  23. Derrick StoleeAug 4, 2022
  24. 02/10 t4207: test coloring of grafted decorationsDerrick Stolee via GitGitGadget, Jul 29, 2022
  25. Ævar Arnfjörð BjarmasonAug 3, 2022
  26. Eric SunshineAug 3, 2022
  27. Ævar Arnfjörð BjarmasonAug 3, 2022
  28. Eric SunshineAug 4, 2022
  29. Junio C HamanoAug 4, 2022
  30. Derrick StoleeAug 5, 2022
  31. 03/10 refs: add array of ref namespacesDerrick Stolee via GitGitGadget, Jul 29, 2022
  32. Junio C HamanoAug 3, 2022
  33. Derrick StoleeAug 4, 2022
  34. Junio C HamanoAug 4, 2022
  35. Josh SteadmonAug 3, 2022
  36. Derrick StoleeAug 4, 2022
  37. 04/10 refs: use ref_namespaces for replace refs baseDerrick Stolee via GitGitGadget, Jul 29, 2022
  38. Josh SteadmonAug 3, 2022
  39. Derrick StoleeAug 4, 2022
  40. 05/10 log-tree: use ref_namespaces instead of if/else-ifDerrick Stolee via GitGitGadget, Jul 29, 2022
  41. Junio C HamanoAug 3, 2022
  42. Derrick StoleeAug 4, 2022
  43. Derrick StoleeAug 4, 2022
  44. Derrick StoleeAug 4, 2022
  45. Junio C HamanoAug 4, 2022
  46. Derrick StoleeAug 4, 2022
  47. 06/10 log: add default decoration filterDerrick Stolee via GitGitGadget, Jul 29, 2022
  48. Ævar Arnfjörð BjarmasonAug 4, 2022
  49. Derrick StoleeAug 5, 2022
  50. Ævar Arnfjörð BjarmasonAug 5, 2022
  51. Derrick StoleeAug 5, 2022
  52. Ævar Arnfjörð BjarmasonAug 11, 2022
  53. Derrick StoleeAug 12, 2022
  54. 08/10 log: create log.decorateFilter=allDerrick Stolee via GitGitGadget, Jul 29, 2022
  55. Josh SteadmonAug 3, 2022
  56. Derrick StoleeAug 4, 2022
  57. 10/10 fetch: use ref_namespaces during prefetchDerrick Stolee via GitGitGadget, Jul 29, 2022
  58. 07/10 log: add --decorate-all optionDerrick Stolee via GitGitGadget, Jul 29, 2022
  59. Junio C HamanoAug 4, 2022
  60. 09/10 maintenance: stop writing log.excludeDecorationDerrick Stolee via GitGitGadget, Jul 29, 2022
  61. Junio C HamanoAug 3, 2022
  62. 00/11 log: create tighter default decoration filterDerrick Stolee via GitGitGadget, Aug 5, 2022
  63. 01/11 refs: allow "HEAD" as decoration filterDerrick Stolee via GitGitGadget, Aug 5, 2022
  64. 02/11 t4207: modernize testDerrick Stolee via GitGitGadget, Aug 5, 2022
  65. 03/11 t4207: test coloring of grafted decorationsDerrick Stolee via GitGitGadget, Aug 5, 2022
  66. 04/11 refs: add array of ref namespacesDerrick Stolee via GitGitGadget, Aug 5, 2022
  67. 05/11 refs: use ref_namespaces for replace refs baseDerrick Stolee via GitGitGadget, Aug 5, 2022
  68. 06/11 log-tree: use ref_namespaces instead of if/else-ifDerrick Stolee via GitGitGadget, Aug 5, 2022
  69. 07/11 log: add default decoration filterDerrick Stolee via GitGitGadget, Aug 5, 2022
  70. Glen ChooSep 8, 2022
  71. Derrick StoleeSep 9, 2022
  72. Junio C HamanoSep 9, 2022
  73. Derrick StoleeSep 9, 2022
  74. Junio C HamanoSep 9, 2022
  75. Glen ChooSep 9, 2022
  76. 08/11 log: add --clear-decorations optionDerrick Stolee via GitGitGadget, Aug 5, 2022
  77. 10/11 maintenance: stop writing log.excludeDecorationDerrick Stolee via GitGitGadget, Aug 5, 2022
  78. 09/11 log: create log.initialDecorationSet=allDerrick Stolee via GitGitGadget, Aug 5, 2022
  79. 11/11 fetch: use ref_namespaces during prefetchDerrick Stolee via GitGitGadget, Aug 5, 2022

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.