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

[PATCH] format-patch: print format-patch usage if there are no arguments

From
Alexander Kuleshov <kuleshovmail@gmail.com>
Date
Jan 13, 2015, 17:54 UTC
Message-ID
<1421171662-12164-1-git-send-email-kuleshovmail@gmail.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 builtin/log.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/builtin/log.c b/builtin/log.c
index ad3cfd8..4431b50 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1246,6 +1246,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		OPT_END()
 	};
 
+	/* We need at least one revision */
+	if (argc == 1)
+		usage_with_options(builtin_format_patch_usage, builtin_format_patch_options);
+
 	extra_hdr.strdup_strings = 1;
 	extra_to.strdup_strings = 1;
 	extra_cc.strdup_strings = 1;
-- 
2.3.0.rc0.239.g0ae1f56.dirty
Next: Junio C Hamano
Message 1 of 10 in “format-patch: print format-patch usage if there are no arguments”
  1. format-patch: print format-patch usage if there are no argumentsAlexander Kuleshov, Jan 13, 2015
  2. Junio C HamanoJan 13, 2015
  3. Alexander KuleshovJan 13, 2015
  4. Junio C HamanoJan 13, 2015
  5. Stefan BellerJan 13, 2015
  6. Junio C HamanoJan 13, 2015
  7. Jeff KingJan 13, 2015
  8. Stefan BellerJan 13, 2015
  9. my hacky mutt-specific format-patch workflowJeff King, Jan 14, 2015
  10. Junio C HamanoJan 13, 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.