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

Re: [PATCH RESEND] Git.pm: Always set Repository to absolute path if autodetecting

From
Johannes Sixt <j.sixt@viscovery.net>
Date
May 25, 2009, 07:33 UTC
Message-ID
<4A1A49C0.7040102@viscovery.net>
In-Reply-To
<1241703688-6892-2-git-send-email-frank@lichtenheld.de>
Frank Lichtenheld schrieb:
Show 24 quoted lines
> From: Frank Lichtenheld <flichtenheld@astaro.com>
> 
> So far we only set it to absolute paths in some cases which lead
> to problems like wc_chdir not working.
> 
> Signed-off-by: Frank Lichtenheld <flichtenheld@astaro.com>
> ---
>  perl/Git.pm     |    2 +-
>  t/t9700/test.pl |   10 ++--------
>  2 files changed, 3 insertions(+), 9 deletions(-)
> 
> Resent unchanged. There was one comment which I've reponded too and
> argued that it didn't apply and there was no further objections.
> 
> diff --git a/perl/Git.pm b/perl/Git.pm
> index 4313db7..e8df55d 100644
> --- a/perl/Git.pm
> +++ b/perl/Git.pm
> @@ -185,7 +185,7 @@ sub repository {
>  
>  		if ($dir) {
>  			$dir =~ m#^/# or $dir = $opts{Directory} . '/' . $dir;
> -			$opts{Repository} = $dir;
> +			$opts{Repository} = abs_path($dir);

Unfortunately, this change breaks MinGW git because the absolute path that this produces is MSYS-style /c/path/to/repo, but git does not understand this; it should be c:/path/to/repo. This value is ultimately assigned to GIT_DIR, but the path name mangling that usually happens when an MSYS program (like perl) spawns a non-MSYS program (like git) does not happen.

Your commit message is quite vague about the problems that you have seen. I vote to revert this change.

-- Hannes
Previous: Frank LichtenheldNext: Frank Lichtenheld
Message 3 of 7 in “Git.pm: Set GIT_WORK_TREE if we set GIT_DIR”
  1. Git.pm: Set GIT_WORK_TREE if we set GIT_DIRFrank Lichtenheld, May 7, 2009
  2. Git.pm: Always set Repository to absolute path if autodetectingFrank Lichtenheld, May 7, 2009
  3. Johannes SixtMay 25, 2009
  4. Frank LichtenheldMay 27, 2009
  5. Johannes SixtMay 27, 2009
  6. Frank LichtenheldMay 27, 2009
  7. Petr BaudisMay 7, 2009

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.