Re: [PATCHv7 1/4] Read (but not write) from $XDG_CONFIG_HOME/git/config file

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

 



Huynh Khoi Nguyen Nguyen wrote:
> Git will be able to read from $XDG_CONFIG_HOME/git/config, a new
> configuration file following XDG specification. In the order of
> reading, this file is between global configuration file and system
> wide configuration file. Git currently does not write to this new
> configuration file. If $XDG_CONFIG_HOME is either not set or empty,
> $HOME/.config/git/config will be used.
> 
> Signed-off-by: Huynh Khoi Nguyen Nguyen <Huynh-Khoi-Nguyen.Nguyen@xxxxxxxxxxxxxxx>
> Signed-off-by: Valentin Duperray <Valentin.Duperray@xxxxxxxxxxxxxxx>
> Signed-off-by: Franck Jonas <Franck.Jonas@xxxxxxxxxxxxxxx>
> Signed-off-by: Lucien Kong <Lucien.Kong@xxxxxxxxxxxxxxx>
> Signed-off-by: Thomas Nguy <Thomas.Nguy@xxxxxxxxxxxxxxx>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx>
> ---
>  Documentation/git-config.txt |   12 +++++--
>  builtin/config.c             |   28 +++++++++++-----
>  cache.h                      |    3 ++
>  config.c                     |   23 ++++++++-----
>  path.c                       |   41 ++++++++++++++++++++++++
>  t/t1306-xdg-files.sh         |   70 ++++++++++++++++++++++++++++++++++++++++++
>  6 files changed, 156 insertions(+), 21 deletions(-)
>  create mode 100755 t/t1306-xdg-files.sh

[...]

> diff --git a/path.c b/path.c
> index 6f2aa69..66acd24 100644
> --- a/path.c
> +++ b/path.c
> @@ -87,6 +87,21 @@ char *git_pathdup(const char *fmt, ...)
>  	return xstrdup(path);
>  }
>  
> +char *mkpathdup(const char *fmt, ...)
> +{
> +	char *path;
> +	struct strbuf sb = STRBUF_INIT;
> +	va_list args;
> +
> +	va_start(args, fmt);
> +	strbuf_vaddf(&sb, fmt, args);
> +	va_end(args);
> +	path = xstrdup(cleanup_path(sb.buf));
> +
> +	strbuf_release(&sb);
> +	return path;
> +}
> +

As expected, this version avoids re-introducing the bug on Cygwin.

I tested the series on Cygwin, MinGW and Linux and it passes it's
own tests (t1306-xdg-files.sh) on all platforms. (Well, on MinGW
I had to run it thus:

    $ GIT_TEST_CMP='diff -ub' ./t1306-xdg-files.sh

otherwise the first two tests fail because of CRLF vs LF issues).

Thanks!

ATB,
Ramsay Jones

--
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]