git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 4/4] bundle: show progress on "unbundle"

From
Derrick Stolee <stolee@gmail.com>
Date
Aug 24, 2021, 17:23 UTC
Message-ID
<aacc0d53-6a95-b5f2-3098-94f6ffc8d2b2@gmail.com>
In-Reply-To
<patch-v2-4.4-e4ca8b26962-20210823T110136Z-avarab@gmail.com>
On 8/23/2021 7:02 AM, Ævar Arnfjörð Bjarmason wrote:
Show 29 quoted lines
> The "unbundle" command added in 2e0afafebd8 (Add git-bundle: move
> objects and references by archive, 2007-02-22) did not show progress
> output, even though the underlying API learned how to show progress in
> be042aff24c (Teach progress eye-candy to fetch_refs_from_bundle(),
> 2011-09-18).
> 
> Now we'll show "Unbundling objects" using the new --progress-title
> option to "git index-pack", to go with its existing "Receiving
> objects" and "Indexing objects" (which it shows when invoked with
> "--stdin", and with a pack file, respectively).
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  builtin/bundle.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/builtin/bundle.c b/builtin/bundle.c
> index 10f6f45770a..f027cce3fef 100644
> --- a/builtin/bundle.c
> +++ b/builtin/bundle.c
> @@ -162,7 +162,11 @@ static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix)
>  	struct bundle_header header = BUNDLE_HEADER_INIT;
>  	int bundle_fd = -1;
>  	int ret;
> +	int progress = isatty(2);
> +
>  	struct option options[] = {
> +		OPT_BOOL(0, "progress", &progress,
> +			 N_("show progress meter")),

We should probably update Documentation/git-bundle.txt, specifically the synopsis, which currently reads:

'git bundle' create [-q | --quiet | --progress | --all-progress] [--all-progress-implied]
		    [--version=<version>] <file> <git-rev-list-args>
'git bundle' verify [-q | --quiet] <file>
'git bundle' list-heads <file> [<refname>...]
'git bundle' unbundle <file> [<refname>...]

Add [--progress] to the unbundle line. The --progress option is documented further down in the file, although it is confusing where it applies.

What about the --all-progress and --all-progress-implied options? Reading the docs, it seems that they won't apply to 'unbundle', but it doesn't hurt to ask.

Show 5 quoted lines
> +
> +	if (progress) {
> +		strvec_push(&extra_args, "-v");
> +		strvec_push(&extra_args, "--progress-title");
> +		strvec_push(&extra_args, _("Unbundling objects"));

If the previous patch changes to match the --progress-title=X pattern of the other options in index-pack, then these two lines will need to change, probably to a strvec_pushf().

> +	}
> +
>  	ret = !!unbundle(the_repository, &header, bundle_fd, &extra_args) ||

Since this is the first real use of extra_args, as I mentioned before it would not be the end of the world to have extra_args appear for the first time within this patch.

Thanks, -Stolee

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 18 of 42 in “bundle: show progress on "unbundle"”
  1. 0/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Jul 27, 2021
  2. 2/4 bundle API: change "flags" to be "extra_index_pack_args"Ævar Arnfjörð Bjarmason, Jul 27, 2021
  3. 1/4 bundle API: start writing API documentationÆvar Arnfjörð Bjarmason, Jul 27, 2021
  4. 3/4 index-pack: add --progress-title optionÆvar Arnfjörð Bjarmason, Jul 27, 2021
  5. 4/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Jul 27, 2021
  6. 0/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Aug 23, 2021
  7. 2/4 bundle API: change "flags" to be "extra_index_pack_args"Ævar Arnfjörð Bjarmason, Aug 23, 2021
  8. Derrick StoleeAug 24, 2021
  9. Ævar Arnfjörð BjarmasonAug 24, 2021
  10. Derrick StoleeAug 24, 2021
  11. 1/4 bundle API: start writing API documentationÆvar Arnfjörð Bjarmason, Aug 23, 2021
  12. Derrick StoleeAug 24, 2021
  13. Ævar Arnfjörð BjarmasonAug 24, 2021
  14. 3/4 index-pack: add --progress-title optionÆvar Arnfjörð Bjarmason, Aug 23, 2021
  15. Derrick StoleeAug 24, 2021
  16. Ævar Arnfjörð BjarmasonAug 24, 2021
  17. 4/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Aug 23, 2021
  18. Derrick StoleeAug 24, 2021
  19. Ævar Arnfjörð BjarmasonAug 24, 2021
  20. 0/5 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Aug 26, 2021
  21. 1/5 bundle API: start writing API documentationÆvar Arnfjörð Bjarmason, Aug 26, 2021
  22. 3/5 bundle API: change "flags" to be "extra_index_pack_args"Ævar Arnfjörð Bjarmason, Aug 26, 2021
  23. Junio C HamanoAug 28, 2021
  24. 2/5 strvec: add a strvec_pushvec()Ævar Arnfjörð Bjarmason, Aug 26, 2021
  25. Junio C HamanoAug 28, 2021
  26. Junio C HamanoAug 28, 2021
  27. Jeff KingAug 28, 2021
  28. Junio C HamanoAug 29, 2021
  29. Derrick StoleeAug 30, 2021
  30. Ævar Arnfjörð BjarmasonSep 2, 2021
  31. Junio C HamanoSep 3, 2021
  32. Jeff KingSep 3, 2021
  33. 4/5 index-pack: add --progress-title optionÆvar Arnfjörð Bjarmason, Aug 26, 2021
  34. Junio C HamanoAug 28, 2021
  35. 5/5 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Aug 26, 2021
  36. Junio C HamanoAug 28, 2021
  37. Ævar Arnfjörð BjarmasonSep 2, 2021
  38. 0/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Sep 5, 2021
  39. 1/4 bundle API: start writing API documentationÆvar Arnfjörð Bjarmason, Sep 5, 2021
  40. 2/4 bundle API: change "flags" to be "extra_index_pack_args"Ævar Arnfjörð Bjarmason, Sep 5, 2021
  41. 3/4 index-pack: add --progress-title optionÆvar Arnfjörð Bjarmason, Sep 5, 2021
  42. 4/4 bundle: show progress on "unbundle"Ævar Arnfjörð Bjarmason, Sep 5, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.