git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <derrickstolee@github.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com, me@ttaylorr.com,
	vdye@github.com, steadmon@google.com
Subject: Re: [PATCH 0/3] log: create tighter default decoration filter
Date: Tue, 26 Jul 2022 12:38:06 -0400	[thread overview]
Message-ID: <c3b14045-01a1-e207-a60d-2e3290ab8001@github.com> (raw)
In-Reply-To: <220726.86tu73ncf8.gmgdl@evledraar.gmail.com>

On 7/26/2022 10:44 AM, Ævar Arnfjörð Bjarmason wrote:
> 
> On Tue, Jul 26 2022, Derrick Stolee via GitGitGadget wrote:
> 
>> This was previously reduced by adding the log.excludeDecoration config
>> option and modifying that config in git maintenance's prefetch task (to hide
>> refs/prefetch/*). I then followed that pattern again for the bundle URI
>> feature [1], but this caught some reviewers by surprise as an unfortunate
>> side-effect. This series is a way to roll back the previous decision to use
>> log.excludeDecoration and instead use tighter filters by default.
>>
>> As noted in the last patch, the current design ignores the new filters if
>> there are any previously-specified filters. This includes the
>> log.excludeDecorations=refs/prefetch/ set by the git maintenance command.
>> This means that users who ran that command in their repo will not get the
>> benefits of the more strict filters. While we stop writing
>> log.excludeDecorations, we don't remove existing instances of it.
> 
> Leaving aside the question of these magic refs, and if we need new ones
> (e.g. refs/bundle/*) I have sometimes made use of out-of-standard
> refspace refs.
> 
> E.g. when I build git I create refs/built-tags/* tag object refs
> (i.e. not in refs/tags/*), which is a neat way to get "git tag -l" and
> the like to ignore it.
> 
> But to still have it show decorated in logs (e.g. I'll see what my
> "private" branch is at), and "for-each-ref --contains" still knows about
> it.

You also have the unfortunate UX of having the refs spelled out entirely
("refs/<special-place>/..." instead of "<special-place>/..." like how
"refs/remotes/" is dropped from remote refs) and not having special color.
But that's beside the point.

> Now, that's a rather obscure use-case, and I suspect other "special
> refs" are similarly obscure (e.g. GitLab's refs/keep-around/* comes to
> mind).
> 
> But I think this change is going about it the wrong way, let's have a
> list of refs that Git knows about as magical, instead of assuming that
> we can ignore everything that's not on a small list of things we're
> including.
> 
> Wouldn't that give you what you want, and not exclude these sorts of
> custom refs unexpectedly for users?

Instead of keeping track of an ever-growing list of exclusions, instead
making a clear list of "this is what most users will want for their
decorations" is a better approach.

Users who know how to create custom refs outside of this space have the
capability to figure out how to show their special refs. My general ideas
for designing these kinds of features is to have a default that is focused
on the typical user while giving config options for experts to tweak those
defaults.

You're right that this series perhaps leaves something to be desired in
that second part, since there isn't an easy _config-based_ way to enable
all decorations (or a small additional subset).

>> I'm interested if anyone has another way around this issue, or if we
>> consider adding the default filter as long as no --decorate=refs options are
>> specified.
> 
> I think the resulting UX here is bad, in that we ship hardcoded list of
> these if you don't specify the config in 2/3. So I can do:
> 
>       -c log.excludeDecoration=this-will-never-match
> 
> To "clear" the list, but not this:
> 
>       -c log.excludeDecoration=

The thing that I forgot to do, but had considered was adding a
--decorate-all option to allow clearing the default filters from the
command line. You can already do "--decorate-refs=refs" to get everything
(except HEAD).

As far as config goes, we could also create a log.includeDecoration key,
but we'd want to consider it to populate the same part of the filtering
algorithm. Similar to having any instance of log.excludeDecoration, this
would clear the default list. To get all decorations again, you could add
this to your config file:

	[log]
		includeDecoration = refs
		includeDecoration = HEAD

Alternatively, we could instead create a "filter default" option such as
"log.decorateFilter = (core|all)" where "core" is the default set being
considered by this series, and "all" is the empty filter.

Thanks,
-Stolee

  reply	other threads:[~2022-07-26 16:38 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 14:04 [PATCH 0/3] log: create tighter default decoration filter Derrick Stolee via GitGitGadget
2022-07-26 14:04 ` [PATCH 1/3] refs: allow "HEAD" as " Derrick Stolee via GitGitGadget
2022-07-26 15:10   ` Ævar Arnfjörð Bjarmason
2022-07-29 13:23     ` Derrick Stolee
2022-07-26 14:04 ` [PATCH 2/3] log: add default " Derrick Stolee via GitGitGadget
2022-07-26 14:39   ` Ævar Arnfjörð Bjarmason
2022-07-29 13:25     ` Derrick Stolee
2022-07-26 15:04   ` Ævar Arnfjörð Bjarmason
2022-07-27 14:50   ` Junio C Hamano
2022-07-27 19:07     ` Derrick Stolee
2022-07-27 19:38       ` Junio C Hamano
2022-07-29 20:32     ` Jeff King
2022-07-26 14:04 ` [PATCH 3/3] maintenance: stop writing log.excludeDecoration Derrick Stolee via GitGitGadget
2022-07-27 14:50   ` Junio C Hamano
2022-07-26 14:44 ` [PATCH 0/3] log: create tighter default decoration filter Ævar Arnfjörð Bjarmason
2022-07-26 16:38   ` Derrick Stolee [this message]
2022-07-26 18:19     ` Ævar Arnfjörð Bjarmason
2022-07-27 13:41       ` Derrick Stolee
2022-07-27 20:40         ` Ævar Arnfjörð Bjarmason
2022-07-29 19:29 ` [PATCH v2 00/10] " Derrick Stolee via GitGitGadget
2022-07-29 19:29   ` [PATCH v2 01/10] refs: allow "HEAD" as " Derrick Stolee via GitGitGadget
2022-08-03  6:03     ` Junio C Hamano
2022-08-04 13:22       ` Derrick Stolee
2022-07-29 19:29   ` [PATCH v2 02/10] t4207: test coloring of grafted decorations Derrick Stolee via GitGitGadget
2022-08-03  6:25     ` Ævar Arnfjörð Bjarmason
2022-08-03  6:44       ` Eric Sunshine
2022-08-03 13:03         ` Ævar Arnfjörð Bjarmason
2022-08-04  4:05           ` Eric Sunshine
2022-08-04 17:23             ` Junio C Hamano
2022-08-05 14:21               ` Derrick Stolee
2022-07-29 19:29   ` [PATCH v2 03/10] refs: add array of ref namespaces Derrick Stolee via GitGitGadget
2022-08-03  6:16     ` Junio C Hamano
2022-08-04 13:29       ` Derrick Stolee
2022-08-04 16:16         ` Junio C Hamano
2022-08-03 22:39     ` Josh Steadmon
2022-08-04 13:29       ` Derrick Stolee
2022-07-29 19:29   ` [PATCH v2 04/10] refs: use ref_namespaces for replace refs base Derrick Stolee via GitGitGadget
2022-08-03 22:38     ` Josh Steadmon
2022-08-04 13:30       ` Derrick Stolee
2022-07-29 19:29   ` [PATCH v2 05/10] log-tree: use ref_namespaces instead of if/else-if Derrick Stolee via GitGitGadget
2022-08-03  6:31     ` Junio C Hamano
2022-08-04 13:31       ` Derrick Stolee
2022-08-04 14:34         ` Derrick Stolee
2022-08-04 14:50           ` Derrick Stolee
2022-08-04 17:40             ` Junio C Hamano
2022-08-04 20:17               ` Derrick Stolee
2022-07-29 19:29   ` [PATCH v2 06/10] log: add default decoration filter Derrick Stolee via GitGitGadget
2022-08-04  7:08     ` Ævar Arnfjörð Bjarmason
2022-08-05 14:27       ` Derrick Stolee
2022-08-05 14:50         ` Ævar Arnfjörð Bjarmason
2022-08-05 15:09           ` Derrick Stolee
2022-08-11 19:30             ` Ævar Arnfjörð Bjarmason
2022-08-12 19:37               ` Derrick Stolee
2022-07-29 19:29   ` [PATCH v2 07/10] log: add --decorate-all option Derrick Stolee via GitGitGadget
2022-08-04 16:57     ` Junio C Hamano
2022-07-29 19:29   ` [PATCH v2 08/10] log: create log.decorateFilter=all Derrick Stolee via GitGitGadget
2022-08-03 22:42     ` Josh Steadmon
2022-08-04 13:38       ` Derrick Stolee
2022-07-29 19:29   ` [PATCH v2 09/10] maintenance: stop writing log.excludeDecoration Derrick Stolee via GitGitGadget
2022-08-03  6:36     ` Junio C Hamano
2022-07-29 19:29   ` [PATCH v2 10/10] fetch: use ref_namespaces during prefetch Derrick Stolee via GitGitGadget
2022-08-05 17:58   ` [PATCH v3 00/11] log: create tighter default decoration filter Derrick Stolee via GitGitGadget
2022-08-05 17:58     ` [PATCH v3 01/11] refs: allow "HEAD" as " Derrick Stolee via GitGitGadget
2022-08-05 17:58     ` [PATCH v3 02/11] t4207: modernize test Derrick Stolee via GitGitGadget
2022-08-05 17:58     ` [PATCH v3 03/11] t4207: test coloring of grafted decorations Derrick Stolee via GitGitGadget
2022-08-05 17:58     ` [PATCH v3 04/11] refs: add array of ref namespaces Derrick Stolee via GitGitGadget
2022-08-05 17:58     ` [PATCH v3 05/11] refs: use ref_namespaces for replace refs base Derrick Stolee via GitGitGadget
2022-08-05 17:58     ` [PATCH v3 06/11] log-tree: use ref_namespaces instead of if/else-if Derrick Stolee via GitGitGadget
2022-08-05 17:58     ` [PATCH v3 07/11] log: add default decoration filter Derrick Stolee via GitGitGadget
2022-09-08 21:13       ` Glen Choo
2022-09-09 12:23         ` Derrick Stolee
2022-09-09 16:19           ` Junio C Hamano
2022-09-09 16:40             ` Derrick Stolee
2022-09-09 17:41               ` Junio C Hamano
2022-09-09 17:12             ` Glen Choo
2022-08-05 17:58     ` [PATCH v3 08/11] log: add --clear-decorations option Derrick Stolee via GitGitGadget
2022-08-05 17:58     ` [PATCH v3 09/11] log: create log.initialDecorationSet=all Derrick Stolee via GitGitGadget
2022-08-05 17:58     ` [PATCH v3 10/11] maintenance: stop writing log.excludeDecoration Derrick Stolee via GitGitGadget
2022-08-05 17:58     ` [PATCH v3 11/11] fetch: use ref_namespaces during prefetch Derrick Stolee via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c3b14045-01a1-e207-a60d-2e3290ab8001@github.com \
    --to=derrickstolee@github.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=steadmon@google.com \
    --cc=vdye@github.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).