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

[PATCH] fast-export: print usage when no options specified

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jan 3, 2009, 03:59 UTC
Message-ID
<1230955152-23646-1-git-send-email-vmiklos@frugalware.org>
In-Reply-To
<87r63lus6k.fsf@jidanni.org>
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---

I found that behaviour surprising as well when I saw it the first time. git rev-list outputs some usage info in that case, git log just logs HEAD. Given that unconditionally exporting HEAD with no arguments is probably not something most users want, here is a patch to make the behaviour like what git rev-list already has.

 builtin-fast-export.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/builtin-fast-export.c b/builtin-fast-export.c
index 8386338..e9ee2c7 100644
--- a/builtin-fast-export.c
+++ b/builtin-fast-export.c
@@ -497,6 +497,9 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
 		OPT_END()
 	};
 
+	if (argc == 1)
+		usage_with_options (fast_export_usage, options);
+
 	/* we handle encodings */
 	git_config(git_default_config, NULL);
 
-- 
1.6.1
Previous: jidanni@jidanni.orgNext: Johannes Schindelin
Message 2 of 4 in “git-fast-export bundle doc”
  1. jidanni@jidanni.orgJan 3, 2009
  2. fast-export: print usage when no options specifiedMiklos Vajna, Jan 3, 2009
  3. Johannes SchindelinJan 6, 2009
  4. Miklos VajnaJan 6, 2009

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.