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

Re: The git spring cleanup challenge

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 2, 2021, 11:43 UTC
Message-ID
<87zgv59bm8.fsf@evledraar.gmail.com>
In-Reply-To
<60dee69fb7cc7_2964b208fb@natae.notmuch>
On Fri, Jul 02 2021, Felipe Contreras wrote:
Show 42 quoted lines
> Ævar Arnfjörð Bjarmason wrote:
>> On Thu, Jun 03 2021, Felipe Contreras wrote:
>> > Ævar Arnfjörð Bjarmason wrote:
>
>> >> We could then just extend the include syntax rather easily to include
>> >> "libraries", which would be like the current include.path, but would
>> >> understand a library:: prefix (better name bikeshedding welcome). We'd
>> >> then just ship these in /usr/share/git-core/config/includes or whatever,
>> >> e.g. /usr/share/git-core/config/includes/aliases/svn-like.cfg
>> >
>> > I wouldn't be against some some suggested defaults, but *in addition* to
>> > some hardcoded default aliases that are documented.
>> 
>> I'm talking about in terms of the flexibility of implementation of
>> on-by-default defaults. We could implement it as I suggested and then
>> just have a core.defaultIncludes, which would by default be set to
>> git::aliases/svn-like.cfg or whatever, i.e. equivalent to:
>> 
>>     [core]
>>     defaultIncludes = "git::default.cfg"
>> 
>> Which itself would include a
>> /usr/share/git-core/config/includes/default.cfg which would do:
>
> I really gave this a try, but the problem is that git doesn't even have
> a stardard location to install shared files.
>
> I started with $sharedir, but that's not git-specific. Then I added
> $gitsharedir which required a bunch of changes to the Makefile, and
> eventually I decided against it.
>
> We don't have standard location for shared files. Period.
>
>> In a way this is total bikeshedding, I just think it's worth doing it
>> this way up-front.
>
> Yes, maybe so, but git infraestructure is completely unprepared for that
> (at this point).
>
> So I just decied to hard-code them [1]
>
> [1] https://lore.kernel.org/git/20210702100506.1422429-1-felipe.contreras@gmail.com/

FWIW I only saw this reply after I replied in that thread ... referencing this one.

I haven't tried, but I'd think it wouldn't be a big change. You're injecting alias.* config directly, you could just inject an include.path=* in the relevant part of the config machinery instead.

We'd need a new verb like gitdir:* and onbranch:*, maybe system:* or git:*, we'd then search system:foo.cfg for those relative to our libexec or /usr/share data, e.g. /usr/lib/git-core/config/foo.cfg

We could then carry those in includes/* in the git.git repo, and to address the "let's make sure they're there" have a trivial build step like the command-list.h to build those into a C object. I.e. dog-food on our own build process and run `git config -f <file> -l -z` for each one, munge that and spew it into a *.c file. I.e. include/aliases/svn-like.cfg or whatever.

Then when we can't find a system:* (or whatever it's called) handle_path_include() we'd consult that list of fallbacks.

I'm not saying it's trivial, just that I think in practice building consensus for a "one blessed list of hardcoded aliases" is going to be a very tough sell, and making it optional/configurable/pluggable might make that sell a lot easier.

Previous: Felipe ContrerasNext: Felipe Contreras
Message 17 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.