diff mbox series

[v8,02/15] help: add shell-path to --build-options

Message ID 20200220015858.181086-3-emilyshaffer@google.com (mailing list archive)
State New, archived
Headers show
Series add git-bugreport tool | expand

Commit Message

Emily Shaffer Feb. 20, 2020, 1:58 a.m. UTC
It may be useful to know which shell Git was built to try to point to,
in the event that shell-based Git commands are failing. $SHELL_PATH is
set during the build and used to launch the manpage viewer, as well as
by git-compat-util.h, and it's used during tests. 'git version
--build-options' is encouraged for use in bug reports, so it makes sense
to include this information there.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
---
 help.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Junio C Hamano Feb. 20, 2020, 7:03 p.m. UTC | #1
Emily Shaffer <emilyshaffer@google.com> writes:

> It may be useful to know which shell Git was built to try to point to,
> in the event that shell-based Git commands are failing. $SHELL_PATH is
> set during the build and used to launch the manpage viewer, as well as
> by git-compat-util.h, and it's used during tests. 'git version
> --build-options' is encouraged for use in bug reports, so it makes sense
> to include this information there.

It probably makes sense to capture PERL_PATH, PYTHON_PATH,
TCLTK_PATH, and TCL_PATH, as they fall into exactly the same
category as this one.

> Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
> ---
>  help.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/help.c b/help.c
> index a21487db77..190722fb0a 100644
> --- a/help.c
> +++ b/help.c
> @@ -654,6 +654,7 @@ int cmd_version(int argc, const char **argv, const char *prefix)
>  			printf("no commit associated with this build\n");
>  		printf("sizeof-long: %d\n", (int)sizeof(long));
>  		printf("sizeof-size_t: %d\n", (int)sizeof(size_t));
> +		printf("shell-path: %s\n", SHELL_PATH);
>  		/* NEEDSWORK: also save and output GIT-BUILD_OPTIONS? */
>  	}
>  	return 0;
Emily Shaffer Feb. 20, 2020, 9:15 p.m. UTC | #2
On Thu, Feb 20, 2020 at 11:03:59AM -0800, Junio C Hamano wrote:
> Emily Shaffer <emilyshaffer@google.com> writes:
> 
> > It may be useful to know which shell Git was built to try to point to,
> > in the event that shell-based Git commands are failing. $SHELL_PATH is
> > set during the build and used to launch the manpage viewer, as well as
> > by git-compat-util.h, and it's used during tests. 'git version
> > --build-options' is encouraged for use in bug reports, so it makes sense
> > to include this information there.
> 
> It probably makes sense to capture PERL_PATH, PYTHON_PATH,
> TCLTK_PATH, and TCL_PATH, as they fall into exactly the same
> category as this one.

SHELL_PATH was already made sure to exist in git-compat-util.h before
this change; these other utility paths are not. Do you want me to add
them now?

> 
> > Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
> > ---
> >  help.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/help.c b/help.c
> > index a21487db77..190722fb0a 100644
> > --- a/help.c
> > +++ b/help.c
> > @@ -654,6 +654,7 @@ int cmd_version(int argc, const char **argv, const char *prefix)
> >  			printf("no commit associated with this build\n");
> >  		printf("sizeof-long: %d\n", (int)sizeof(long));
> >  		printf("sizeof-size_t: %d\n", (int)sizeof(size_t));
> > +		printf("shell-path: %s\n", SHELL_PATH);
> >  		/* NEEDSWORK: also save and output GIT-BUILD_OPTIONS? */
> >  	}
> >  	return 0;
diff mbox series

Patch

diff --git a/help.c b/help.c
index a21487db77..190722fb0a 100644
--- a/help.c
+++ b/help.c
@@ -654,6 +654,7 @@  int cmd_version(int argc, const char **argv, const char *prefix)
 			printf("no commit associated with this build\n");
 		printf("sizeof-long: %d\n", (int)sizeof(long));
 		printf("sizeof-size_t: %d\n", (int)sizeof(size_t));
+		printf("shell-path: %s\n", SHELL_PATH);
 		/* NEEDSWORK: also save and output GIT-BUILD_OPTIONS? */
 	}
 	return 0;