git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fredrik Gustafsson <iveqy@iveqy.com>
To: Jeff King <peff@peff.net>
Cc: Fredrik Gustafsson <iveqy@iveqy.com>, git@vger.kernel.org
Subject: Re: Parse --o in format-patch
Date: Fri, 28 Jun 2013 18:44:40 +0200	[thread overview]
Message-ID: <20130628164440.GA21354@paksenarrion.iveqy.com> (raw)
In-Reply-To: <20130628163153.GA9127@sigill.intra.peff.net>

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:
> 
>   git format-patch -ooutdir ...
> 
> to specify the argument. Otherwise, it is not clear in:
> 
>   git format-patch -o outdir HEAD~
> 
> whether "outdir" is the argument to "-o", or if it is simply the next
> argument.

That would be a possibility but I don't like breaking backwards
compability.

> I'm not clear how that interacts with your example, though. Your example
> tries to use "-o" to set output_directory to NULL. But it is already
> NULL if you do not specify any "-o" at all.

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>

But I guess I would need a new option instead. Something like
--default-output-dir.

-- 
Med vänliga hälsningar
Fredrik Gustafsson

tel: 0733-608274
e-post: iveqy@iveqy.com

  reply	other threads:[~2013-06-28 16:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 16:05 Parse --o in format-patch Fredrik Gustafsson
2013-06-28 16:31 ` Jeff King
2013-06-28 16:44   ` Fredrik Gustafsson [this message]
2013-06-28 16:49     ` Jeff King

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130628164440.GA21354@paksenarrion.iveqy.com \
    --to=iveqy@iveqy.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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.
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 NNTP newsgroup(s).