{"thread":{"id":"66201","subject":"Questions about --ext-diff","startedAt":"2026-08-21T11:18:31Z","lastAt":"2026-08-24T20:25:38Z","messageCount":3,"participants":["Anselm Schüler","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"551000","messageId":"1c1567ec-c81a-45be-8b92-2c995dd34c16@anselmschueler.com","threadId":"66201","inReplyTo":null,"subject":"Questions about --ext-diff","fromName":"Anselm Schüler","fromEmail":"mail@anselmschueler.com","sentAt":"2026-08-21T11:13:13Z","receivedAt":"2026-08-21T11:18:31Z","isPatch":false,"body":"I’m unsure what the purpose of --ext-diff is. It seems to me that custom \ndiff filters should just always be executed.\n\nIs --ext-diff a security feature? It seems like it isn’t, since git-diff \nwill happily execute the diff filter.\n\nMaybe I don’t correctly understand what a diff filter is intended to be \nused for. What situation would you want a diff filter to be run by \ngit-diff, but not by e.g. git-show?\n\n~Anselm Schüler <mail@anselmschueler.com>\n\n"},{"id":"551146","messageId":"20260824182302.GA177524@coredump.intra.peff.net","threadId":"66201","inReplyTo":"1c1567ec-c81a-45be-8b92-2c995dd34c16@anselmschueler.com","subject":"Re: Questions about --ext-diff","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-08-24T18:23:02Z","receivedAt":"2026-08-24T18:23:04Z","isPatch":false,"body":"On Fri, Aug 21, 2026 at 01:13:13PM +0200, Anselm Schüler wrote:\n\n> I’m unsure what the purpose of --ext-diff is. It seems to me that custom\n> diff filters should just always be executed.\n> \n> Is --ext-diff a security feature? It seems like it isn’t, since git-diff\n> will happily execute the diff filter.\n> \n> Maybe I don’t correctly understand what a diff filter is intended to be used\n> for. What situation would you want a diff filter to be run by git-diff, but\n> not by e.g. git-show?\n\nThe external diff is free to do whatever it likes; it doesn't even have\nto generate text output. It could open a gui window, for example. So it\nmay be surprising if you run git-log and suddenly dozens of windows open\nas we walk through history.\n\nFor git-show, there's certainly an argument that it ought to use the\nsame default as git-diff (since we are showing about one commit's worth\nof diffs in either case). I suspect nobody really though much about it,\nand as git-show is implemented as (roughly) \"git log --no-walk\" under\nthe hood, it inherited the defaults to disallow external diffs.\n\nFor many cases, I think textconv is a better experience. It is less\nflexible (you must be able to transform the binary into something\ntextual, which is then diffed). But because of that it fits more neatly\ninto existing commands. I may be biased as the author of textconv,\nthough. ;)\n\n-Peff\n"},{"id":"551152","messageId":"xmqq33w3qn9b.fsf@gitster.g","threadId":"66201","inReplyTo":"20260824182302.GA177524@coredump.intra.peff.net","subject":"Re: Questions about --ext-diff","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-08-24T20:25:36Z","receivedAt":"2026-08-24T20:25:38Z","isPatch":false,"body":"Jeff King <peff@peff.net> writes:\n\n> For many cases, I think textconv is a better experience. It is less\n> flexible (you must be able to transform the binary into something\n> textual, which is then diffed). But because of that it fits more neatly\n> into existing commands. I may be biased as the author of textconv,\n> though. ;)\n\nAs the author of ext-diff, I very much agree.  The daily maintenance\nof the drafts of \"What's cooking\" report is very much the only thing\nthat I find a custom --ext-diff program very useful, but I suspect\nthat even its use can probably be substituted with creative use of\nthe textconv filter, diff hunk header patterns, and the -W option.\n\n"}]}