Re: [PATCH v8 10/15] bugreport: add config values from safelist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Emily Shaffer <emilyshaffer@xxxxxxxxxx> writes:

> @@ -94,6 +120,7 @@ int cmd_main(int argc, const char **argv)
>  	char *option_output = NULL;
>  	char *option_suffix = "%F-%H%M";
>  	struct stat statbuf;
> +	int nongit_ok = 0;
>  
>  	const struct option bugreport_options[] = {
>  		OPT_STRING('o', "output-directory", &option_output, N_("path"),
> @@ -102,6 +129,10 @@ int cmd_main(int argc, const char **argv)
>  			   N_("specify a strftime format suffix for the filename")),
>  		OPT_END()
>  	};
> +
> +	/* Prerequisite for hooks and config checks */
> +	setup_git_directory_gently(&nongit_ok);

Now this starts to break "-o" option when the command is run from a
subdirectory of a git working tree, I suspect.

The setup() will discover that you are in a Git controlled working
tree, goes up to the top-level of the working tree, so a user may
expect

	cd t && git bugreport -o frotz

to create a new directory t/frotz, but it would instead create the
directory frotz next to t/, no?

Using OPT_FILENAME and feeding correct prefix to parse_options()
will correct this.

>  	argc = parse_options(argc, argv, "", bugreport_options,
>  			     bugreport_usage, 0);



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux