All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH 1/1] mingw: handle absolute paths in expand_user_path()
Date: Tue, 6 Nov 2018 15:54:47 +0000	[thread overview]
Message-ID: <9174a750-3498-c2fc-d7fa-29c1926c95fc@ramsayjones.plus.com> (raw)
In-Reply-To: <2287dd96cf0b9e9e250fdf92a32dcf666510e67d.1541515994.git.gitgitgadget@gmail.com>



On 06/11/2018 14:53, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> On Windows, an absolute POSIX path needs to be turned into a Windows
> one.
> 
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  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 +11,7 @@
>  #include "path.h"
>  #include "packfile.h"
>  #include "object-store.h"
> +#include "exec-cmd.h"
>  
>  static int get_st_mode_bits(const char *path, int *mode)
>  {
> @@ -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 system_path(path + 1);
> +#endif

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 with all 'included config' files?

I am pretty sure that I would not want the absolute paths
in my config file(s) magically 'moved' depending on whether
git has been compiled with 'runtime prefix' support or not!

ATB,
Ramsay Jones

>  	if (path[0] == '~') {
>  		const char *first_slash = strchrnul(path, '/');
>  		const char *username = path + 1;
> 

  reply	other threads:[~2018-11-06 15:54 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 14:53 [PATCH 0/1] mingw: handle absolute paths in expand_user_path() Johannes Schindelin via GitGitGadget
2018-11-06 14:53 ` [PATCH 1/1] " Johannes Schindelin via GitGitGadget
2018-11-06 15:54   ` Ramsay Jones [this message]
2018-11-06 16:10     ` Ramsay Jones
2018-11-06 18:27       ` Duy Nguyen
2018-11-07  1:21     ` Junio C Hamano
2018-11-07 11:19       ` Johannes Schindelin
2018-11-07 17:42         ` Ramsay Jones
2018-11-08  0:16           ` Junio C Hamano
2018-11-08 13:04             ` Johannes Schindelin
2018-11-08 14:43               ` Junio C Hamano
2018-11-08 15:39                 ` Johannes Schindelin
2018-11-09  2:05             ` Joseph Moisan
2018-11-09 10:21               ` Jeff King
2018-11-06 18:24   ` Duy Nguyen
2018-11-07 11:19     ` Johannes Schindelin
2018-11-06 21:32   ` Johannes Sixt
2018-11-07 11:23     ` Johannes Schindelin
2018-11-07 18:52       ` Johannes Sixt
2018-11-07 20:41         ` Jeff King
2018-11-07 21:36           ` Johannes Sixt
2018-11-07 22:03             ` Jeff King
2018-11-08  0:30               ` Junio C Hamano
2018-11-08  1:18                 ` Jeff King
2018-11-08  3:26                   ` Junio C Hamano
2018-11-08 13:11               ` Johannes Schindelin
2018-11-08 14:25                 ` Duy Nguyen
2018-11-08 15:45                   ` Johannes Schindelin
2018-11-08 17:40                     ` Eric Sunshine
2018-11-09 10:19                     ` Jeff King
2018-11-09 16:16                       ` Duy Nguyen
2018-11-12  3:03                         ` Junio C Hamano
2018-11-08 14:47                 ` Junio C Hamano
2018-11-08 15:46                   ` Johannes Schindelin
2021-07-01 16:03 ` [PATCH v2 0/2] " Johannes Schindelin via GitGitGadget
2021-07-01 16:03   ` [PATCH v2 1/2] tests: exercise the RUNTIME_PREFIX feature Johannes Schindelin via GitGitGadget
2021-07-01 16:03   ` [PATCH v2 2/2] expand_user_path(): support specifying paths relative to the runtime prefix Johannes Schindelin via GitGitGadget
2021-07-01 17:42   ` [PATCH v2 0/2] mingw: handle absolute paths in expand_user_path() Junio C Hamano
2021-07-24 22:06   ` [PATCH v3 0/5] " Johannes Schindelin via GitGitGadget
2021-07-24 22:06     ` [PATCH v3 1/5] tests: exercise the RUNTIME_PREFIX feature Johannes Schindelin via GitGitGadget
2021-07-24 22:06     ` [PATCH v3 2/5] expand_user_path(): remove stale part of the comment Johannes Schindelin via GitGitGadget
2021-07-24 22:06     ` [PATCH v3 3/5] expand_user_path(): clarify the role of the `real_home` parameter Johannes Schindelin via GitGitGadget
2021-07-24 22:06     ` [PATCH v3 4/5] Use a better name for the function interpolating paths Johannes Schindelin via GitGitGadget
2021-07-26 22:05       ` Junio C Hamano
2021-07-27  7:57         ` Fabian Stelzer
2021-07-27 22:56           ` Junio C Hamano
2021-07-28  0:14             ` Junio C Hamano
2021-07-28  0:39               ` Junio C Hamano
2021-07-28  5:43                 ` Junio C Hamano
2021-07-28  8:18                   ` Fabian Stelzer
2021-07-28 17:08                     ` Junio C Hamano
2021-07-24 22:06     ` [PATCH v3 5/5] interpolate_path(): allow specifying paths relative to the runtime prefix Johannes Schindelin via GitGitGadget
2021-07-26 17:56     ` [PATCH v3 0/5] mingw: handle absolute paths in expand_user_path() Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9174a750-3498-c2fc-d7fa-29c1926c95fc@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.