Re: The git spring cleanup challenge

2 messages, 2 authors, 2021-06-03 · open the first message on its own page

Re: The git spring cleanup challenge

From: Junio C Hamano <hidden>
Date: 2021-06-03 00:06:41

Sergey Organov [off-list ref] writes:
quoted
quoted
[push]
	default = simple
This is the default, you don't need it.
Yep, a remnant from the past.
This reminds me of something.

This particular remnant is there because the user was an early
adopter from the days before the 'simple' setting was made the
default, and it is a common pattern in our configuration variable
settings.  We introduce a knob to allow early adopters to experience
new settings, and after a while, one of them may become the default,
and at that point, the setting the user has appears redundant.

If we had a central registry of configuration variables and their
default values (there isn't one), one could write a configuration
linter to point out "you have this set, but it is the default these
days" to remind you, which sometimes may be useful.

I say "sometimes" because the reason why the user has a seemingly
redundant setting may be because the default for the variable in
question is planned to change, and the user has it set to keep the
current default---the opposite of the 'early adopter' use case.

Being reminded may still be useful in such a case, but the linter
tool certainly should not make any change blindly in the name of
removing redundant setting without consulting the user.

Re: The git spring cleanup challenge

From: Felipe Contreras <hidden>
Date: 2021-06-03 00:48:42

Junio C Hamano wrote:
Sergey Organov [off-list ref] writes:
quoted
quoted
quoted
[push]
	default = simple
This is the default, you don't need it.
Yep, a remnant from the past.
This reminds me of something.

This particular remnant is there because the user was an early
adopter from the days before the 'simple' setting was made the
default, and it is a common pattern in our configuration variable
settings.  We introduce a knob to allow early adopters to experience
new settings, and after a while, one of them may become the default,
and at that point, the setting the user has appears redundant.

If we had a central registry of configuration variables and their
default values (there isn't one), one could write a configuration
linter to point out "you have this set, but it is the default these
days" to remind you, which sometimes may be useful.

I say "sometimes" because the reason why the user has a seemingly
redundant setting may be because the default for the variable in
question is planned to change, and the user has it set to keep the
current default---the opposite of the 'early adopter' use case.
Long time ago I proposed a core.mode configuration that would be useful
for this predicament too [1].

When a configuration is planned to change, git_mode = MODE_NEXT would
make the new values the default.

Therefore the linter could do:

  git_mode = MODE_CURRENT;
  git_config_default_get.. &old_default);

  git_mode = MODE_NEXT;
  git_config_default_get.. &new_default);

If the values are the same, that means there's no plans to change the
default, and therefore it's safe to delete the configuration if the user
has the same value.

Cheers.

[1] https://lore.kernel.org/git/1381561485-20252-1-git-send-email-felipe.contreras@gmail.com/

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help