AKSW / QuitDiff

Command line comparison tool for semantic web data, it can be used as git difftool for RDF data as well.
GNU General Public License v3.0
7 stars 2 forks source link
command-line-tool diff python rdf turtle

Quit Diff

Requirements

For using QuitDiff you need to have python version 3 installed (3.9 or later).

To install the required packages use pip:

pipx install quit-diff

Use as git-difftool

Add one of the following sections to you ~/.gitconfig (in your home directory) or .git/config (in your git working directory).

[difftool "quit-diff"]
    cmd = quit-diff --base=\"$BASE\" \"$LOCAL\" \"$REMOTE\"

The git diff tool can then called with one of the following commands

$ git difftool -t quit-diff
$ git difftool -t quit-diff HEAD~0..HEAD~2

To specify the diff format you can set the QUIT_DIFF_FORMAT environment variable.

$ QUIT_DIFF_FORMAT=changeset git difftool -t quit-diff HEAD^
$ QUIT_DIFF_FORMAT=sparql git difftool -t quit-diff HEAD^
$ QUIT_DIFF_FORMAT=eccrev git difftool -t quit-diff HEAD^

Use as git diff

Add the following sections to you ~/.gitconfig (in your home directory) or .git/config (in your git working directory).

[diff "quit-diff"]
    command = quit-diff

and the following to .gitattributes (in your git working directory).

*.nq diff=quit-diff
*.trig diff=quit-diff
*.nt diff=quit-diff
*.ttl diff=quit-diff
*.rdf diff=quit-diff

git diff can then called with one of the following commands

$ git diff
$ git diff HEAD~0..HEAD~2

Command line parameters

This tool can be used for git-diff or as git-difftool

git-diff:

if using as git-diff, the parameters are: path old-file old-hex old-mode new-file new-hex new-mode

git-difftool:

https://git-scm.com/docs/git-difftool

License

Copyright (C) 2024 Natanael Arndt http://aksw.org/NatanaelArndt and Norman Radtke http://aksw.org/NormanRadtke

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses. Please see LICENSE for further information.