git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] format-patch: introduce format.outputDirectory configuration

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 18, 2015, 17:13 UTC
Message-ID
<xmqq616ley7y.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1434626280-4610-1-git-send-email-kuleshovmail@gmail.com>
Alexander Kuleshov <kuleshovmail@gmail.com> writes:
Show 12 quoted lines
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index fd2036c..8f6f7ed 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -1247,6 +1247,10 @@ format.coverLetter::
>  	format-patch is invoked, but in addition can be set to "auto", to
>  	generate a cover-letter only when there's more than one patch.
>  
> +format.outputDirectory::
> +	Set a custom directory to store the resulting files instead of the
> +	current working directory.
> +

After you set this configuration variable, how would you override it and get the default behaviour back from the command line for one time invocation? "-o ./"? That needs to be documented somewhere.

Documentation/format-patch.txt must have description on -o; that paragraph needs to mention this new configuration variable, and it would be a good place to document the "-o ./" workaround.

> -static const char *set_outdir(const char *prefix, const char *output_directory)
> +static const char *set_outdir(const char *prefix, const char *output_directory,
> +			      const char *config_output_directory)

This change looks ugly and unnecessary. All the machinery after and including the point set_outdir() is called, including reopen_stdout(), work on output_directory variable and only that variable.

Wouldn't it work equally well to have
	if (!output_directory)
        	output_directory = config_output_directory;

before a call to set_outdir() is made but after the configuration is read (namely, soon after parse_options() returns), without making any change to this function?

Previous: Alexander KuleshovNext: Jeff King
Message 2 of 18 in “format-patch: introduce format.outputDirectory configuration”
  1. format-patch: introduce format.outputDirectory configurationAlexander Kuleshov, Jun 18, 2015
  2. Junio C HamanoJun 18, 2015
  3. Jeff KingJun 18, 2015
  4. Junio C HamanoJun 18, 2015
  5. Junio C HamanoJun 18, 2015
  6. Jeff KingJun 18, 2015
  7. Jeff KingJun 18, 2015
  8. Junio C HamanoJun 18, 2015
  9. Jeff KingJun 19, 2015
  10. Alexander KuleshovJun 19, 2015
  11. Alexander KuleshovJun 19, 2015
  12. Junio C HamanoJun 19, 2015
  13. Alexander KuleshovJun 19, 2015
  14. Alexander KuleshovJun 19, 2015
  15. Alexander KuleshovJun 19, 2015
  16. Junio C HamanoJun 19, 2015
  17. Remi Galan AlfonsoJun 19, 2015
  18. Alexander KuleshovJun 19, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.