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

Re: [PATCH] daemon, path.c: fix a bug with ~ in repo paths

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 21, 2016, 15:58 UTC
Message-ID
<xmqqlgxhd77u.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CACsJy8AzWqJ_9JQ_BGnAB3E3GrGSTS40z8umbtO6mQJukWOooQ@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 5 quoted lines
> The amount of changes is unbelievable for fixing such a rare case
> though. I wonder if we can just detect this in daemon.c and pass
> "./~foo/bar" instead of "~foo/bar" to enter_repo() in non-strict mode
> to "disable" expand_user_path(). If it works, it's much simpler
> changes (even though a bit hacky)

Conceptually, it ought to be updating the code that says "Does it begin with a tilde? Then try to do user-path expansion and fail if that is not enabled and if it succeeds use the resulting directory" to "Is user-path enabled and does it begin with a tilde? Then try to do user-path expansion and if it succeeds use the resulting directory". Compared to that mental model we have with this codepath, I agree that the change does look quite invasive and large.

It is OK for a change to be large, as long as the end result is easier to read and understand than the original. I am undecided if that is the case with this patch, though.

Also I am a bit worried about the change in the semantics. While it is not the best way to achieve this, the server operators could use it as a way to add directories whose contents need to be hidden to give them names that begin with a tilde without enabling user-path expansion. This change may be a new and useful feature for Luke, but to these server operators this change can be a new bug---it is probably a minor new bug as they can work it around by using other means to hide these directories, though.

Previous: Duy NguyenNext: Junio C Hamano
Message 5 of 7 in “daemon, path.c: fix a bug with ~ in repo paths”
  1. daemon, path.c: fix a bug with ~ in repo pathsLuke Shumaker, Oct 18, 2016
  2. Junio C HamanoOct 18, 2016
  3. Luke ShumakerOct 18, 2016
  4. Duy NguyenOct 19, 2016
  5. Junio C HamanoOct 21, 2016
  6. Junio C HamanoOct 21, 2016
  7. Jeff KingOct 22, 2016

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.