From: Gesh <gesh@gesh.uni.cx>
To: git@vger.kernel.org
Subject: Handling of improperly-configured custom diff drivers is confusing
Date: Fri, 24 Oct 2025 02:29:47 +0300 [thread overview]
Message-ID: <ok3e53h6kxxv4ukvwe4e6bac24ph5oykffrc26fqmwkrltm25e@byvhfqgfygsv> (raw)
Hi,
After investigating what I thought was a git bug, I ultimately found it was due
to my misconfiguring the diff.pdf driver. In particular, I had (years ago now)
misread either the git docs or the pdftotext manual, because I had naively
configured
diff.pdf.textconv = pdftotext
Unfortunately, pdftotext's default behaviour is to write the text to a new file,
not stdout -- the correct configuration is
diff.pdf.textconv = sh -c 'pdftotext "$0" -'
All this is well and good, and thankfully this episode has left me with a better
configuration. Although, it would perhaps be nice to have git warn on a textconv
configuration that was constantly emitting an empty file for existent files.
Moreover, my investigation yielded some surprising (and underdocumented?)
information:
- It appears that triggering a textconv driver with cachetextconv set generates
a commit. I caught this because I configure the user information per-repo, so
diff was complaining the user wasn't configured
- Custom diff drivers are run in a temp directory subsequently rmdir'd by git.
In particular, they _can_ write to disk, but must cleanup after themselves.
Caught this because my configuration *was* leaving files around -- but git
only complained it couldn't rmdir.
- git diff and git log crash if in the course of printing a custom diff driver
crashes. In particular, they cut off printing. This was useful, because it
meant I actually bumped into this bug, instead of it slipping my notice as I
jumped in the output to the tag I was interested in.
- git log --simplify-by-decoration seems to generate some sort of squash commit
of all the commits between two nodes it prints, but display them under the
existing SHA. I think this was the first time I used simplify-by-decoration
this thoroughly, so I hadn't noticed this before.
Not sure how much of this is actionable -- it ultimately ended up being my
fault, but I'd've appreciated clearer diagnostic messages and clarifications in
the docs.
Either way, hope this is useful to someone.
Gesh
reply other threads:[~2025-10-23 23:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ok3e53h6kxxv4ukvwe4e6bac24ph5oykffrc26fqmwkrltm25e@byvhfqgfygsv \
--to=gesh@gesh.uni.cx \
--cc=git@vger.kernel.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).