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

[PATCH] reflog: actually default to subcommand 'show'

From
MSMichael Schubert <mschub@elegosoft.com>
Date
Aug 1, 2011, 11:20 UTC
Message-ID
<4E368C0A.7020901@elegosoft.com>
The reflog manpage says:
	git reflog [show] [log-options] [<ref>]

the subcommand 'show' is the default "in the absence of any subcommands". Currently this is only true if the user provided either at least one option or no additional argument at all. For example:

	git reflog master

won't work. Change this by actually calling cmd_log_reflog in absence of any subcommand.

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
---
 builtin/reflog.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/builtin/reflog.c b/builtin/reflog.c
index ebf610e..3a9c80f 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -777,6 +777,5 @@ int cmd_reflog(int argc, const char **argv, const char *prefix)
 	if (!strcmp(argv[1], "delete"))
 		return cmd_reflog_delete(argc - 1, argv + 1, prefix);
 
-	/* Not a recognized reflog command..*/
-	usage(reflog_usage);
+	return cmd_log_reflog(argc, argv, prefix);
 }
-- 
1.7.6.351.gb35ac
Message 1 of 1 in “reflog: actually default to subcommand 'show'”
  1. reflog: actually default to subcommand 'show'Michael Schubert, Aug 1, 2011

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.