Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
95 lines (88 sloc) 3.9 KB
name: icdiff
base: core18
summary: terminal side-by-side colorized word diff
license: Python-2.0
description: >-
Your terminal can display color, but most diff tools don't make good
use of it. By highlighting changes, icdiff can show you the
differences between similar files without getting in the way. This
is especially helpful for identifying and understanding small
changes within existing lines.
Instead of trying to be a diff replacement for all circumstances,
the goal of icdiff is to be a tool you can reach for to get a better
picture of what changed when it's not immediately obvious from diff.
adopt-info: icdiff # look for snapcraftctl set-* in the icdiff part
# personal-files won't auto-connect without going through the "Process for
# aliases, auto-connetions and tracks",
# like so:
# During testing, "snap connect icdiff:gitconfig" should work
interface: personal-files
- $HOME/.gitconfig # the old location
- $HOME/.config/git/config # the new location (people could change it via XDG_CONFIG_HOME and that isn't supported by snapd yet)
command: usr/bin/icdiff
- home # so it can acess files under the user's home
- removable-media # so it can access things in /media, etc
adapter: none # just call straight into command (no wrapper nor chain needed)
# If you're getting it from the store you'll have an automatic alias
# (because
# During testing, "snap alias icdiff.git-icdiff git-icdiff" should work
command: usr/bin/git-icdiff
# there's perl somewhere in the pipeline, and it gets shouty without this
# (this is _not_ just for the call to perl we're adding to unset HOME)
- home # so it can acess files under the user's home
- removable-media # so it can access things in /media, etc
- gitconfig # so it can access ~/.gitconfig :-)
adapter: full # use the new-style explicit command-chain (avoids a wrapper, and is nicer to debug)
grade: stable
confinement: strict
plugin: nil
override-pull: |
# this adds the git-core ppa, so we always get the latest stable git
# See more here:
apt --quiet -o Dpkg::Progress-Fancy=false install -y software-properties-common
add-apt-repository -y ppa:git-core
apt --quiet -o Dpkg::Progress-Fancy=false update
plugin: dump
after: [ppa]
source: .
override-pull: |
# do the usual pull stuff
snapcraftctl pull
# core18 doesn't have 'python', rewrite shebang to use python3 (and make it a bit faster while we're at it)
sed -i '1s|^#!.*|#!/usr/bin/python3 -SIB|' icdiff
# snapd tries to be helpful by pointing $HOME elsewhere
sed -i '1s/.*/&\nexport HOME=\$(perl -we "print((getpwuid $>)[7])")/' git-icdiff
# set the version from __version__
snapcraftctl set-version "$( /usr/bin/python3 -c 'import icdiff; print(icdiff.__version__)' )"
- git
# move things around so they're tidier
usr/lib/git-core/git-mergetool--lib: usr/bin/git-mergetool--lib
usr/lib/git-core/git-difftool--helper: usr/bin/git-difftool--helper
icdiff: usr/bin/icdiff
git-icdiff: usr/bin/git-icdiff
# only pull in the things we need. This is risky: there might be more
# needed, some corner case needing other libs or helpers; fix as those
# are found; the alternative is to ship everything which would make the
# snap unnecessarily huge.
- usr/bin/icdiff
- usr/bin/git-icdiff
- usr/bin/git
- usr/bin/git-mergetool--lib
- usr/bin/git-difftool--helper
- "**/*"
You can’t perform that action at this time.