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

Re: [PATCH] remote-hg: fix path when cloning with tilde expansion

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 9, 2013, 21:45 UTC
Message-ID
<7vfvui4jy8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CALWbr2y5H_dfHAFW_qN+j8YtF4F9+VcG8G503hr4YN2Qv69CXA@mail.gmail.com>
Antoine Pelisse <apelisse@gmail.com> writes:
Show 10 quoted lines
> OK, I think I see why you are puzzled.
> ...
> But my issue is when I do that:
>
>     git clone hg::~/my_repo my_new_repo
>
> The clone works successfully by cloning $HOME/my_repo, but then, when
> we try to fix the repo path, we think that ~/my_repo is not an
> absolute path, so we make it absolute: /home/user/~/my_repo which is
> now off. So I'm not able to fetch that remote.

OK, so clone works, but subsequent fetch from the cloned resoitory does not? "git fetch hg::~/my_repo" will still work but the call to "git config" done near the place your patch touches does not store "hg::~/my_repo" because it thinks "~/my_repo" refers to "./~/my_repo" and tries to come up with an absolute path. The patch tries to notice this case and return without rewriting, so that remote.*.url is kept as "hg::~/my_repo".

Assuming that I am following your reasoning so far, I think I can agree with the patch (not that my agreement matters that much, as you seem to be a lot more familiar with this codepath).

Thanks for explaining.
Previous: Antoine PelisseNext: Antoine Pelisse
Message 9 of 20 in “remote-hg: fix path when cloning with tilde expansion”
  1. remote-hg: fix path when cloning with tilde expansionAntoine Pelisse, Aug 5, 2013
  2. Felipe ContrerasAug 5, 2013
  3. Antoine PelisseAug 5, 2013
  4. remote-hg: fix path when cloning with tilde expansionAntoine Pelisse, Aug 9, 2013
  5. Junio C HamanoAug 9, 2013
  6. Antoine PelisseAug 9, 2013
  7. Junio C HamanoAug 9, 2013
  8. Antoine PelisseAug 9, 2013
  9. Junio C HamanoAug 9, 2013
  10. Antoine PelisseAug 9, 2013
  11. Felipe ContrerasAug 9, 2013
  12. Junio C HamanoAug 9, 2013
  13. Felipe ContrerasAug 9, 2013
  14. Junio C HamanoAug 9, 2013
  15. Felipe ContrerasAug 9, 2013
  16. Junio C HamanoAug 10, 2013
  17. Felipe ContrerasAug 10, 2013
  18. Junio C HamanoAug 10, 2013
  19. Felipe ContrerasAug 10, 2013
  20. Antoine PelisseAug 10, 2013

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.