Skip to contentSkip to conversation

reflog: actually default to subcommand 'show'

PATCH New Michael Schubert 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reflog: actually default to subcommand 'show'

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.

---
 builtin/reflog.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
builtin/reflog.c +1 -2
index ebf610e..3a9c80f 100644
@@ -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);
 }
Signature · 1 line
1.7.6.351.gb35ac