From: Jonathan Nieder <jrnieder@gmail.com>
To: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: git@vger.kernel.org, Adric Norris <landstander668@gmail.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/2] git version --build-options: report the build platform, too
Date: Fri, 8 Dec 2017 09:23:24 -0800 [thread overview]
Message-ID: <20171208172324.GB14261@aiede.mtv.corp.google.com> (raw)
In-Reply-To: <978adf12e85ec6c4d407ba09da82945a08ee1f8c.1512752468.git.johannes.schindelin@gmx.de>
Hi,
Johannes Schindelin wrote:
> From: Adric Norris <landstander668@gmail.com>
>
> When asking for bug reports to include the output of `git version
> --build-options`, the idea is that we get a better idea of the
> environment where said bug occurs. In this context, it is useful to
> distinguish between 32 and 64-bit builds.
Neat!
The cover letter gives a clearer idea of the motivation:
In Git for Windows, we ask users to paste the output of said command
into their bug reports, with the idea that this frequently helps
identify where the problems are coming from.
There are some obvious missing bits of information in said output,
though, and this patch series tries to fill the gaps at least a little.
Could some of that text go here, too?
[...]
> --- a/help.c
> +++ b/help.c
> @@ -390,6 +390,7 @@ const char *help_unknown_cmd(const char *cmd)
>
> int cmd_version(int argc, const char **argv, const char *prefix)
> {
> + static char build_platform[] = GIT_BUILD_PLATFORM;
> int build_options = 0;
> const char * const usage[] = {
> N_("git version [<options>]"),
> @@ -413,6 +414,7 @@ int cmd_version(int argc, const char **argv, const char *prefix)
>
> if (build_options) {
> printf("sizeof-long: %d\n", (int)sizeof(long));
> + printf("machine: %s\n", build_platform);
Can this use GIT_BUILD_PLATFORM directly instead of going via the indirection
of a mutable static string? That is, something like
printf("machine: %s\n", GIT_BUILD_PLATFORM);
> /* NEEDSWORK: also save and output GIT-BUILD_OPTIONS? */
What do you think of this idea? uname_M isn't one of the variables
in that file, though, so that's orthogonal to this patch.
[...]
> --- a/help.h
> +++ b/help.h
> @@ -33,3 +33,16 @@ extern void list_commands(unsigned int colopts, struct cmdnames *main_cmds, stru
> */
> extern void help_unknown_ref(const char *ref, const char *cmd, const char *error);
> #endif /* HELP_H */
> +
> +/*
> + * identify build platform
> + */
> +#ifndef GIT_BUILD_PLATFORM
> + #if defined __x86__ || defined __i386__ || defined __i586__ || defined __i686__
> + #define GIT_BUILD_PLATFORM "x86"
> + #elif defined __x86_64__
> + #define GIT_BUILD_PLATFORM "x86_64"
> + #else
> + #define GIT_BUILD_PLATFORM "unknown"
> + #endif
> +#endif
This code needs to be inside the HELP_H header guard.
Thanks and hope that helps,
Jonathan
next prev parent reply other threads:[~2017-12-08 17:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 17:01 [PATCH 0/2] Offer more information in `git version --build-options`'s output Johannes Schindelin
2017-12-08 17:02 ` [PATCH 1/2] git version --build-options: report the build platform, too Johannes Schindelin
2017-12-08 17:23 ` Jonathan Nieder [this message]
2017-12-08 17:43 ` Junio C Hamano
2017-12-08 21:17 ` Eric Sunshine
2017-12-08 21:19 ` Eric Sunshine
2017-12-09 9:43 ` Eric Sunshine
2017-12-09 14:17 ` Johannes Schindelin
2017-12-08 17:02 ` [PATCH 2/2] version --build-options: report commit, too, if possible Johannes Schindelin
2017-12-08 17:27 ` Jonathan Nieder
2017-12-08 17:49 ` Junio C Hamano
2017-12-14 23:27 ` Johannes Schindelin
2017-12-14 23:25 ` Johannes Schindelin
2017-12-14 23:34 ` [PATCH v2 0/2] Offer more information in `git version --build-options`'s output Johannes Schindelin
2017-12-14 23:34 ` [PATCH v2 1/2] version --build-options: also report host CPU Johannes Schindelin
2017-12-14 23:34 ` [PATCH v2 2/2] version --build-options: report commit, too, if possible Johannes Schindelin
2017-12-15 17:45 ` [PATCH v2 0/2] Offer more information in `git version --build-options`'s output Junio C Hamano
2017-12-15 18:03 ` Eric Sunshine
2017-12-15 18:12 ` Junio C Hamano
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=20171208172324.GB14261@aiede.mtv.corp.google.com \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
--cc=landstander668@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).