Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document how to use xmldiff with GIT_EXTERNAL_DIFF #88

Open
dkg opened this issue May 13, 2022 · 1 comment
Open

document how to use xmldiff with GIT_EXTERNAL_DIFF #88

dkg opened this issue May 13, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@dkg
Copy link

dkg commented May 13, 2022

For a git repository that tracks xml files, it would be great to have an easy way to use git to see what the differences are.

A section in the documentation with a recipe about how to apply xmldiff to specific files in a git repository when viewing changes would be very useful, even (especially?) if the documentation is simple.

I tried the simple:

in .gitattributes:

*.xml diff=xml

and in .git/config:

[diff "xml"]
      command = xmldiff

but that produced this error:

usage: xmldiff [-h] [-v] [-f {diff,xml,old}] [-w] [-p] [-F F] [--unique-attributes [UNIQUE_ATTRIBUTES]] [--ratio-mode {accurate,faster,fast}] [--fast-match] file1 file2
xmldiff: error: unrecognized arguments: 00065406b95a72188e41ab1165bbd8d7aa58562f 100644 assignments/pgp-parameters/pgp-parameters.xml 0000000000000000000000000000000000000000 100644
fatal: external diff died, stopping at assignments/pgp-parameters/pgp-parameters.xml

I think the answer has to do with the GIT_EXTERNAL_DIFF command as described in git(1), but i haven't sorted it out yet.

Maybe a different cli entry point that knows how to handle GIT_EXTERNAL_DIFF would be good?

@regebro
Copy link
Contributor

regebro commented Jan 11, 2023

For that to be useful you need a formatter that outputs a human-readable diff that is better and more easy to read than a text diff. If someone wants to contribute that, then making a special git entry point should be relatively easy.

@regebro regebro added the enhancement New feature or request label Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants