Skip to content

Instantly share code, notes, and snippets.

@ceving
Last active January 23, 2017 10:20
Show Gist options
  • Save ceving/3fbabb9c62ae9c62d94bb97f26eb00a3 to your computer and use it in GitHub Desktop.
Save ceving/3fbabb9c62ae9c62d94bb97f26eb00a3 to your computer and use it in GitHub Desktop.
Display added and deleted files in a Fossil repository.
#! /bin/bash
##
## Display added and deleted files in a Fossil repository.
##
set -eu
prev_id=
fossil timeline -n 0 "$@" |
sed -n 's/^..:..:.. \[\([0-9a-f]*\)\] .*/\1/p' |
while read id; do
if [ "$prev_id" ]; then
diff <(fossil ls -r "$id" "$@"|sort) <(fossil ls -r "$prev_id" "$@"|sort) |
egrep '^[<>]' |
sed 's/^>/add/;s/^</del/' |
sed "s/^/$id /"
fi
prev_id=$id
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment