[RFC] Implementing git config handling in Git.pm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

A week ago or so when I presented my GITCVS::config patch I mentioned
that we should better implement most of it in Git.pm. I would like to
do so but get a bit of input first on how to implement it.

Targets:
 1) We should offer to parse the config only once since that is
   a huge performance gain if the caller wants to use several
   values from it.
 2) The parsing should be complete and safe.
 3) If at all possible, we should not have to implement a
   complete parser in Perl, since that is just needless
   code to maintain.

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.
 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.
 4) Implement an own git config parser in Perl
   Pro: Might be actually easier than 3 and faster than 2
   Contra: See target 3

I would go for solution 2. Any reason to prefer one of the
others (or one I didn't even think of)?

Gruesse,
-- 
Frank Lichtenheld <frank@xxxxxxxxxxxxxx>
www: http://www.djpig.de/
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux