git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Simon Ruderich <simon@ruderich.org>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>, git <git@vger.kernel.org>
Subject: Re: [PATCH 1/2] diffcore-pickaxe: respect --no-textconv
Date: Thu, 4 Apr 2013 13:43:01 -0400	[thread overview]
Message-ID: <20130404174301.GA13005@sigill.intra.peff.net> (raw)
In-Reply-To: <20130404160359.GA25232@ruderich.org>

On Thu, Apr 04, 2013 at 06:03:59PM +0200, Simon Ruderich wrote:

> git log -S doesn't respect --no-textconv:
> 
>     $ echo '*.txt diff=wrong' > .gitattributes
>     $ git -c diff.wrong.textconv='xxx' log --no-textconv -Sfoo
>     error: cannot run xxx: No such file or directory
>     fatal: unable to read files to diff
> 
> Signed-off-by: Simon Ruderich <simon@ruderich.org>
> Reported-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>

Usually these pseudo-headers are meant to be chronological, so you would
swap the order.

> > It seems the command "git log --no-textconv -Sfoo" still runs the
> > textconv filter (noticed because I have a broken textconv filter that
> > lets "git log -S" error out).
> >
> > [snip]
> 
> Hello Matthieu,
> 
> This patch should fix it. All tests pass.

Thanks, the patch looks correct to me, although...

> diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c
> index b097fa7..f814a52 100644
> --- a/diffcore-pickaxe.c
> +++ b/diffcore-pickaxe.c
> @@ -78,7 +78,6 @@ static void fill_one(struct diff_filespec *one,
>  		     mmfile_t *mf, struct userdiff_driver **textconv)
>  {
>  	if (DIFF_FILE_VALID(one)) {
> -		*textconv = get_textconv(one);
>  		mf->size = fill_textconv(*textconv, one, &mf->ptr);

Dropping this is the right thing to do with the rest of your patch, but
like Matthieu, it took me a second to see why. Something like this
should probably go into the commit message:

  We need to check that the ALLOW_TEXTCONV diff option is set before
  loading the textconv drivers. Rather than pass the diff options
  structure into the fill_one helper, let's just determine the textconv
  driver outside of that function and pass that in.

Though I really think that justification would make more sense if your
second cleanup patch came first, pulling the get_textconv calls back out
to the callers (which is easy to justify, since one of the callers
already has to load them itself _anyway_, which is just ugly).

-Peff

  parent reply	other threads:[~2013-04-04 17:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04  8:34 [BUG] git log -S not respecting --no-textconv Matthieu Moy
2013-04-04 16:03 ` [PATCH 1/2] diffcore-pickaxe: respect --no-textconv Simon Ruderich
2013-04-04 17:03   ` Matthieu Moy
2013-04-04 17:43   ` Jeff King [this message]
2013-04-04 17:45   ` Junio C Hamano
2013-04-04 17:51     ` Jeff King
2013-04-04 18:10       ` Junio C Hamano
2013-04-04 20:20         ` [PATCH v2 1/3] diffcore-pickaxe: remove unnecessary call to get_textconv() Simon Ruderich
2013-04-04 20:48           ` Junio C Hamano
2013-04-04 21:10             ` Junio C Hamano
2013-04-04 21:11             ` Jeff King
2013-04-04 22:51               ` Junio C Hamano
2013-04-05 13:20             ` Simon Ruderich
2013-04-04 20:21         ` [PATCH v2 2/3] diffcore-pickaxe: remove fill_one() Simon Ruderich
2013-04-05  0:08           ` Jeff King
2013-04-05  4:43             ` Junio C Hamano
2013-04-05  4:45               ` [PATCH 1/3] diffcore-pickaxe: port optimization from has_changes() to diff_grep() Junio C Hamano
2013-04-05  4:45                 ` [PATCH 2/3] diffcore-pickaxe: fix leaks in "log -S<block>" and "log -G<pattern>" Junio C Hamano
2013-04-05  4:45                 ` [PATCH 3/3] diffcore-pickaxe: unify setup and teardown code between log -S/-G Junio C Hamano
2013-04-05  5:28                   ` Jeff King
2013-04-05  5:43                     ` Junio C Hamano
2013-04-05  5:45                       ` Jeff King
2013-04-05 16:44                         ` Junio C Hamano
2013-04-04 20:21         ` [PATCH v2 3/3] diffcore-pickaxe: respect --no-textconv Simon Ruderich
2013-04-05  7:40           ` Matthieu Moy
2013-04-05 13:16             ` [PATCH v3 " Simon Ruderich
2013-04-05 17:31               ` 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=20130404174301.GA13005@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=simon@ruderich.org \
    /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).