git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Pat Thoyts <patthoyts@users.sourceforge.net>,
	git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	msysgit@googlegroups.com
Subject: Re: [msysGit] Re: Pull request for msysGit patches
Date: Tue, 28 Sep 2010 22:01:42 -0400	[thread overview]
Message-ID: <4CA29E06.705@sunshineco.com> (raw)
In-Reply-To: <7vocbhsn03.fsf@alter.siamese.dyndns.org>

Hi Junio,

On 9/28/2010 3:10 PM, Junio C Hamano wrote:
> 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

  parent reply	other threads:[~2010-09-29  2:01 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28  9:46 Pull request for msysGit patches Pat Thoyts
2010-09-28 19:10 ` Junio C Hamano
2010-09-28 21:11   ` [msysGit] " Johannes Sixt
2010-09-29  3:41     ` Junio C Hamano
2010-09-28 21:23   ` Ævar Arnfjörð Bjarmason
2010-09-30 22:15     ` Pat Thoyts
2010-09-30 22:52       ` Ævar Arnfjörð Bjarmason
2010-09-30 23:27       ` Erik Faye-Lund
2010-09-29  2:01   ` Eric Sunshine [this message]
     [not found]     ` <7vbp7hrzhb.fsf@alter.siamese.dyndns.org>
2010-09-29  3:54       ` [msysGit] " Eric Sunshine
2010-09-29 22:22   ` msysGit patches for upstream Pat Thoyts
2010-09-29 23:02     ` Junio C Hamano
2010-09-29 22:22   ` [PATCH 1/2] Make sure that git_getpass() never returns NULL Pat Thoyts
2010-09-29 22:22   ` [PATCH 2/2] Fix typo in pack-objects' usage Pat Thoyts
2010-09-28 20:52 ` [msysGit] Pull request for msysGit patches Johannes Sixt
2010-09-28 20:58   ` Erik Faye-Lund
2010-09-28 21:13     ` Johannes Sixt
2010-09-28 21:20       ` Erik Faye-Lund
2010-09-28 21:35         ` Erik Faye-Lund
2010-09-28 21:08   ` Jonathan Nieder
2010-09-29 17:51     ` Junio C Hamano
2010-09-29 22:29       ` Pat Thoyts
2010-09-29  2:23   ` Eric Sunshine
2010-09-29  3:37     ` Junio C Hamano
2010-09-29  4:17       ` Eric Sunshine
2010-09-30 13:24   ` [PATCH] git-am: fix detection of absolute paths for windows Pat Thoyts
2010-10-01 17:46     ` Johannes Sixt
2010-09-30 13:24       ` Pat Thoyts
2010-11-07 14:56   ` [PATCH v2 0/4] make open/unlink failures user friendly on windows using retry/abort Heiko Voigt
2010-11-07 15:49     ` Johannes Sixt
2010-11-07 17:06       ` Heiko Voigt
2010-11-07 19:11         ` Johannes Sixt
2010-11-07 14:56   ` [PATCH v2 1/4] mingw: move unlink wrapper to mingw.c Heiko Voigt
2010-11-07 14:56   ` [PATCH v2 2/4] mingw: work around irregular failures of unlink on windows Heiko Voigt
2010-11-07 14:56   ` [PATCH v2 3/4] mingw: make failures to unlink or move raise a question Heiko Voigt
2010-11-07 14:56   ` [PATCH v2 4/4] mingw: add fallback for rmdir in case directory is in use Heiko Voigt
2010-09-29  6:11 ` Pull request for msysGit patches yj2133011
2010-09-29 20:48 ` Ramsay Jones

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=4CA29E06.705@sunshineco.com \
    --to=sunshine@sunshineco.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=msysgit@googlegroups.com \
    --cc=patthoyts@users.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).