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

Re: [PATCH] Handle double slashes in make_relative_path()

From
Johannes Sixt <j6t@kdbg.org>
Date
Jan 23, 2010, 20:41 UTC
Message-ID
<201001232141.49556.j6t@kdbg.org>
In-Reply-To
<7viqasbmtc.fsf@alter.siamese.dyndns.org>
On Samstag, 23. Januar 2010, Junio C Hamano wrote:
Show 19 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> > I think one issue is what happens when you did this:
> >
> >     cd //server
> >     git --git-dir=//server/repo/repo.git --work-tree=repo
> >
> > Does msysgit implementation figures out that the work tree is located at
> > "//server/repo" when get_git_work_tree() is asked to produce an absolute
> > path so that it can be compared with //server/repo/repo.git with the
> > code? If it does (with the leading double slash), then "doubled slahses
> > fix" is a regression we should do something about it.  If it doesn't,
> > then it probably doesn't matter.
>
> Nah, I wasn't thinking straight.  What happens if you did this?
>
> 	git --git-dir=//git/repo/repo.git --work-tree=/git/repo
>
> where "//git/repo" is on the "git server" and you are working in local
> hierarchy "/git/repo"?

Ah, right, this would not do the right thing. (But I can't verify this claim right now.)

The problem is that /git/repo without a drive prefix is a valid path and it means the path that begins at the same drive that CWD currently is. I would not dismiss this form of paths as too exotic, so we should care about them. OTOH, it can be worked around easily by the user (just insert the drive prefix). Dunno...

-- Hannes
Previous: Junio C HamanoNext: Sverre Rabbelier
Message 11 of 20 in “Handle double slashes in make_relative_path()”
  1. Handle double slashes in make_relative_path()Thomas Rast, Jan 22, 2010
  2. Junio C HamanoJan 22, 2010
  3. Junio C HamanoJan 22, 2010
  4. Johannes SixtJan 22, 2010
  5. Robin RosenbergJan 23, 2010
  6. Johannes SixtJan 23, 2010
  7. Robin RosenbergJan 23, 2010
  8. Johannes SixtJan 23, 2010
  9. Junio C HamanoJan 23, 2010
  10. Junio C HamanoJan 23, 2010
  11. Johannes SixtJan 23, 2010
  12. Sverre RabbelierJan 23, 2010
  13. Thomas RastJan 24, 2010
  14. Bernhard R. LinkJan 24, 2010
  15. Junio C HamanoJan 24, 2010
  16. Johannes SixtJan 24, 2010
  17. Junio C HamanoJan 24, 2010
  18. Robin RosenbergJan 25, 2010
  19. Thomas RastJan 22, 2010
  20. Junio C HamanoJan 22, 2010

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.