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

Re: Parse --o in format-patch

From
Jeff King <peff@peff.net>
Date
Jun 28, 2013, 16:49 UTC
Message-ID
<20130628164959.GC9127@sigill.intra.peff.net>
In-Reply-To
<20130628164440.GA21354@paksenarrion.iveqy.com>
On Fri, Jun 28, 2013 at 06:44:40PM +0200, Fredrik Gustafsson wrote:
Show 7 quoted lines
> On Fri, Jun 28, 2013 at 12:31:53PM -0400, Jeff King wrote:
> > It's possible to have an "optional" argument by using the
> > PARSE_OPT_OPTARG flag. However, it is not backwards compatible from the
> > user's perspective, as they must use the "sticked" form:
> 
> That would be a possibility but I don't like breaking backwards
> compability.

Yes, I did not say it outright, but I meant "...and that is why we cannot go that route." :)

Show 9 quoted lines
> my goal is to make:
>        git format-patch [-k] [(-o|--output-directory) <dir> | --stdout] [ <since> | <revision range> ]
> to be:
>        git format-patch [-k] [(-o|--output-directory) [dir] | --stdout] [ <since> | <revision range> ]
> 
> that would do:
> git format patch -> current dir
> git format patch -o -> default dir (for example GIT_DIR/.outgoing/)
> git format patch -o <dir> -> user defined <dir>
Ah, that makes much more sense to me.
> But I guess I would need a new option instead. Something like
> --default-output-dir.

It depends on how the default is specified. Is it hard-coded? Or do you specify format.outputDirectory? If the latter, I would think you would want it on all the time when "-o" is not given[1], and no new option is required. Otherwise, yes, I'd think you would want a new option.

-Peff
[1] format-patch may be considered plumbing, in which case an output
    directory config option might cause problems with scripts that
    expect to run it and find the output in the current directory. I'm
    not sure how big a deal that is.
Previous: Fredrik Gustafsson
Message 4 of 4 in “Parse --o in format-patch”
  1. Fredrik GustafssonJun 28, 2013
  2. Jeff KingJun 28, 2013
  3. Fredrik GustafssonJun 28, 2013
  4. Jeff KingJun 28, 2013

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.