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

Re: [PATCH v2] config: allow ~/ and ~user/ in include.path value

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Apr 25, 2012, 15:53 UTC
Message-ID
<vpqehrbolis.fsf@bauges.imag.fr>
In-Reply-To
<20120425120036.GB21579@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
>  Documentation/config.txt  |    5 ++++-
>  t/t1305-config-include.sh |    8 ++++++++
Nice, thanks.
Show 19 quoted lines
> --- 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/
Previous: Jeff KingNext: Junio C Hamano
Message 4 of 6 in “config: allow ~/ and ~user/ in include.path value”
  1. config: allow ~/ and ~user/ in include.path valueMatthieu Moy, Apr 24, 2012
  2. config: allow ~/ and ~user/ in include.path valueMatthieu Moy, Apr 24, 2012
  3. Jeff KingApr 25, 2012
  4. Matthieu MoyApr 25, 2012
  5. Junio C HamanoApr 25, 2012
  6. Jeff KingApr 26, 2012

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.