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

Re: [PATCH 1/2] diffcore-pickaxe: respect --no-textconv

From
Jeff King <peff@peff.net>
Date
Apr 4, 2013, 17:43 UTC
Message-ID
<20130404174301.GA13005@sigill.intra.peff.net>
In-Reply-To
<20130404160359.GA25232@ruderich.org>
On Thu, Apr 04, 2013 at 06:03:59PM +0200, Simon Ruderich wrote:
Show 9 quoted lines
> 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.

Show 9 quoted lines
> > 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...
Show 10 quoted lines
> 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
Previous: Matthieu MoyNext: Junio C Hamano
Message 4 of 27 in “[BUG] git log -S not respecting --no-textconv”
  1. Matthieu MoyApr 4, 2013
  2. 1/2 diffcore-pickaxe: respect --no-textconvSimon Ruderich, Apr 4, 2013
  3. Matthieu MoyApr 4, 2013
  4. Jeff KingApr 4, 2013
  5. Junio C HamanoApr 4, 2013
  6. Jeff KingApr 4, 2013
  7. Junio C HamanoApr 4, 2013
  8. 1/3 diffcore-pickaxe: remove unnecessary call to get_textconv()Simon Ruderich, Apr 4, 2013
  9. Junio C HamanoApr 4, 2013
  10. Junio C HamanoApr 4, 2013
  11. Jeff KingApr 4, 2013
  12. Junio C HamanoApr 4, 2013
  13. Simon RuderichApr 5, 2013
  14. 2/3 diffcore-pickaxe: remove fill_one()Simon Ruderich, Apr 4, 2013
  15. Jeff KingApr 5, 2013
  16. Junio C HamanoApr 5, 2013
  17. 1/3 diffcore-pickaxe: port optimization from has_changes() to diff_grep()Junio C Hamano, Apr 5, 2013
  18. 2/3 diffcore-pickaxe: fix leaks in "log -S<block>" and "log -G<pattern>"Junio C Hamano, Apr 5, 2013
  19. 3/3 diffcore-pickaxe: unify setup and teardown code between log -S/-GJunio C Hamano, Apr 5, 2013
  20. Jeff KingApr 5, 2013
  21. Junio C HamanoApr 5, 2013
  22. Jeff KingApr 5, 2013
  23. Junio C HamanoApr 5, 2013
  24. 3/3 diffcore-pickaxe: respect --no-textconvSimon Ruderich, Apr 4, 2013
  25. Matthieu MoyApr 5, 2013
  26. 3/3 diffcore-pickaxe: respect --no-textconvSimon Ruderich, Apr 5, 2013
  27. Junio C HamanoApr 5, 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.