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

Re: [PATCH 3/5] diff: acknowledge --submodule=short command-line option

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Oct 7, 2012, 15:22 UTC
Message-ID
<CALkWK0mbQZjYUR73rdFP2BtOzdL9gQqxnC5fjtsCYq2F29=8qg@mail.gmail.com>
In-Reply-To
<506B3F74.3020208@web.de>
Jens Lehmann wrote:
Show 14 quoted lines
> Am 02.10.2012 18:51, schrieb Ramkumar Ramachandra:
>> Currently, the diff code does not differentiate between an explicit
>> '--submodule=short' being passed, and no submodule option being passed
>> on the command line.  Making this differentiation will be important
>> when the command-line option can be used to override a
>> "diff.submoduleFormat" configuration variable introduced in the next
>> patch.
>
> Wouldn't it be sufficient here to simply reset the log flag by using
> "DIFF_OPT_CLR(options, SUBMODULE_LOG)"? This would avoid having to
> use the last bit of the diffopt flags. And if I read the code correctly,
> diff_opt_parse() is called by setup_revisions() which is called after
> git_config(), so that should be safe. (And "textconv" uses the same
> approach)

How is it sufficient? In git_diff_ui_config(), I set submodule_format_cfg, which has nothing to do with SUBMODULE_LOG. In builtin_diff(), I'll have to check SUBMODULE_LOG and submodule_format_cfg. The tricky bit is that I should check submodule_format_cfg if and only if "--submodule=short" was NOT passed on the command line- now, that's not the same thing is checking if SUBMODULE_LOG is unset, because SUBMODULE_LOG is unset (or cleared) if no argument was passed or if "--submodule=short" is passed. Therefore, I need a SUBMODULE_SHORT to differentiate between the two cases.

What am I missing?
Ram
Previous: Jens LehmannNext: Jens Lehmann
Message 6 of 14 in “submodule: introduce diff.submoduleFormat”
  1. 0/5 submodule: introduce diff.submoduleFormatRamkumar Ramachandra, Oct 2, 2012
  2. 1/5 Documentation: move diff.wordRegex from config.txt to diff-config.txtRamkumar Ramachandra, Oct 2, 2012
  3. 2/5 Documentation: sort diff-config.txt alphabeticallyRamkumar Ramachandra, Oct 2, 2012
  4. 3/5 diff: acknowledge --submodule=short command-line optionRamkumar Ramachandra, Oct 2, 2012
  5. Jens LehmannOct 2, 2012
  6. Ramkumar RamachandraOct 7, 2012
  7. Jens LehmannOct 7, 2012
  8. Jens LehmannOct 7, 2012
  9. 4/5 diff: introduce diff.submoduleFormat configuration variableRamkumar Ramachandra, Oct 2, 2012
  10. Jens LehmannOct 2, 2012
  11. Jens LehmannOct 3, 2012
  12. Ramkumar RamachandraOct 29, 2012
  13. Jens LehmannOct 30, 2012
  14. 5/5 submodule: display summary header in boldRamkumar Ramachandra, Oct 2, 2012

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.