From: Junio C Hamano Date: Sat, 21 Aug 2010 00:27:27 GMT Subject: Re: [PATCH 3/3] {fetch,upload}-pack: allow --depth=0 for infinite depth Message-ID: <7vr5hs95e8.fsf@alter.siamese.dyndns.org> In-Reply-To: <1282269067-5527-3-git-send-email-pclouds@gmail.com> Nguyễn Thái Ngọc Duy writes: > diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt > index 9333c42..a22d839 100644 > --- a/Documentation/fetch-options.txt > +++ b/Documentation/fetch-options.txt > @@ -10,7 +10,8 @@ > --depth=:: > Deepen the history of a 'shallow' repository created by > `git clone` with `--depth=` option (see linkgit:git-clone[1]) > - by the specified number of commits. > + by the specified number of commits. Specify "inf" for > + infinite depth. > > ifndef::git-pull[] > --dry-run:: > diff --git a/Documentation/git-fetch-pack.txt b/Documentation/git-fetch-pack.txt > index 4a8487c..75e4669 100644 > --- a/Documentation/git-fetch-pack.txt > +++ b/Documentation/git-fetch-pack.txt > @@ -70,6 +70,7 @@ OPTIONS > > --depth=:: > Limit fetching to ancestor-chains not longer than n. > + Specify 0 for infinite depth. > Should we force users to remember which one is which? > diff --git a/transport.c b/transport.c > index cf7030b..9303aef 100644 > --- a/transport.c > +++ b/transport.c > @@ -475,7 +475,7 @@ static int set_git_option(struct git_transport_options *opts, > opts->shallow = 0; > } > else { > - opts->depth = atoi(value); > + opts->depth = !strcmp(value, "inf") ? 0 : atoi(value); Doesn't atoi("inf") give you 0 anyway ;-)?