14 lines
436 B
Fish
14 lines
436 B
Fish
function gdd --description "Use difftastic as a difftool"
|
|
if not test -d .git
|
|
echo "Not a git repository"
|
|
return 0
|
|
end
|
|
|
|
if count $argv >/dev/null
|
|
git difftool --tool=difftastic $argv
|
|
else
|
|
set default (git symbolic-ref refs/remotes/origin/HEAD | awk -F'/' '{print $4}')
|
|
set current (git branch --show-current)
|
|
git difftool --tool=difftastic $default...$current
|
|
end
|
|
end
|