# git-fast-export bundle doc

4 messages from 2009-01-03 to 2009-01-06. Participants: jidanni@jidanni.org, Miklos Vajna, Johannes Schindelin.
Thread: https://gitlist.dev/t/16974

## jidanni@jidanni.org, 2009-01-03 00:52

Subject: git-fast-export bundle doc
Message-ID: <87r63lus6k.fsf@jidanni.org>
URL: https://gitlist.dev/e/87r63lus6k.fsf%40jidanni.org

```
Please improve git-fast-export.txt. It says

       This program dumps the given revisions in a form suitable to be
       piped into git-fast-import.

<revlist> isn't mentioned in the SYNOPSIS.
And there is no hyperlink to the git-fast-import man page, nor in SEE ALSO.)

       You can use it as a human readable bundle replacement (see
       git-bundle(1))

But I tried it and there are apparently a few steps not mentioned that
are needed after git-fast-import before you can actually see the files
again on the other side of the sneakernet.

I used --all, which is in EXAMPLES but not OPTIONS.

Else nothing happens and no error is caught:
$ git fast-export
$

Also the git-bundle man page should SEE ALSO git-fast-export and maybe
even git-fast-import, which itself makes no mention of git-fast-export.

```

## Miklos Vajna, 2009-01-03 03:59

Subject: [PATCH] fast-export: print usage when no options specified
Message-ID: <1230955152-23646-1-git-send-email-vmiklos@frugalware.org>
URL: https://gitlist.dev/e/1230955152-23646-1-git-send-email-vmiklos%40frugalware.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

```

## Johannes Schindelin, 2009-01-06 19:28

Subject: Re: [PATCH] fast-export: print usage when no options specified
Message-ID: <alpine.DEB.1.00.0901062023100.30769@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0901062023100.30769%40pacific.mpi-cbg.de
In-Reply-To: <1230955152-23646-1-git-send-email-vmiklos@frugalware.org>

```
Hi,

On Sat, 3 Jan 2009, Miklos Vajna wrote:

> 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.

Maybe this should be part of the commit message?

-- snip --
Some people find it surprising that fast-export does not output a usage 
when called without parameters, as rev-list does.

This assumes that a user usually does not want to export HEAD by default.
-- snap --

However, I have to say that I would find exporting HEAD a rather sensible 
default.

But I am not _that_ strongly opposed to the patch.  Just would like to 
hear some opinions first.

Ciao,
Dscho

```

## Miklos Vajna, 2009-01-06 20:11

Subject: Re: [PATCH] fast-export: print usage when no options specified
Message-ID: <20090106201126.GJ21154@genesis.frugalware.org>
URL: https://gitlist.dev/e/20090106201126.GJ21154%40genesis.frugalware.org
In-Reply-To: <alpine.DEB.1.00.0901062023100.30769@pacific.mpi-cbg.de>

```
On Tue, Jan 06, 2009 at 08:28:59PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Maybe this should be part of the commit message?
> 
> -- snip --
> Some people find it surprising that fast-export does not output a usage 
> when called without parameters, as rev-list does.
> 
> This assumes that a user usually does not want to export HEAD by default.
> -- snap --

OK, if this is the only problem, I can resend it with this included. ;-)

> However, I have to say that I would find exporting HEAD a rather sensible 
> default.
> 
> But I am not _that_ strongly opposed to the patch.  Just would like to 
> hear some opinions first.

According to man git, fast-export is not a plumbing, though I think most
user won't type it manually multiple times, they'll write a script, that
checks if there is something to convert, then run git fast-export | foo
fast-import, so it's really like plumbing. That's why I found the
rev-list-like behaviour more logical.

However, I think defaulting to HEAD is still better than the current
situation, so if that's the consensus, I'm fine with that as well.

```
