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

Re: The git spring cleanup challenge

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jun 3, 2021, 00:48 UTC
Message-ID
<60b826d968743_184d1720876@natae.notmuch>
In-Reply-To
<xmqqeedj7qwl.fsf@gitster.g>
Junio C Hamano wrote:
Show 27 quoted lines
> Sergey Organov <sorganov@gmail.com> writes:
> 
> >>> [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
Previous: Junio C HamanoNext: Elijah Newren
Message 41 of 55 in “The git spring cleanup challenge”
  1. Felipe ContrerasJun 1, 2021
  2. AndyJun 1, 2021
  3. Felipe ContrerasJun 1, 2021
  4. Đoàn Trần Công DanhJun 1, 2021
  5. Felipe ContrerasJun 1, 2021
  6. Đoàn Trần Công DanhJun 1, 2021
  7. Felipe ContrerasJun 1, 2021
  8. Đoàn Trần Công DanhJun 1, 2021
  9. Felipe ContrerasJun 1, 2021
  10. Đoàn Trần Công DanhJun 2, 2021
  11. Felipe ContrerasJun 2, 2021
  12. Ævar Arnfjörð BjarmasonJun 3, 2021
  13. Felipe ContrerasJun 3, 2021
  14. Sergey OrganovJun 3, 2021
  15. Ævar Arnfjörð BjarmasonJun 3, 2021
  16. Felipe ContrerasJul 2, 2021
  17. Ævar Arnfjörð BjarmasonJul 2, 2021
  18. Felipe ContrerasJul 2, 2021
  19. David AguilarJun 1, 2021
  20. Junio C HamanoJun 1, 2021
  21. Junio C HamanoJun 1, 2021
  22. Felipe ContrerasJun 1, 2021
  23. Johannes SixtJun 2, 2021
  24. Felipe ContrerasJun 2, 2021
  25. Junio C HamanoJun 2, 2021
  26. Felipe ContrerasJun 2, 2021
  27. Đoàn Trần Công DanhJun 2, 2021
  28. Johannes SixtJun 2, 2021
  29. Felipe ContrerasJun 1, 2021
  30. Sergey OrganovJun 2, 2021
  31. Junio C HamanoJun 3, 2021
  32. Sergey OrganovJun 3, 2021
  33. Sergey OrganovJun 1, 2021
  34. Felipe ContrerasJun 1, 2021
  35. Sergey OrganovJun 2, 2021
  36. Felipe ContrerasJun 2, 2021
  37. Sergey OrganovJun 2, 2021
  38. Felipe ContrerasJun 2, 2021
  39. Sergey OrganovJun 2, 2021
  40. Junio C HamanoJun 3, 2021
  41. Felipe ContrerasJun 3, 2021
  42. Elijah NewrenJun 3, 2021
  43. Felipe ContrerasJun 3, 2021
  44. Elijah NewrenJun 3, 2021
  45. Felipe ContrerasJun 3, 2021
  46. Sergey OrganovJun 3, 2021
  47. Bagas SanjayaJun 2, 2021
  48. Felipe ContrerasJun 2, 2021
  49. Ævar Arnfjörð BjarmasonJun 3, 2021
  50. Felipe ContrerasJun 3, 2021
  51. Ævar Arnfjörð BjarmasonJun 3, 2021
  52. Phillip WoodJun 3, 2021
  53. Ævar Arnfjörð BjarmasonJun 3, 2021
  54. Phillip WoodJun 4, 2021
  55. Felipe ContrerasJun 3, 2021

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.