git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Garima Singh via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Garima Singh <garima.singh@microsoft.com>
Subject: Re: [PATCH v2 1/1] commit-graph: add --[no-]progress to write and verify.
Date: Thu, 12 Sep 2019 13:40:55 -0700	[thread overview]
Message-ID: <xmqqef0lfdt4.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <47cc99bd151db67fe2ee0f91bb98b3eb7e55786d.1566836997.git.gitgitgadget@gmail.com> (Garima Singh via GitGitGadget's message of "Mon, 26 Aug 2019 09:29:58 -0700 (PDT)")

"Garima Singh via GitGitGadget" <gitgitgadget@gmail.com> writes:

> diff --git a/Documentation/git-commit-graph.txt b/Documentation/git-commit-graph.txt
> index eb5e7865f0..ca0b1a683f 100644
> --- a/Documentation/git-commit-graph.txt
> +++ b/Documentation/git-commit-graph.txt
> @@ -10,8 +10,8 @@ SYNOPSIS
>  --------
>  [verse]
>  'git commit-graph read' [--object-dir <dir>]
> -'git commit-graph verify' [--object-dir <dir>] [--shallow]
> -'git commit-graph write' <options> [--object-dir <dir>]
> +'git commit-graph verify' [--object-dir <dir>] [--shallow] [--[no-]progress]
> +'git commit-graph write' <options> [--object-dir <dir>] [--[no-]progress]

This is not a problem with this patch, but it is disturbing to see
<options> and other concrete "--option" listed explicitly.  It could
be that "--object-dir <dir>" is so important an option that deserves
to be singled out while other random options can be left to individual
option's description, but in that case, would "--progress" be equally
important (if anything, as an option that is purely about appearance,
I would expect it to be with a lot lower importance)?

I guess with a preparatory clean-up patch to deal with the <options>
part, the result of applying this patch would not look so bad.
Perhaps renaming <options> to <write-specific-options> and moving it
to the end of the line might be sufficient.  I dunno.  At least we'd
need to make sure that it is clear to readers what options are
allowed where we wrote <options> above.

> @@ -29,6 +29,9 @@ OPTIONS
>  	commit-graph file is expected to be in the `<dir>/info` directory and
>  	the packfiles are expected to be in `<dir>/pack`.
>  
> +--[no-]progress::
> +	Turn progress on/off explicitly. If neither is specified, progress is 

Trailing whitespace.

> +	shown if standard error is connected to a terminal.
>   ...
> +	if (opts.progress)
> +		flags |= COMMIT_GRAPH_WRITE_PROGRESS;
> +	

Trailing whitespace.

> diff --git a/commit-graph.c b/commit-graph.c
> index f2888c203b..2802f2ade6 100644
> --- a/commit-graph.c
> +++ b/commit-graph.c
> @@ -1992,8 +1992,10 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
>  	if (verify_commit_graph_error & ~VERIFY_COMMIT_GRAPH_ERROR_HASH)
>  		return verify_commit_graph_error;
>  
> -	progress = start_progress(_("Verifying commits in commit graph"),
> -				  g->num_commits);
> +	if (flags & COMMIT_GRAPH_WRITE_PROGRESS)
> +		progress = start_progress(_("Verifying commits in commit graph"),
> +					g->num_commits);
> +

This is correct, but it feels funny that it is sufficient to
castrate start_progress() and we do not have to muck with existing
calls to show and stop progress output.  We rely on progress being
NULL for that to work, and existing code initializes the variable
to NULL, so we are OK.

  reply	other threads:[~2019-09-12 20:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 18:37 [PATCH 0/1] commit-graph: add --[no-]progress to write and verify Garima Singh via GitGitGadget
2019-08-20 18:37 ` [PATCH 1/1] " Garima Singh via GitGitGadget
2019-08-20 21:11   ` Junio C Hamano
2019-08-20 21:13   ` Eric Sunshine
2019-08-21 16:47     ` Junio C Hamano
2019-08-20 18:45 ` [PATCH 0/1] " Derrick Stolee
2019-08-26 16:29 ` [PATCH v2 " Garima Singh via GitGitGadget
2019-08-26 16:29   ` [PATCH v2 1/1] " Garima Singh via GitGitGadget
2019-09-12 20:40     ` Junio C Hamano [this message]
2019-09-16 22:36     ` SZEDER Gábor
2019-09-17 10:47       ` Derrick Stolee
2019-09-17 12:22         ` SZEDER Gábor
2019-09-10 14:00   ` [PATCH v2 0/1] " Garima Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqef0lfdt4.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=garima.singh@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).