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

Re: [PATCH] perl: add new module Git::Config for cached 'git config' access

From
SVSam Vilain <samv@catalyst.net.nz>
Date
Apr 8, 2009, 09:50 UTC
Message-ID
<49DC736F.1030007@catalyst.net.nz>
In-Reply-To
<7vbpr7r72w.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 37 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
>
>   
>> Errr... wouldn't it be better to simply use 
>>
>> +		my ($item, $value) = split("\n", $_, 2)
>>
>> here? Have you tested Git::Config with a "null" value, i.e. something
>> like
>>
>>     [section]
>>         noval
>>
>> in the config file (which evaluates to 'true' with '--bool' option)?
>> Because from what I remember from the discussion on the 
>> "git config --null --list" format the lack of "\n" is used to
>> distinguish between noval (which is equivalent to 'true'), and empty
>> value (which is equivalent to 'false')
>>
>>     [boolean
>>         noval        # equivalent to 'true'
>>         empty1 =     # equivalent to 'false'
>>         empty2 = ""  # equivalent to 'false'
>>     
>
> I do not mind if the _write method always wrote out
>
> 	[core]
>         	autocrlf = true
>
> for a variable that is true, but it should be able to read existing
>
> 	[core]
>         	autocrlf
>
> correctly.
>   

Yep - that's what I thought was reasonable behaviour as well and what my submission does.

Show 6 quoted lines
> Sam, I think you meant to make me squash the "Oops, for no good reason,
> here is a fix-up" into the previous one, but for this case, I'd appreciate
> a re-roll of the series, that includes a test to read from an existing
> configuration file that contains such "presense of the name alone means
> boolean true" variables.
>   

Sure, I rebased the series to have the fix-ups at the right places, but didn't think it was an interesting enough change to rate a full re-submission. The series at git://github.com/samv/git branch perl-Config has the minor change put into the place it was introduced. I put a little note to this effect after the --- line.

I'm not quite sure what you want squashed where, maybe just edit the below list to be how you'd like it,

pick d43238e perl: add new module Git::Config for cached 'git config' access pick 5ea135d perl: make Git.pm use new Git::Config module pick b2865bc perl: make Git::Config use --null pick 28eecdc perl: fix no value items in Git::Config

:-)
Sam
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 13 in “perl: add new module Git::Config for cached 'git config' access”
  1. perl: add new module Git::Config for cached 'git config' accessSam Vilain, Apr 5, 2009
  2. perl: make Git.pm use new Git::Config moduleSam Vilain, Apr 5, 2009
  3. Frank LichtenheldApr 6, 2009
  4. Sam VilainApr 6, 2009
  5. Jakub NarebskiApr 7, 2009
  6. Sam VilainApr 8, 2009
  7. Jakub NarebskiApr 8, 2009
  8. Sam VilainApr 8, 2009
  9. Jakub NarebskiApr 8, 2009
  10. Junio C HamanoApr 8, 2009
  11. Sam VilainApr 8, 2009
  12. Junio C HamanoApr 8, 2009
  13. Petr BaudisApr 8, 2009

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.