Re: [PATCH v3 03/10] config: Make git_config() more flexible

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

 



On Wed, Feb 18, 2009 at 11:13 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Felipe Contreras <felipe.contreras@xxxxxxxxx> writes:
>
>> Currently git_config() returns an error if there is no repo config file
>> available (cwd is not a git repo); it will correctly parse the system
>> and global config files, but still return an error.
>
> Currently it does???
>
> Here is what I get from using the command from master and next:
>
>    $ cd /var/tmp
>    $ ls -d /.git /var/.git /var/tmp/.git /var/tmp/config
>    ls: /.git: No such file or directory
>    ls: /var/.git: No such file or directory
>    ls: /var/tmp/.git: No such file or directory
>    ls: /var/tmp/config: No such file or directory
>    $ git config -l >/dev/null ; echo $?
>    0
>    $ git config alias.co; echo $?
>    checkout
>    0

This patch doesn't alter the behavior of 'git config', it's for
git_config() (the function). At this point cmd_config() will return an
exit code of 0 even if there's an error on git_config() when no
exclusive file is specified.

> I have $HOME/.gitconfig (where the alias comes from) and no system wide
> configuration file.
>
> Also the patch is mistitled.  Whatever you are trying to say about the
> current problem which I do not seem to get, and whatever different
> behaviour from the current one you are trying to implement (which is not
> quite clear from the above log message), it is not about making it more
> flexible.
>
> The patch text suggests you are trying to change the function's exit
> status so the title would be "git-config: report errors correctly in its
> exit status", but it is unspecified in your commit log message what
> definition of "correctly" you are using in this patch.

What I'm trying to do is "Make git_config() don't return an error when
there's no repo config file if there are other config files
available"... I thought there was no short way to say that =/

-- 
Felipe Contreras
--
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