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

Re: Handling of paths

From
Jeff King <peff@peff.net>
Date
Jul 24, 2017, 16:52 UTC
Message-ID
<20170724165221.2biudhpfyyp5ytfc@sigill.intra.peff.net>
In-Reply-To
<xmqq1sp9izy2.fsf@gitster.mtv.corp.google.com>
On Fri, Jul 21, 2017 at 08:15:17AM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> In general, I (and other experienced reviewers here) prefer to give
> chances to people who are new to the Git development community and
> are inclined to do so to scratch their own itch, by giving analysis
> of the problem and a suggested route to solve it, but without giving
> the final solution in a patch form.  After all, many developers
> (including me) started from small changes before getting involved
> more deeply to the project and starting to play more important
> roles.

This is a good point, and I should remember to do it more, too. It's often faster to do a small patch yourself than to help walk a first-timer through it, but keeping the community healthy is an important step.

At any rate, your patch to use config_pathname() looks like the right thing to me.

Show 9 quoted lines
> Having said all that, I suspect that your original problem
> description might point at another thing we may want to look into.
> 
> The patch under discussion may have solved the "~[username]/" prefix
> issue, but I offhand am not sure if a path-like variable that holds
> a relative path behaves sensibly when they appear in configuration
> files and in a file that has configuration snippets that is included
> with the "[include] path=..." thing, and if there is a need to clarify
> and/or update the rules.

The "[include]path" behavior is intentional and documented: it takes the path relative to the including file. I think that would be a reasonable behavior for path-like variables in general (and a path-like variable in an included file would be relative to that included file; this should Just Work because the include mechanism keeps a stack of files).

I could probably sketch out a patch, but per the above discussion I'll leave it for now. Also, I'm lazy. ;)

-Peff
Previous: Junio C Hamano
Message 8 of 8 in “Handling of paths”
  1. Victor ToniJul 19, 2017
  2. Junio C HamanoJul 20, 2017
  3. Charles BaileyJul 20, 2017
  4. Junio C HamanoJul 20, 2017
  5. Charles BaileyJul 20, 2017
  6. Victor ToniJul 20, 2017
  7. Junio C HamanoJul 21, 2017
  8. Jeff KingJul 24, 2017

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.