git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Vajna <vmiklos@frugalware.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	jidanni@jidanni.org, git@vger.kernel.org
Subject: [PATCH] fast-export: print usage when no options specified
Date: Sat,  3 Jan 2009 04:59:12 +0100	[thread overview]
Message-ID: <1230955152-23646-1-git-send-email-vmiklos@frugalware.org> (raw)
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

  reply	other threads:[~2009-01-03  3:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-03  0:52 git-fast-export bundle doc jidanni
2009-01-03  3:59 ` Miklos Vajna [this message]
2009-01-06 19:28   ` [PATCH] fast-export: print usage when no options specified Johannes Schindelin
2009-01-06 20:11     ` Miklos Vajna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1230955152-23646-1-git-send-email-vmiklos@frugalware.org \
    --to=vmiklos@frugalware.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jidanni@jidanni.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).