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

Re: [msysGit] Re: Pull request for msysGit patches

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Sep 29, 2010, 02:01 UTC
Message-ID
<4CA29E06.705@sunshineco.com>
In-Reply-To
<7vocbhsn03.fsf@alter.siamese.dyndns.org>
Hi Junio,
On 9/28/2010 3:10 PM, Junio C Hamano wrote:
Show 29 quoted lines
> Pat Thoyts<patthoyts@users.sourceforge.net>  writes:
>> Junio,
>> The msysGit tree currently tracks some 50+ patches on top of 'next'. I
>> have gathered 42 of these that look good to move upstream.
>
> A quick and superficial review follows.
> ----------------------------------------------------------------
> abspath.c
>
> @@ -108,10 +108,15 @@ const char *make_nonrelative_path(const char *path)
>   		if (strlcpy(buf, path, PATH_MAX)>= PATH_MAX)
>   			die("Too long path: %.*s", 60, path);
>   	} else {
> +		size_t len;
> +		const char *fmt;
>   		const char *cwd = get_pwd_cwd();
>   		if (!cwd)
>   			die_errno("Cannot determine the current working directory");
> -		if (snprintf(buf, PATH_MAX, "%s/%s", cwd, path)>= PATH_MAX)
> +		len = strlen(cwd);
> +		/* For cwd c:/, return c:/foo rather than URL-like c://foo */
>
> For the patch to be regression free, the logic described by this comment
> requires get_pwd_cmd() to return a string with trailing dir-sep only at
> slash.  IOW, if you see any non-root path returned with a trailing dir-sep
> for whatever reason, you are changing the behaviour in that case as well,
> and that clearly is not "fix at the root level".
> But if you label this as "avoid duplicated dir-sep", everything flows
> smoothly ;-).

I am the author of this patch. Do I understand correctly that your primary concern is that you find the comment misleading? I consider the code

   fmt = (len > 0 && is_dir_sep(cwd[len-1])) ? "%s%s" : "%s/%s";

sufficiently self-documenting that the comment is superfluous, and would be happy to remove the comment. Would you prefer the patch submitted with the comment removed?

-- ES
Previous: Erik Faye-LundNext: Pat Thoyts
Message 9 of 38 in “Pull request for msysGit patches”
  1. Pat ThoytsSep 28, 2010
  2. Junio C HamanoSep 28, 2010
  3. Johannes SixtSep 28, 2010
  4. Junio C HamanoSep 29, 2010
  5. Ævar Arnfjörð BjarmasonSep 28, 2010
  6. Pat ThoytsSep 30, 2010
  7. Ævar Arnfjörð BjarmasonSep 30, 2010
  8. Erik Faye-LundSep 30, 2010
  9. Eric SunshineSep 29, 2010
  10. msysGit patches for upstreamPat Thoyts, Sep 29, 2010
  11. Junio C HamanoSep 29, 2010
  12. 1/2 Make sure that git_getpass() never returns NULLPat Thoyts, Sep 29, 2010
  13. 2/2 Fix typo in pack-objects' usagePat Thoyts, Sep 29, 2010
  14. Johannes SixtSep 28, 2010
  15. Erik Faye-LundSep 28, 2010
  16. Johannes SixtSep 28, 2010
  17. Erik Faye-LundSep 28, 2010
  18. Erik Faye-LundSep 28, 2010
  19. Jonathan NiederSep 28, 2010
  20. Junio C HamanoSep 29, 2010
  21. Pat ThoytsSep 29, 2010
  22. Eric SunshineSep 29, 2010
  23. Junio C HamanoSep 29, 2010
  24. Eric SunshineSep 29, 2010
  25. git-am: fix detection of absolute paths for windowsPat Thoyts, Sep 30, 2010
  26. Johannes SixtOct 1, 2010
  27. git-am: fix detection of absolute paths for windowsPat Thoyts, Sep 30, 2010
  28. 0/4 make open/unlink failures user friendly on windows using retry/abortHeiko Voigt, Nov 7, 2010
  29. 1/4 mingw: move unlink wrapper to mingw.cHeiko Voigt, Nov 7, 2010
  30. 2/4 mingw: work around irregular failures of unlink on windowsHeiko Voigt, Nov 7, 2010
  31. 3/4 mingw: make failures to unlink or move raise a questionHeiko Voigt, Nov 7, 2010
  32. 4/4 mingw: add fallback for rmdir in case directory is in useHeiko Voigt, Nov 7, 2010
  33. Johannes SixtNov 7, 2010
  34. Heiko VoigtNov 7, 2010
  35. Johannes SixtNov 7, 2010
  36. yj2133011Sep 29, 2010
  37. Ramsay JonesSep 29, 2010
  38. Eric SunshineSep 29, 2010

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.