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

Re: [PATCH 2/3] diff: introduce diff.submodule configuration variable

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Nov 11, 2012, 14:50 UTC
Message-ID
<CALkWK0=zTCXki2c=ugRXE485ps2=OWag7mdzVJW93cnsypwkiA@mail.gmail.com>
In-Reply-To
<20121108205110.GB8376@sigill.intra.peff.net>
Jeff King wrote:
Show 16 quoted lines
> On Thu, Nov 01, 2012 at 04:13:49PM +0530, Ramkumar Ramachandra wrote:
>
>> diff --git a/builtin/diff.c b/builtin/diff.c
>> index 9650be2..6d00311 100644
>> --- a/builtin/diff.c
>> +++ b/builtin/diff.c
>> @@ -297,6 +297,10 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
>>       DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL);
>>       DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
>>
>> +     /* Set SUBMODULE_LOG if diff.submodule config var was set */
>> +     if (submodule_format_cfg && !strcmp(submodule_format_cfg, "log"))
>> +             DIFF_OPT_SET(&rev.diffopt, SUBMODULE_LOG);
>> +
>
> Yuck. Why is this parsing happening in cmd_diff?

Blame Jens- see this thread | http://thread.gmane.org/gmane.comp.version-control.git/206816/focus=206815

Show 5 quoted lines
> Then you can keep the parsing logic for "log" in diff.c. And you should
> factor it out into a function so that the command-line option and the
> config parser can share the same code. I know it's only one line now,
> but anybody who wants to add an option will have to update both places.
> See the parsing of diff.dirstat for an example.
Done.  I'll send out the new series shortly.
Ram
Previous: Jeff KingNext: Jeff King
Message 5 of 10 in “Introduce diff.submodule”
  1. 0/3 Introduce diff.submoduleRamkumar Ramachandra, Nov 1, 2012
  2. 1/3 Documentation: move diff.wordRegex from config.txt to diff-config.txtRamkumar Ramachandra, Nov 1, 2012
  3. 2/3 diff: introduce diff.submodule configuration variableRamkumar Ramachandra, Nov 1, 2012
  4. Jeff KingNov 8, 2012
  5. Ramkumar RamachandraNov 11, 2012
  6. Jeff KingNov 11, 2012
  7. 3/3 submodule: display summary header in boldRamkumar Ramachandra, Nov 1, 2012
  8. Jens LehmannNov 1, 2012
  9. Ramkumar RamachandraNov 4, 2012
  10. Jeff KingNov 8, 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.