Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-11 Thread Junio C Hamano
Duy Nguyen writes: > FWIW I don't have any preference, as long as the variable can still > have a name (that is not a symbol). Same here. > A side question regardless of syntax. What do we do with > %(unrecognized name)/foo? I see three options > > - expand to empty, so "/foo" > - keep it

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-09 Thread Duy Nguyen
On Fri, Nov 9, 2018 at 11:19 AM Jeff King wrote: > > The form `/abc/def` would not be confused with anything > > that it is not, I would think. The only thing against this form (at least > > that I can think of) is that some people use this way to talk about paths > > that vary between different

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-09 Thread Jeff King
On Fri, Nov 09, 2018 at 02:05:48AM +, Joseph Moisan wrote: > Can someone please tell me how to unsubscribe from this email. I am > no longer interested in receiving these emails, and cannot find how to > unsubscribe. Details are at http://vger.kernel.org/vger-lists.html#git. -Peff

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-09 Thread Jeff King
On Thu, Nov 08, 2018 at 04:45:16PM +0100, Johannes Schindelin wrote: > > One thing I had in mind when proposing $VARIABLE is that it opens up a > > namespace for us to expand more things (*) for example $GIT_DIR (from > > ~/.gitconfig). > > > > (*) but in a controlled way, it may look like an

RE: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-08 Thread Joseph Moisan
-Original Message- From: git-ow...@vger.kernel.org [mailto:git-ow...@vger.kernel.org] On Behalf Of Junio C Hamano Sent: Wednesday, November 7, 2018 7:17 PM To: Ramsay Jones Cc: Johannes Schindelin ; Johannes Schindelin via GitGitGadget ; git@vger.kernel.org Subject: Re: [PATCH 1/1] mingw: handle

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-08 Thread Eric Sunshine
On Thu, Nov 8, 2018 at 10:45 AM Johannes Schindelin wrote: > On Thu, 8 Nov 2018, Duy Nguyen wrote: > > One thing I had in mind when proposing $VARIABLE is that it opens up a > > namespace for us to expand more things (*) for example $GIT_DIR (from > > ~/.gitconfig). > > > > (*) but in a

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-08 Thread Johannes Schindelin
Hi Junio, On Thu, 8 Nov 2018, Junio C Hamano wrote: > Johannes Schindelin writes: > > > But now I have a really crazy idea: how about ~~/ssl/certs/ca-bundle.crt? > > The `~` prefix is *already* a reserved character,... > > We would need to prepare for a future where we need yet another >

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-08 Thread Johannes Schindelin
Hi Duy, On Thu, 8 Nov 2018, Duy Nguyen wrote: > On Thu, Nov 8, 2018 at 2:14 PM Johannes Schindelin > wrote: > > > > On Wed, 7 Nov 2018, Jeff King wrote: > > > > > All that said, if we're just interested in allowing this for config, > > > then we already have such a wrapper function:

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-08 Thread Johannes Schindelin
Hi Junio, On Thu, 8 Nov 2018, Junio C Hamano wrote: > Johannes Schindelin writes: > > > On Thu, 8 Nov 2018, Junio C Hamano wrote: > > > >> I am tempted to say "///" might also be such a > >> way, even in the POSIX world, but am not brave enough to do so, as I > >> suspect that may have a

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-08 Thread Junio C Hamano
Johannes Schindelin writes: > But now I have a really crazy idea: how about ~~/ssl/certs/ca-bundle.crt? > The `~` prefix is *already* a reserved character,... We would need to prepare for a future where we need yet another special thing to be expanded, and it will quickly become cryptic if you

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-08 Thread Junio C Hamano
Johannes Schindelin writes: > Hi, > > On Thu, 8 Nov 2018, Junio C Hamano wrote: > >> I am tempted to say "///" might also be such a >> way, even in the POSIX world, but am not brave enough to do so, as I >> suspect that may have a fallout in the Windows world X-<. > > It does. //server/share is

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-08 Thread Duy Nguyen
On Thu, Nov 8, 2018 at 2:14 PM Johannes Schindelin wrote: > > Hi Peff, > > On Wed, 7 Nov 2018, Jeff King wrote: > > > All that said, if we're just interested in allowing this for config, > > then we already have such a wrapper function: git_config_pathname(). > > Good point. I agree that

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-08 Thread Johannes Schindelin
Hi Peff, On Wed, 7 Nov 2018, Jeff King wrote: > All that said, if we're just interested in allowing this for config, > then we already have such a wrapper function: git_config_pathname(). Good point. I agree that `git_config_pathname()` is a better home for this feature than

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-08 Thread Johannes Schindelin
Hi, On Thu, 8 Nov 2018, Junio C Hamano wrote: > I am tempted to say "///" might also be such a > way, even in the POSIX world, but am not brave enough to do so, as I > suspect that may have a fallout in the Windows world X-<. It does. //server/share is the way we refer to UNC paths (AKA network

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Junio C Hamano
Jeff King writes: > I think we would want to carefully think about the call in enter_repo(). > We do not want git-daemon to accidentally expose repositories in > $RUNTIME_PREFIX. > > Looking over the code, I think this is OK. The expansion happens in > enter_repo(), and then we take the path

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Jeff King
On Thu, Nov 08, 2018 at 09:30:15AM +0900, Junio C Hamano wrote: > Jeff King writes: > > > On Wed, Nov 07, 2018 at 10:36:52PM +0100, Johannes Sixt wrote: > > > > All that said, if we're just interested in allowing this for config, > > then we already have such a wrapper function:

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Junio C Hamano
Jeff King writes: > On Wed, Nov 07, 2018 at 10:36:52PM +0100, Johannes Sixt wrote: > > All that said, if we're just interested in allowing this for config, > then we already have such a wrapper function: git_config_pathname(). > > So I don't think it's a big deal to implement it in any of these

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Junio C Hamano
Ramsay Jones writes: >> The cute thing is: your absolute paths would not be moved because we are >> talking about Windows. Therefore your absolute paths would not start with >> a forward slash. > > Ah, sorry, I must have misunderstood a comment in your cover letter: > > The reason is this:

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Jeff King
On Wed, Nov 07, 2018 at 10:36:52PM +0100, Johannes Sixt wrote: > Am 07.11.18 um 21:41 schrieb Jeff King: > > On Wed, Nov 07, 2018 at 07:52:28PM +0100, Johannes Sixt wrote: > > > Do I understand correctly, that you use a leading slash as an indicator to > > > construct a path relative to

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Johannes Sixt
Am 07.11.18 um 21:41 schrieb Jeff King: On Wed, Nov 07, 2018 at 07:52:28PM +0100, Johannes Sixt wrote: Do I understand correctly, that you use a leading slash as an indicator to construct a path relative to system_path(). How about a "reserved" user name? For example, [http] sslcert =

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Jeff King
On Wed, Nov 07, 2018 at 07:52:28PM +0100, Johannes Sixt wrote: > > Okay, now we know everything you find wrong with the current patch. Do you > > have any suggestion how to make it right? I.e. what would you suggest as a > > way to specify in a gitconfig in a portable Git where the certificate >

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Johannes Sixt
Am 07.11.18 um 12:23 schrieb Johannes Schindelin: On Tue, 6 Nov 2018, Johannes Sixt wrote: Am 06.11.18 um 15:53 schrieb Johannes Schindelin via GitGitGadget: Even if a path looks like a POSIX paths, i.e. it starts with a directory separator, but not with drive-letter-colon, it still has a

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Ramsay Jones
On 07/11/2018 11:19, Johannes Schindelin wrote: [snip] >>> Hmm, this doesn't quite fit with the intended use of this >>> function! ;-) (even on windows!) >>> >>> I haven't looked very deeply, but doesn't this affect all >>> absolute paths in the config read by git_config_pathname(), >>> along

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Johannes Schindelin
Hi Hannes, On Tue, 6 Nov 2018, Johannes Sixt wrote: > Am 06.11.18 um 15:53 schrieb Johannes Schindelin via GitGitGadget: > > From: Johannes Schindelin > > > > On Windows, an absolute POSIX path needs to be turned into a Windows > > one. > > If I were picky, I would say that in a pure Windows

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Johannes Schindelin
Hi, On Tue, 6 Nov 2018, Duy Nguyen wrote: > On Tue, Nov 6, 2018 at 3:55 PM Johannes Schindelin via GitGitGadget > wrote: > > > > From: Johannes Schindelin > > > > On Windows, an absolute POSIX path needs to be turned into a Windows > > one. > > > > Signed-off-by: Johannes Schindelin > > --- >

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-07 Thread Johannes Schindelin
Hi, On Wed, 7 Nov 2018, Junio C Hamano wrote: > Ramsay Jones writes: > > > On 06/11/2018 14:53, Johannes Schindelin via GitGitGadget wrote: > >> From: Johannes Schindelin > >> > >> On Windows, an absolute POSIX path needs to be turned into a Windows > >> one. > >> > >> Signed-off-by:

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-06 Thread Junio C Hamano
Ramsay Jones writes: > On 06/11/2018 14:53, Johannes Schindelin via GitGitGadget wrote: >> From: Johannes Schindelin >> >> On Windows, an absolute POSIX path needs to be turned into a Windows >> one. >> >> Signed-off-by: Johannes Schindelin >> --- >> path.c | 5 + >> 1 file changed, 5

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-06 Thread Johannes Sixt
Am 06.11.18 um 15:53 schrieb Johannes Schindelin via GitGitGadget: From: Johannes Schindelin On Windows, an absolute POSIX path needs to be turned into a Windows one. If I were picky, I would say that in a pure Windows application there cannot be POSIX paths to begin with. Even if a path

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-06 Thread Duy Nguyen
On Tue, Nov 6, 2018 at 7:15 PM Ramsay Jones wrote: > >> @@ -709,6 +710,10 @@ char *expand_user_path(const char *path, int > >> real_home) > >> > >> if (path == NULL) > >> goto return_null; > >> +#ifdef __MINGW32__ > >> +if (path[0] == '/') > >> +return

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-06 Thread Duy Nguyen
On Tue, Nov 6, 2018 at 3:55 PM Johannes Schindelin via GitGitGadget wrote: > > From: Johannes Schindelin > > On Windows, an absolute POSIX path needs to be turned into a Windows > one. > > Signed-off-by: Johannes Schindelin > --- > path.c | 5 + > 1 file changed, 5 insertions(+) > > diff

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-06 Thread Ramsay Jones
On 06/11/2018 15:54, Ramsay Jones wrote: > > > On 06/11/2018 14:53, Johannes Schindelin via GitGitGadget wrote: >> From: Johannes Schindelin >> >> On Windows, an absolute POSIX path needs to be turned into a Windows >> one. >> >> Signed-off-by: Johannes Schindelin >> --- >> path.c | 5

Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-06 Thread Ramsay Jones
On 06/11/2018 14:53, Johannes Schindelin via GitGitGadget wrote: > From: Johannes Schindelin > > On Windows, an absolute POSIX path needs to be turned into a Windows > one. > > Signed-off-by: Johannes Schindelin > --- > path.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git

[PATCH 1/1] mingw: handle absolute paths in expand_user_path()

2018-11-06 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin On Windows, an absolute POSIX path needs to be turned into a Windows one. Signed-off-by: Johannes Schindelin --- path.c | 5 + 1 file changed, 5 insertions(+) diff --git a/path.c b/path.c index 34f0f98349..a72abf0e1f 100644 --- a/path.c +++ b/path.c @@ -11,6