From: Junio C Hamano <hidden> Date: 2016-06-15 22:47:06
Geoffrey Irving [off-list ref] writes:
quoted hunk
@@ -504,6 +508,8 @@ int cmd_fast_export(int argc, const char **argv,
const char *prefix)
"Import marks from this file"),
OPT_BOOLEAN(0, "fake-missing-tagger", &fake_missing_tagger,
"Fake a tagger when tags lack one"),
+ OPT_BOOLEAN(0, "no-data", &no_data,
+ "Skip output of blob data"),
Shouldn't this be --[no-]data option that defaults to true? Otherwise you
would accept --no-no-data that looks silly.
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:47:06
Hi,
On Sat, 25 Jul 2009, Junio C Hamano wrote:
Geoffrey Irving [off-list ref] writes:
quoted
@@ -504,6 +508,8 @@ int cmd_fast_export(int argc, const char **argv,
const char *prefix)
"Import marks from this file"),
OPT_BOOLEAN(0, "fake-missing-tagger", &fake_missing_tagger,
"Fake a tagger when tags lack one"),
+ OPT_BOOLEAN(0, "no-data", &no_data,
+ "Skip output of blob data"),
Shouldn't this be --[no-]data option that defaults to true? Otherwise you
would accept --no-no-data that looks silly.
On Sat, Jul 25, 2009 at 1:44 PM, Johannes
Schindelin[off-list ref] wrote:
Hi,
On Sat, 25 Jul 2009, Junio C Hamano wrote:
quoted
Geoffrey Irving [off-list ref] writes:
quoted
@@ -504,6 +508,8 @@ int cmd_fast_export(int argc, const char **argv,
const char *prefix)
"Import marks from this file"),
OPT_BOOLEAN(0, "fake-missing-tagger", &fake_missing_tagger,
"Fake a tagger when tags lack one"),
+ OPT_BOOLEAN(0, "no-data", &no_data,
+ "Skip output of blob data"),
Shouldn't this be --[no-]data option that defaults to true? Otherwise you
would accept --no-no-data that looks silly.
Not quite. That produces
usage: git fast-export [rev-list-opts]
--progress <n> show progress after <n> objects
--signed-tags <mode> select handling of signed tags
--export-marks <FILE>
Dump marks to this file
--import-marks <FILE>
Import marks from this file
--fake-missing-tagger
Fake a tagger when tags lack one
--data Skip output of blob data
I don't see similar uses of OPT_NEGBIT, so maybe the necessary option
case hasn't been written yet (or I'm missing something obvious)?
Geoffrey
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:47:06
Hi,
On Mon, 27 Jul 2009, Geoffrey Irving wrote:
On Sat, Jul 25, 2009 at 1:44 PM, Johannes
Schindelin[off-list ref] wrote:
quoted
On Sat, 25 Jul 2009, Junio C Hamano wrote:
quoted
Geoffrey Irving [off-list ref] writes:
quoted
@@ -504,6 +508,8 @@ int cmd_fast_export(int argc, const char **argv,
const char *prefix)
"Import marks from this file"),
OPT_BOOLEAN(0, "fake-missing-tagger", &fake_missing_tagger,
"Fake a tagger when tags lack one"),
+ OPT_BOOLEAN(0, "no-data", &no_data,
+ "Skip output of blob data"),
Shouldn't this be --[no-]data option that defaults to true?
Otherwise you would accept --no-no-data that looks silly.
Not quite. That produces
usage: git fast-export [rev-list-opts]
--progress <n> show progress after <n> objects
--signed-tags <mode> select handling of signed tags
--export-marks <FILE>
Dump marks to this file
--import-marks <FILE>
Import marks from this file
--fake-missing-tagger
Fake a tagger when tags lack one
--data Skip output of blob data
I don't see similar uses of OPT_NEGBIT, so maybe the necessary option
case hasn't been written yet (or I'm missing something obvious)?
There is an ugly solution:
{ OPTION_NEGBIT, 0, "no-data", &no_data, NULL, NULL,
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 0 },
{ OPTION_BIT, 0, "no-data", NULL, NULL,
"Skip output of blob data",
PARSE_OPT_NOARG, NULL, 1 },
and there is a more elegant solution:
[PATCH] parse-opt: optionally show "--no-" option string
It is usually better to have positive options, to avoid confusing double
negations. However, sometimes it is desirable to show the negative option
in the help.
Introduce the flag PARSE_OPT_NEGHELP to do that.
Signed-off-by: Johannes Schindelin <redacted>
---
parse-options.c | 6 ++++--
parse-options.h | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)
When using git fast-export and git fast-import to rewrite the history
of a repository with large binary files, almost all of the time is
spent dealing with blobs. This is extremely inefficient if all we want
to do is rewrite the commits and tree structure. --no-data skips the
output of blobs and writes SHA-1s instead of marks, which provides a
massive speedup.
Signed-off-by: Geoffrey Irving <redacted>
---
Here's my modified patch on top of Johannes' fix to parse-options. On github:
http://github.com/girving/git/commit/98549f6809a4dc22d088f3c2ee1f798e858cce3ehttp://github.com/girving/git/commit/00a7c591b9a1fc6880ad5f88d118bb1d6ea86878
Documentation/git-fast-export.txt | 7 +++++++
builtin-fast-export.c | 9 ++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-fast-export.txt
b/Documentation/git-fast-export.txt
index 0c9eb56..47a96dd 100644
@@ -71,6 +71,13 @@ marks the same across runs. allow that. So fake a tagger to be able to fast-import the output.+--no-data::+ Skip output of blob objects and instead refer to blobs via+ their original SHA-1 hash. This is useful when rewriting the+ directory structure or history of a repository without+ touching the contents of individual files. Note that the+ resulting stream can only be used by a repository which+ already contains the necessary objects. EXAMPLES --------
From: Stephen Boyd <hidden> Date: 2016-06-15 22:47:06
Johannes Schindelin wrote:
There is an ugly solution:
{ OPTION_NEGBIT, 0, "no-data", &no_data, NULL, NULL,
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 0 },
{ OPTION_BIT, 0, "no-data", NULL, NULL,
"Skip output of blob data",
PARSE_OPT_NOARG, NULL, 1 },
and there is a more elegant solution:
[PATCH] parse-opt: optionally show "--no-" option string
It is usually better to have positive options, to avoid confusing double
negations. However, sometimes it is desirable to show the negative option
in the help.
Introduce the flag PARSE_OPT_NEGHELP to do that.
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:47:06
Hi,
On Mon, 27 Jul 2009, Stephen Boyd wrote:
quoted hunk
Johannes Schindelin wrote:
quoted
[PATCH] parse-opt: optionally show "--no-" option string
It is usually better to have positive options, to avoid confusing
double negations. However, sometimes it is desirable to show the
negative option in the help.
Introduce the flag PARSE_OPT_NEGHELP to do that.