git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] status: really ignore config with --porcelain

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jun 24, 2013, 14:51 UTC
Message-ID
<vpqhagnv9xq.fsf@anie.imag.fr>
In-Reply-To
<CALkWK0=F_i95S+53eZmOAJtA+jG=jvi5-sDc3BgW3rNQo=n3Ng@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 5 quoted lines
> 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.
Show 7 quoted lines
>> * 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.

Show 9 quoted lines
>
>> * 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.

Show 5 quoted lines
> 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 :-(.
Show 8 quoted lines
>>>  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/
Previous: Ramkumar RamachandraNext: Junio C Hamano
Message 5 of 25 in “Fix serious regressions in latest master”
  1. 0/2 Fix serious regressions in latest masterRamkumar Ramachandra, Jun 24, 2013
  2. 1/2 status: really ignore config with --porcelainRamkumar Ramachandra, Jun 24, 2013
  3. Matthieu MoyJun 24, 2013
  4. Ramkumar RamachandraJun 24, 2013
  5. Matthieu MoyJun 24, 2013
  6. Junio C HamanoJun 24, 2013
  7. Matthieu MoyJun 24, 2013
  8. Junio C HamanoJun 24, 2013
  9. Matthieu MoyJun 24, 2013
  10. Junio C HamanoJun 24, 2013
  11. Ramkumar RamachandraJun 24, 2013
  12. Junio C HamanoJun 24, 2013
  13. Junio C HamanoJun 24, 2013
  14. Jeff KingJun 28, 2013
  15. Junio C HamanoJun 28, 2013
  16. Junio C HamanoJun 28, 2013
  17. Jeff KingJun 28, 2013
  18. Junio C HamanoJun 28, 2013
  19. Ramkumar RamachandraJun 24, 2013
  20. Junio C HamanoJun 24, 2013
  21. Matthieu MoyJun 24, 2013
  22. Ramkumar RamachandraJun 24, 2013
  23. 2/2 commit: make it work with status.shortRamkumar Ramachandra, Jun 24, 2013
  24. Junio C HamanoJun 24, 2013
  25. Ramkumar RamachandraJun 24, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.