All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/2] status: really ignore config with --porcelain
Date: Mon, 24 Jun 2013 16:51:29 +0200	[thread overview]
Message-ID: <vpqhagnv9xq.fsf@anie.imag.fr> (raw)
In-Reply-To: <CALkWK0=F_i95S+53eZmOAJtA+jG=jvi5-sDc3BgW3rNQo=n3Ng@mail.gmail.com> (Ramkumar Ramachandra's message of "Mon, 24 Jun 2013 19:35:39 +0530")

Ramkumar Ramachandra <artagnon@gmail.com> writes:

> Matthieu Moy wrote:
>> [...]
>
> Before we begin, let me say that this series is written with the
> emergency-fix mindset, and targets maint.

maint shouldn't be necessary since the breakage hasn't been released. At
worse, we can revert the bad commits now and re-implement them properly
later.

> I didn't spend time thinking about how to do it best or even add
> tests.

No problem.

>> * running the CLI parser after, if --porcelain is given, reset the
>>   effect of the variables. Not very clean because we'd have to reset all
>>   the variables to their default, and there is a risk of forgetting one.
>
> Since it's impossible to determine what effect the CLI parser had on
> various variables (some of which are static global), I'm against this
> approach.

I think you meant "what effect the config parser had". If you meant the
CLI parser, then the guilty commits did not change anything wrt that.

>
>> * Or, running the CLI parser before, but with different variables to
>>   specify what the command-line says and what will actually be done,
>>   with something like
>
> Basically, having the CLI parser and the config parser flip two
> different sets of variables, so we can discriminate who set what.
> What annoys me is that this is the first instance of such a
> requirement.

I don't think it's the first instance, but I can't remember precise
examples.

> The approach I'm currently tilting towards is extending the
> parse-options API to allow parsing one special option early.  I would
> argue that this is a good feature that we should have asked for when
> we saw 6758af89e (Merge branch 'jn/git-cmd-h-bypass-setup',
> 2010-12-10).  What do you think?

That's an option too, yes. But probably not easy to implement :-(.

>>>  builtin/commit.c | 7 ++++++-
>>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> No time to contribute one now myself, but this would really deserve a
>> test.
>
> Yeah, will do as a follow-up.  I'm interested in guarding against such
> breakages too :)

Should look like this:

diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 498332c..423e8c4 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -1378,6 +1378,11 @@ test_expect_success '"status.branch=true" weaker than "--no-branch"' '
        test_cmp expected_nobranch actual
 '
 
+test_expect_success '"status.branch=true" weaker than "--porcelain"' '
+       git -c status.branch=true status --porcelain >actual &&
+       test_cmp expected_nobranch actual
+'
+
 test_expect_success '"status.branch=false" same as "--no-branch"' '
        git -c status.branch=false status -s >actual &&
        test_cmp expected_nobranch actual


-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2013-06-24 15:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24 12:45 [PATCH (!) 0/2] Fix serious regressions in latest master Ramkumar Ramachandra
2013-06-24 12:45 ` [PATCH 1/2] status: really ignore config with --porcelain Ramkumar Ramachandra
2013-06-24 13:51   ` Matthieu Moy
2013-06-24 14:05     ` Ramkumar Ramachandra
2013-06-24 14:51       ` Matthieu Moy [this message]
2013-06-24 16:35         ` Junio C Hamano
2013-06-24 16:50           ` Matthieu Moy
2013-06-24 17:16             ` Junio C Hamano
2013-06-24 17:21               ` Matthieu Moy
2013-06-24 18:16             ` Junio C Hamano
2013-06-24 19:30               ` Ramkumar Ramachandra
2013-06-24 22:24                 ` Junio C Hamano
2013-06-24 19:49               ` Junio C Hamano
2013-06-28  1:40               ` Jeff King
2013-06-28  3:59                 ` Junio C Hamano
2013-06-28 17:37                   ` Junio C Hamano
2013-06-28 19:31                     ` Jeff King
2013-06-28 20:15                       ` Junio C Hamano
2013-06-24 16:53           ` Ramkumar Ramachandra
2013-06-24 14:55     ` Junio C Hamano
2013-06-24 15:04       ` Matthieu Moy
2013-06-24 15:50       ` Ramkumar Ramachandra
2013-06-24 12:45 ` [PATCH 2/2] commit: make it work with status.short Ramkumar Ramachandra
2013-06-24 15:17   ` Junio C Hamano
2013-06-24 15:39     ` Ramkumar Ramachandra

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=vpqhagnv9xq.fsf@anie.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.