Re: [PATCH v1] git rev-list doesn't complain when repo is empty
- From
Jeff King <peff@peff.net>
- Date
- Nov 25, 2015, 09:10 UTC
- Message-ID
- <20151125091010.GD4696@sigill.intra.peff.net>
- In-Reply-To
- <1448434853-7527-1-git-send-email-apahlevan@ieee.org>
On Tue, Nov 24, 2015 at 11:00:53PM -0800, atousa.p@gmail.com wrote:
Show 17 quoted lines
> From: Atousa Pahlevan Duprat <apahlevan@ieee.org> > > Signed-off-by: Atousa Pahlevan Duprat <apahlevan@ieee.org> > --- > builtin/rev-list.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/builtin/rev-list.c b/builtin/rev-list.c > index d80d1ed..f71b87f 100644 > --- a/builtin/rev-list.c > +++ b/builtin/rev-list.c > @@ -348,7 +348,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) > (!(revs.tag_objects || revs.tree_objects || revs.blob_objects) && > !revs.pending.nr)) || > revs.diff) > - usage(rev_list_usage); > + return 0; // empty repo
Even if we were to agree that rev-list should exit with code 0 for "git rev-list --all" in an empty repo, I do not think this patch is the right way to do it. It also catches:
git rev-list
with no arguments in a non-empty repository, which should produce a usage() message.
-Peff