git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git List <git@vger.kernel.org>, Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: [PATCH 2/3] diff: introduce diff.submodule configuration variable
Date: Sun, 11 Nov 2012 20:20:27 +0530	[thread overview]
Message-ID: <CALkWK0=zTCXki2c=ugRXE485ps2=OWag7mdzVJW93cnsypwkiA@mail.gmail.com> (raw)
In-Reply-To: <20121108205110.GB8376@sigill.intra.peff.net>

Jeff King wrote:
> 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

> 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

  reply	other threads:[~2012-11-11 14:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01 10:43 [PATCH v2 0/3] Introduce diff.submodule Ramkumar Ramachandra
2012-11-01 10:43 ` [PATCH 1/3] Documentation: move diff.wordRegex from config.txt to diff-config.txt Ramkumar Ramachandra
2012-11-01 10:43 ` [PATCH 2/3] diff: introduce diff.submodule configuration variable Ramkumar Ramachandra
2012-11-08 20:51   ` Jeff King
2012-11-11 14:50     ` Ramkumar Ramachandra [this message]
2012-11-11 15:09       ` Jeff King
2012-11-01 10:43 ` [PATCH 3/3] submodule: display summary header in bold Ramkumar Ramachandra
2012-11-01 21:10 ` [PATCH v2 0/3] Introduce diff.submodule Jens Lehmann
2012-11-04 17:58   ` Ramkumar Ramachandra
2012-11-08 20:43     ` Jeff King
  -- strict thread matches above, loose matches on Subject: below --
2012-11-11 16:59 [PATCH v3 " Ramkumar Ramachandra
2012-11-11 16:59 ` [PATCH 2/3] diff: introduce diff.submodule configuration variable Ramkumar Ramachandra
2012-11-13  5:33   ` Jeff King
2012-11-13 15:45     ` Ramkumar Ramachandra
2012-11-13 16:27       ` Junio C Hamano

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='CALkWK0=zTCXki2c=ugRXE485ps2=OWag7mdzVJW93cnsypwkiA@mail.gmail.com' \
    --to=artagnon@gmail.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).