Last active
January 23, 2017 10:20
-
-
Save ceving/3fbabb9c62ae9c62d94bb97f26eb00a3 to your computer and use it in GitHub Desktop.
Display added and deleted files in a Fossil repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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