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, 16:50 UTC
Message-ID
<vpq7ghjtpv1.fsf@anie.imag.fr>
In-Reply-To
<7vk3ljbh5r.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>>> 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.
>
> "First read config, override with command line" is what we always
> do.  One recent workaround with selective exception I can think of
> offhand is in diff config parser 6c374008 (diff_opt: track whether
> flags have been set explicitly, 2013-05-10), but I am fairly sure
> there are others.
That was the one I had in mind.
Show 11 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 :-(.
>
> Isn't it essentially your second option (running the CLI parser
> before once, then read config, and then run the CLI parser for
> real)?

Not really. The first run should be a kind of dry-run, except for the --porcelain part.

> In any case, I am still not convinced yet that status.short is a
> real problem if --porcelain readers trip with "## branchname"
> output.  Isn't it that the readers are broken and need fixing?

Before introducing status.short, scripts could call "git status --porcelain" and get some output. They had no way to know whether something would be added in the future. Now, they can run the same command and get a different output. To me, that's exactly what we're trying to avoid in plumbing.

The configuration file here is really meant for the user, not for scripts. Scripts that want the branch information can use --branch. Scripts that do not have absolutely nothing to gain in getting this extra output (only extra parser complexity).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 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.