threads / discuss / 16974

git-fast-export bundle doc

Subject: git-fast-export bundle doc

## tl;dr

4 messages between Jan 3, 2009 and Jan 6, 2009.

replies: 3people: 3as markdown or json

jidanni@jidanni.org· Jan 3, 2009, 00:52 UTC · lore
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· Jan 3, 2009, 03:59 UTC · re: jidanni@jidanni.org · lore

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

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· Jan 6, 2009, 19:28 UTC · re: Miklos Vajna · lore

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

Hi,
On Sat, 3 Jan 2009, Miklos Vajna wrote:
Show 8 quoted lines
> 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· Jan 6, 2009, 20:11 UTC · re: Johannes Schindelin · lore

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

On Tue, Jan 06, 2009 at 08:28:59PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 8 quoted lines
> 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. ;-)
Show 5 quoted lines
> 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.

← back to recent threads