git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Jacek Masiulaniec <jacekm@dobremiasto.net>, git@vger.kernel.org
Subject: Re: git status -s -v: no override
Date: Fri, 15 Apr 2011 21:37:23 -0400	[thread overview]
Message-ID: <20110416013723.GA23105@sigill.intra.peff.net> (raw)
In-Reply-To: <20110416004544.GA5628@elie>

On Fri, Apr 15, 2011 at 07:45:45PM -0500, Jonathan Nieder wrote:

> Jeff King wrote:
> 
> > There is no option that means "counteract -s or --porcelain seen earlier
> > on the command line and use the default long format", which I think is
> > what you want.
> 
> Doesn't "git status $opts --no-short --no-porcelain" work?

Hmm. That does work (with either option, or both), but it is somewhat of
an accident. There is an enum specifying the format the user wants. We
hand it to parse-options for those options, telling it that the value is
an int.  Parse-options will treat --no-foo on an int as setting it to 0.

The enumeration list does not have explicit integer values, but does
happen to have the constant for the long format first, which in ANSI C
guarantees it to be 0.

So yeah, it works, but I will admit to being surprised by it. And
certainly as a user, I wouldn't have thought of that.

I think it probably should have been a tristate like:

 --format={long,short,porcelain}

all along, though I don't know that it is a particularly big deal. We
can still do that if we want, and just keep --short and --porcelain as
aliases.

-Peff

  reply	other threads:[~2011-04-16  1:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 21:34 git status -s -v: no override Jacek Masiulaniec
2011-04-16  0:09 ` Jeff King
2011-04-16  0:45   ` Jonathan Nieder
2011-04-16  1:37     ` Jeff King [this message]
2011-04-16  5:27       ` [PATCH] status: store format option as an int Jonathan Nieder
2011-04-16  5:29         ` Jonathan Nieder
2011-04-16  6:14           ` Junio C Hamano
2011-04-16  6:28             ` Jonathan Nieder
2011-04-16  6:22         ` Jeff King
2011-05-15  4:05         ` [PATCH resend] " Jonathan Nieder

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=20110416013723.GA23105@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jacekm@dobremiasto.net \
    --cc=jrnieder@gmail.com \
    /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).