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

[PATCH v1] git rev-list doesn't complain when repo is empty

From
atousa.p@gmail.com <atousa.p@gmail.com>
Date
Nov 25, 2015, 07:00 UTC
Message-ID
<1448434853-7527-1-git-send-email-apahlevan@ieee.org>
In-Reply-To
<CA+izobv6OuAAjnKH5A=vcmJh3yDhWi41WAD-OmVSN2d7P_5SGA@mail.gmail.com>
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
 
 	if (revs.show_notes)
 		die(_("rev-list does not support display of notes"));
-- 
2.4.9 (Apple Git-60)
Previous: Atousa DupratNext: Jeff King
Message 3 of 5 in “Suspected bug on `git -C <rp> rev-list --all` where <rp> has 0 commits”
  1. yacNov 11, 2015
  2. Atousa DupratNov 25, 2015
  3. git rev-list doesn't complain when repo is emptyatousa.p@gmail.com, Nov 25, 2015
  4. Jeff KingNov 25, 2015
  5. Jeff KingNov 25, 2015

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.