git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Taylor Blau <ttaylorr@github.com>
Cc: janek <27jf@protonmail.com>, "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Short status ignores --show-stash option
Date: Tue, 16 Feb 2021 15:23:11 -0500	[thread overview]
Message-ID: <YCwpr29Ghdk3ye1u@coredump.intra.peff.net> (raw)
In-Reply-To: <YCwOA/CcPEA/he1X@nand.local>

On Tue, Feb 16, 2021 at 01:25:32PM -0500, Taylor Blau wrote:

> and that would cause 'git status' to do what you expect:
> 
>     $ git.compile status --short --branch --show-stash
>     ## tb/empty-trailer-continuation
>      M wt-status.c
>      Your stash currently has 16 entries
> 
> But it may not be the right thing to do, since that explicitly breaks
> the --porcelain format. We may want something like this in addition to
> the above:
> 
> diff --git a/builtin/commit.c b/builtin/commit.c
> index 739110c5a7..ef855896a2 100644
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -1414,6 +1414,12 @@ int cmd_status(int argc, const char **argv, const char *prefix)
>             s.show_untracked_files == SHOW_NO_UNTRACKED_FILES)
>                 die(_("Unsupported combination of ignored and untracked-files arguments"));
> 
> +       if (status_format == STATUS_FORMAT_PORCELAIN ||
> +           status_format == STATUS_FORMAT_PORCELAIN_V2) {
> +               if (s.show_stash)
> +                       die(_("--porcelain is incompatible with --show-stash"));
> +       }
> +

I think ideally we'd define a porcelain format for it, since v2 has
explicit support for extending with new headers. Something like:

  # stash.number 16

would probably work. I don't think it's _strictly_ necessary, in that
the die() above does not paint us into a corner. We can always loosen it
later. But it is easy enough that it probably makes sense to just define
it while we are here.

And in particular, I think we may want to mimic it for --short, rather
than just showing the "long" output, which IMHO is kind of dissonant in
terms of the formatting (though again, we reserve the right to change
--short, so I don't think we've painted ourselves into a corner).

-Peff

      reply	other threads:[~2021-02-16 20:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15 20:02 Short status ignores --show-stash option janek
2021-02-16 18:25 ` Taylor Blau
2021-02-16 20:23   ` Jeff King [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=YCwpr29Ghdk3ye1u@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=27jf@protonmail.com \
    --cc=git@vger.kernel.org \
    --cc=ttaylorr@github.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).