git-annex-diffdriver(1)

πŸ“¦
version 10.20261026 Β· 3 versions
, in alpine 3.24, arch rolling, debian trixie, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ git-annex-diffdriver ✨</p>

git-annex-diffdriver β€” ok bestie, it's literally just a git diff driver πŸŽ€ (from the General Commands Manual, no less)


🌸 SYNOPSIS 🌸

git annex diffdriver [--get,--text] [-- --diffopts --]

git annex diffdriver -- cmd --cmdopts --

πŸ’… DESCRIPTION πŸ’…

okay so picture this: normally when you run git diff on annexed files, all it shows you is the changes that are staged in git β€” think annex symlinks and pointer files. boring!! πŸ™ˆ This command is the glow-up: it lets git diff actually diff the content of your annexed files instead. main character energy fr fr πŸ‘‘

You can use it two ways, and both are iconic:

  • as a simple text differ, or
  • as a shim that runs an external git diff driver πŸ¦‹

If some of your annexed files are textual in form, and can be usefully diffed with diff(1), you can configure git to use this command to diff them. The way that you do it: configure .gitattributes to contain eg

*.txt diff=annextextdiff

and then set

git config diff.annextextdiff.command "git annex diffdriver --text"

slay. πŸ’–

But bestie, if your annexed files are not textual in form, you're gonna need an external diff driver program that's able to diff the file format(s) you use. Go read git's documentation of GIT_EXTERNAL_DIFF and gitattributes(5)'s documentation of external diff drivers β€” iykyk πŸ“š

Here's the tea πŸ“: normally, when you use git diff with an external diff driver, it will not see the contents of annexed files, because git passes to it the git-annex symlinks or pointer files. Not the vibe. This command works around the problem by running the real external diff driver and passing it the paths to the annexed content. πŸ’«

So configure git to use

git-annex diffdriver -- cmd params --

as the external diff driver, where cmd is the external diff driver you want it to run, and params are any extra parameters to pass to it.

⚠️ Note the trailing --. It is required. Do not skip it, I am begging you 😭

For example, to use the j-c-diff program as the external diff driver, set:

GIT_EXTERNAL_DIFF="git-annex diffdriver -- j-c-diff --"

periodt. πŸ’…


✨ OPTIONS ✨

  • --get β€” use this to get the contents of annexed files from remotes when they're not already present. Heads up though: the file contents will remain in the repository for later use until dropped in the usual ways. 🫢
  • --text β€” use this to diff text files with diff(1). And if you wanna pass additional options to diff(1), do it like eg "--text -- --color --" 🌈
  • external diff driver mode β€” to use an external diff driver command, the options must start with --, followed by the diff driver command, its options, and another --. 🌟

Also the git-annex-common-options(1) can be used. πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘


🌼 AUTHOR 🌼

Joey Hess <id@joeyh.name> β€” king behavior, honestly πŸ’–


and that's the whole page, bestie!! πŸŽ€ this was git-annex-diffdriver(1) from the General Commands Manual, written by Joey Hess <id@joeyh.name>, and the footer just said git-annex-diffdriver(1) again like the little echo it is. go forth and diff your annex content, you absolute icon πŸ¦‹βœ¨πŸ’