public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>
To: Jeff King <peff@peff•net>
Cc: git@vger•kernel.org, gitster@pobox•com
Subject: Re: [PATCH v2] config: allow ~/ and ~user/ in include.path value
Date: Wed, 25 Apr 2012 17:53:47 +0200	[thread overview]
Message-ID: <vpqehrbolis.fsf@bauges.imag.fr> (raw)
In-Reply-To: <20120425120036.GB21579@sigill.intra.peff.net> (Jeff King's message of "Wed, 25 Apr 2012 08:00:36 -0400")

Jeff King <peff@peff•net> writes:

>  Documentation/config.txt  |    5 ++++-
>  t/t1305-config-include.sh |    8 ++++++++

Nice, thanks.

> --- a/config.c
> +++ b/config.c
> @@ -37,6 +37,11 @@ static int handle_path_include(const char *path, struct config_include_data *inc
>  {
>  	int ret = 0;
>  	struct strbuf buf = STRBUF_INIT;
> +	char *expanded = expand_user_path(path);
> +
> +	if (!expanded)
> +		return error("Could not expand include path '%s'", path);
> +	path = expanded;
>  
>  	/*
>  	 * Use an absolute path as-is, but interpret relative paths
> @@ -63,6 +68,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc
>  		inc->depth--;
>  	}
>  	strbuf_release(&buf);
> +	free(expanded);

Clearly better than my version.

Acked-by: Matthieu Moy <Matthieu.Moy@imag•fr>

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2012-04-25 15:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24 11:08 [PATCH] config: allow ~/ and ~user/ in include.path value Matthieu Moy
2012-04-24 18:33 ` [PATCH v2] " Matthieu Moy
2012-04-25 12:00   ` Jeff King
2012-04-25 15:53     ` Matthieu Moy [this message]
2012-04-25 20:14     ` Junio C Hamano
2012-04-26  6:19       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqehrbolis.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp$(echo .)fr \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox