diffdriver: Added --text option for easy diffing of the contents of annexed text files
This was already possible, but it was rather hard to come up with the complex shell command needed. Note that the diff output starts with "diff a/... b/...". I left off the "--git" because it's not a git format diff.
This commit is contained in:
parent
2c18fc1d60
commit
d5c6197791
6 changed files with 98 additions and 26 deletions
|
@ -25,3 +25,5 @@ What do you think?
|
|||
Cheers, Yann
|
||||
|
||||
PS: Thank you very much for git-annex, it's awesome! I'm giving a git-annex workshop next weekend [@Tuebix](https://cfp.tuebix.org/tuebix-2023/talk/review/GWRP3UKE3VFKVDG8RNQ8ZZPCZPNZYYWM), really looking forward to it.
|
||||
|
||||
> [[fixed|done]] --[[Joey]]
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
[[!comment format=mdwn
|
||||
username="joey"
|
||||
subject="""comment 1"""
|
||||
date="2023-06-28T17:43:19Z"
|
||||
content="""
|
||||
This works:
|
||||
|
||||
echo * diff=text >>.gitattributes
|
||||
git config diff.text.command "git-annex diffdriver -- sh -c 'echo diff a/\$0 b/\$0; echo \$0; diff -u \$1 \$4 || true' --"
|
||||
|
||||
Unfortunatly, the textconv approach will not work for locked files, because
|
||||
git does not apply the textconv to symlinks. It could be made to work for
|
||||
unlocked files but the above works for all annexed files.
|
||||
|
||||
diffing like this is only useful on text files, and most annexed files
|
||||
are not text files. That's why the diffdriver command focuses on using some
|
||||
external diff driver that knows how to diff whatever type of binary file is
|
||||
being stored in git-annex. So this should certianly not be enabled by
|
||||
default. It makes sense to enable it in .gitattributes when you have
|
||||
annexed some textual files.
|
||||
|
||||
That command is a bit hard to come up with, with the complex shell quoting.
|
||||
So rather than try to document it, I made an easier way to do the same
|
||||
thing:
|
||||
|
||||
echo * diff=text >>.gitattributes
|
||||
git config diff.text.command "git annex diffdriver --text"
|
||||
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue