Re: [PATCH 6/6] Handle unsupported combination status arguments
- From
Stefan Beller <sbeller@google.com>
- Date
- Oct 5, 2017, 22:08 UTC
- Message-ID
- <CAGZ79kbdObhu0j5yAo-KZk0H12oSzoP5sLd6S8kUbZMzEXBEQA@mail.gmail.com>
- In-Reply-To
- <20171005205443.206900-7-jameson.miller81@gmail.com>
On Thu, Oct 5, 2017 at 1:54 PM, <jameson.miller81@gmail.com> wrote:
Show 6 quoted lines
> From: Jameson Miller <jamill@microsoft.com> > > It is not clear what the correct behavior should be when you ask for > specific ignored behavior without reporting untracked files. For now, > report this as an unsupported combination of input arguments, so it > can be modified in the future without back compat concerns.
Is there a rationale to put this as an extra commit at the end, or could this be squashed into the first commit as well?
Show 15 quoted lines
> > Signed-off-by: Jameson Miller <jamill@microsoft.com> > --- > builtin/commit.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/builtin/commit.c b/builtin/commit.c > index 34443b45d3..7812e106ad 100644 > --- a/builtin/commit.c > +++ b/builtin/commit.c > @@ -1400,6 +1400,11 @@ int cmd_status(int argc, const char **argv, const char *prefix) > handle_untracked_files_arg(&s); > handle_ignored_arg(&s); > > + /* Check for unsupported combination of args */
Oh, this is the first check that we add here for unsupported combinations. How much value does this comment bring to the future reader?
> + if (s.show_ignored_mode == SHOW_MATCHING_IGNORED &&
> + s.show_untracked_files == SHOW_NO_UNTRACKED_FILES)
> + die(_("Unsupported combination of ignored and untracked-files arguments"));Thanks for taking care of the corner case! Stefan