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

Re: [RFC] Implementing git config handling in Git.pm

From
Petr Baudis <pasky@suse.cz>
Date
May 20, 2007, 23:14 UTC
Message-ID
<20070520231413.GE4489@pasky.or.cz>
In-Reply-To
<20070520225953.GK4085@planck.djpig.de>
  Hi,
On Mon, May 21, 2007 at 12:59:54AM CEST, Frank Lichtenheld wrote:
Show 13 quoted lines
> Possible Solutions:
>  1) Call git-config.
>    Pro: Easy to implement
>    Contra: Violates at least target 2. Neither git-config --get nor
>    git-config --list offer a complete and safe view on the config
>    file. Just try including = in a subsection name (--list) or newlines in
>    a value (both) to see what I mean.
>  2) Extend git-config to give a machine parsable output and then
>     proceed with solution 1
>    Pro: Still reasonably easy to implement (?). Would benefit
>     other scripts, too.
>    Contra: Neither the fastest nor the most flexible
>     solution.
  Yes, this might be fine for you. The argument for 4 (implementing our
own in Perl) is that we would like it to be _real_ fast for gitweb
(especially the summary page needs to look at each repository). But it
would be a question of a benchmark to look really how much would calling
git-config slow us down. So as at least a proof-of-concept and initial
implementation I think this is more than fine, and we can proceed to
implement our own parser only when it's clearly needed.
Show 5 quoted lines
>  3) Try to use the C code from config.c directly.
>    Pro: Probably the fastest solution due to avoiding the
>     forks.
>    Contra: Probably a bit more complex (any XS experts here?),
>     both to implement and to maintain.
  There was various trouble with XS in the past, and I think the general
feel was that we want to get back to using XS again sometime, but only
when Git will be reasonably libified (to support multiple repositories
at once, etc.).
>  4) Implement an own git config parser in Perl
>    Pro: Might be actually easier than 3 and faster than 2
>    Contra: See target 3
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Ever try. Ever fail. No matter. // Try again. Fail again. Fail better.
		-- Samuel Beckett
Previous: Frank LichtenheldNext: Frank Lichtenheld
Message 2 of 34 in “[RFC] Implementing git config handling in Git.pm”
  1. Frank LichtenheldMay 20, 2007
  2. Petr BaudisMay 20, 2007
  3. config: Add --quoted option to produce machine-parsable outputFrank Lichtenheld, May 21, 2007
  4. Junio C HamanoMay 21, 2007
  5. Johannes SchindelinMay 21, 2007
  6. Junio C HamanoMay 21, 2007
  7. Johannes SchindelinMay 21, 2007
  8. Jan HudecMay 21, 2007
  9. Frank LichtenheldMay 21, 2007
  10. Jakub NarebskiMay 21, 2007
  11. config: Add --null/-z option for null-delimted outputFrank Lichtenheld, Jun 17, 2007
  12. Johannes SchindelinJun 19, 2007
  13. Jakub NarebskiJun 19, 2007
  14. Frank LichtenheldJun 19, 2007
  15. Johannes SchindelinJun 19, 2007
  16. Junio C HamanoJun 19, 2007
  17. Frank LichtenheldJun 19, 2007
  18. Johannes SchindelinJun 19, 2007
  19. David KastrupJun 19, 2007
  20. Jakub NarebskiJun 19, 2007
  21. Frank LichtenheldJun 19, 2007
  22. Johannes SchindelinJun 19, 2007
  23. Frank LichtenheldJun 19, 2007
  24. Johannes SchindelinJun 20, 2007
  25. Jakub NarebskiJun 20, 2007
  26. Jakub NarebskiJun 21, 2007
  27. Frank LichtenheldJun 22, 2007
  28. 1/3 config: Complete documentation of --get-regexpFrank Lichtenheld, Jun 25, 2007
  29. 2/3 config: Change output of --get-regexp for valueless keysFrank Lichtenheld, Jun 25, 2007
  30. Junio C HamanoJun 27, 2007
  31. 3/3 config: Add --null/-z option for null-delimted outputFrank Lichtenheld, Jun 25, 2007
  32. Jakub NarebskiJun 25, 2007
  33. Frank LichtenheldJun 26, 2007
  34. Junio C HamanoJun 27, 2007

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.