git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: "Andrés G. Aragoneses" <knocte@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Duy Nguyen <pclouds@gmail.com>
Subject: Re: [PATCHv4] transport: Catch non positive --depth option value
Date: Tue, 26 Nov 2013 11:09:02 -0800	[thread overview]
Message-ID: <20131126190902.GB4212@google.com> (raw)
In-Reply-To: <529488D5.80605@gmail.com>

Hi,

Thanks for tackling this.  This review will be kind of nitpicky, as a
way to save time when reviewing future patches.

Andrés G. Aragoneses wrote:

> From 4f3b24379090b7b69046903fba494f3191577b20 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= <knocte@gmail.com>
> Date: Tue, 26 Nov 2013 12:38:19 +0100
> Subject: [PATCH] transport: Catch non positive --depth option value

These lines are redundant next to the mail header, so they can and
should be omitted to avoid some noise.

> Instead of simply ignoring the value passed to --depth
> option when it is zero or negative, now it is caught
> and reported.

Nit: commit messages usually give a command to the codebase, like
this:

	When the value passed to --depth is zero or negative, instead of
	treating it as infinite depth, catch and report the mistake.

> This will let people know that they were using the
> option incorrectly (as depth<0 should be simply invalid,
> and under the hood depth==0 didn't have any effect).

Ok.  Do we know that no one was using --depth=0 this way deliberately?

> (The change in fetch.c is needed to avoid the tests
> failing because of this new restriction.)

Based on the surrounding thread I see that you're talking about the
test script t5500 here.  Which test failed?  How does it use "git
fetch"?  Does the change just fix the test but keep in broken in
production, or does it fix "git fetch" in production, too?

> Signed-off-by: Andres G. Aragoneses <knocte@gmail.com>
> Reviewed-by: Duy Nguyen <pclouds@gmail.com>
> ---
>  builtin/fetch.c | 2 +-
>  transport.c     | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)

It would be nice to have a brief test to demonstrate the fix and make
sure we don't break it in the future.  "grep fetch.*--depth t/*.sh"
tells me t5500 would be a good place to put it.  For example,
something like

	test_expect_success 'fetch catches invalid --depth values' '
		(
			cd shallow &&
			test_must_fail git fetch --depth=0 &&
			test_must_fail git fetch --depth=-2 &&
			test_must_fail git fetch --depth= &&
			test_must_fail git fetch --depth=nonsense
		)
	'

What do you think?
Jonathan

  reply	other threads:[~2013-11-26 19:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 16:06 [PATCH] transport: Catch non positive --depth option value "Andrés G. Aragoneses"
2013-11-16  2:58 ` Duy Nguyen
2013-11-18 16:51 ` Junio C Hamano
2013-11-18 22:45   ` [PATCHv2] " "Andrés G. Aragoneses"
2013-11-19 17:15     ` Junio C Hamano
2013-11-21 15:27       ` [PATCHv3] " "Andrés G. Aragoneses"
2013-11-21 17:34         ` Junio C Hamano
2013-11-21 20:18         ` Junio C Hamano
2013-11-22  1:18           ` Duy Nguyen
2013-11-25 23:34             ` "Andrés G. Aragoneses"
2013-11-26  3:06               ` Duy Nguyen
2013-11-26 10:43                 ` "Andrés G. Aragoneses"
2013-11-26 11:09                   ` Duy Nguyen
2013-11-26 11:41                     ` [PATCHv4] " "Andrés G. Aragoneses"
2013-11-26 19:09                       ` Jonathan Nieder [this message]
2013-11-26 22:19                       ` 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=20131126190902.GB4212@google.com \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=knocte@gmail.com \
    --cc=pclouds@gmail.com \
    /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).