{"thread":{"id":"43526","subject":"[PATCH] git-pack-objects progress flag documentation and cleanup","startedAt":"2006-11-07T15:51:23Z","lastAt":"2006-11-07T15:51:23Z","messageCount":1,"participants":["Nicolas Pitre"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"295284","messageId":"Pine.LNX.4.64.0611071047230.11384@xanadu.home","threadId":"43526","inReplyTo":null,"subject":"[PATCH] git-pack-objects progress flag documentation and cleanup","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-11-07T15:51:23Z","receivedAt":"2006-11-07T15:51:23Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"This adds documentation for --progress and --all-progress, remove a \nduplicate --progress handling and make usage string more readable.\n\nSigned-off-by: Nicolas Pitre <nico@cam.org>\n\n---\n\ndiff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt\nindex 5ebe34e..fdc6f97 100644\n--- a/Documentation/git-pack-objects.txt\n+++ b/Documentation/git-pack-objects.txt\n@@ -99,6 +99,23 @@ base-name::\n         Only create a packed archive if it would contain at\n         least one object.\n \n+--progress::\n+\tProgress status is reported on the standard error stream\n+\tby default when it is attached to a terminal, unless -q\n+\tis specified. This flag forces progress status even if\n+\tthe standard error stream is not directed to a terminal.\n+\n+--all-progress::\n+\tWhen --stdout is specified then progress report is\n+\tdisplayed during the object count and deltification phases\n+\tbut inhibited during the write-out phase. The reason is\n+\tthat in some cases the output stream is directly linked\n+\tto another command which may wish to display progress\n+\tstatus of its own as it processes incoming pack data.\n+\tThis flag is like --progress except that it forces progress\n+\treport for the write-out phase as well even if --stdout is\n+\tused.\n+\n -q::\n \tThis flag makes the command not to report its progress\n \ton the standard error stream.\ndiff --git a/builtin-pack-objects.c b/builtin-pack-objects.c\nindex 270bcbd..69e5dd3 100644\n--- a/builtin-pack-objects.c\n+++ b/builtin-pack-objects.c\n@@ -15,7 +15,12 @@\n #include <sys/time.h>\n #include <signal.h>\n \n-static const char pack_usage[] = \"git-pack-objects [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty] [--local] [--incremental] [--window=N] [--depth=N] [--all-progress] [--revs [--unpacked | --all]*] [--stdout | base-name] <ref-list | <object-list]\";\n+static const char pack_usage[] = \"\\\n+git-pack-objects [{ -q | --progress | --all-progress }] \\n\\\n+\t[--local] [--incremental] [--window=N] [--depth=N] \\n\\\n+\t[--no-reuse-delta] [--delta-base-offset] [--non-empty] \\n\\\n+\t[--revs [--unpacked | --all]*] [--stdout | base-name] \\n\\\n+\t[<ref-list | <object-list]\";\n \n struct object_entry {\n \tunsigned char sha1[20];\n@@ -1520,14 +1525,6 @@ int cmd_pack_objects(int argc, const cha\n \t\t\tlocal = 1;\n \t\t\tcontinue;\n \t\t}\n-\t\tif (!strcmp(\"--progress\", arg)) {\n-\t\t\tprogress = 1;\n-\t\t\tcontinue;\n-\t\t}\n-\t\tif (!strcmp(\"--all-progress\", arg)) {\n-\t\t\tprogress = 2;\n-\t\t\tcontinue;\n-\t\t}\n \t\tif (!strcmp(\"--incremental\", arg)) {\n \t\t\tincremental = 1;\n \t\t\tcontinue;\n@@ -1550,6 +1547,10 @@ int cmd_pack_objects(int argc, const cha\n \t\t\tprogress = 1;\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strcmp(\"--all-progress\", arg)) {\n+\t\t\tprogress = 2;\n+\t\t\tcontinue;\n+\t\t}\n \t\tif (!strcmp(\"-q\", arg)) {\n \t\t\tprogress = 0;\n"}]}