Subject: Re: [PATCH v12 3/5] bugreport: gather git version and build info

From: Junio C Hamano <[email-masked]>
Date: Mon, 06 Apr 2020 16:17:51 -0700

Emily Shaffer <[email-masked]> writes:

> It's not ideal to directly call 'git version --build-options' because
> that output goes to stdout. Instead, wrap the version string in a helper
> within help.[ch] library, and call that helper from within the bugreport
> library.

This means that "git-bugreport" that can be a different binary from
say "git-remote-curl" (or "git-version" for that matter) would still
report whatever version string that was compiled into "bugreport".

Reporting the version of "bugreport" is *not* useless, and what this
step adds to the report is good.  

But the version number of "bugreport" may not have much to do with
the binary the end user is having trouble with, so we'd also want
the version of the main part of "git", and other standalone "git"
subprograms like "git-remote-curl", reported separately, probably
together with $PATH, $GIT_EXEC_PATH and what appears in the
directories listed on these environment variables.

If "git version --build-options" writes to its standard output
stream, that is a good thing, as it makes it easy to spawn and read
what it says via the run_command() API, and there is one less thing
to worry about (it would be a bit more cumbersome if the output goes
to the standard error stream).

As "git-remote-curl" would also be a separate binary, we'd have to
use the same technique to report version number (and perhaps curl's
library version and its configuration?), perhaps by teaching the
subcommand a new option to dump such details to its standard output.

Using the same technique to report the version about the "git"
itself would be consistent thing to do, as a preparation for future
steps that reports the details about "git-remote-curl".

Thanks.