Re: [PATCH 5/5] git-daemon support for user-relative paths.
- From
Junio C Hamano <junkio@cox.net>
- Date
- Nov 18, 2005, 21:13 UTC
- Message-ID
- <7viruphd6v.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <437DAA66.6070301@op5.se>
Andreas Ericsson <ae@op5.se> writes:
Show 14 quoted lines
>>>-static int upload(char *dir)
>>>-{
>>>- /* Try paths in this order */
>>>- static const char *paths[] = { "%s", "%s/.git", "%s.git", "%s.git/.git", NULL };
>
>...
>
>> Under strict-path, I think not doing any DWIM like this is fine,
>> but otherwise I suspect changing this would break existing
>> remotes/origin file people may have. In addition enter_repo()
>> as posted does its own DWIM to chdir to ".git" unconditionally
>> as I pointed out...
>
> DWIM? That's an acronym I don't know."Do what I mean". It lets users say:
git clone git://sample.xz/pub/uemacs uemacs
when the repository on the server side is at any of the following places:
/pub/uemacs
-- a regular naked repository, with subdirectories
/pub/uemacs/refs and /pub/uemacs/objects/, obviously./pub/uemacs/.git
-- /pub/uemacs is an ordinary repository with possibly a
working tree; has /pub/uemacs/.git/refs and friends./pub/uemacs.git
-- when above two do not exist but this does; a regular naked repository, with subdirectories /pub/uemacs.git/refs and friends.
/pub/uemacs.git/.git
-- no /pub/uemacs, and /pub/uemacs.git is an ordinary
repository with possibly a working tree; has
/pub/uemacs.git/.git/refs and friends.which is a nice feature, but under --strict-path we need to be careful that we apply whitelist correctly while allowing DWIM.