mirror of
https://github.com/rocky-linux/sig-cloud-instance-images.git
synced 2024-11-01 02:41:24 +00:00
21 lines
394 B
Bash
21 lines
394 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
base="$1"
|
||
|
compare="${2-$(git rev-parse --abbrev-ref HEAD)}"
|
||
|
file=${3:-packages.txt}
|
||
|
|
||
|
usage () {
|
||
|
echo "$0: <from> [to] (defaults to current HEAD)"
|
||
|
exit
|
||
|
}
|
||
|
|
||
|
if [[ -z $base || -z $compare ]]; then
|
||
|
usage
|
||
|
fi
|
||
|
|
||
|
git diff "${base}:${file}" "${compare}:${file}" \
|
||
|
| grep -E '^([+-]\w)' \
|
||
|
| awk '!(NR%2){print substr(p,2,length(p)),"=>",substr($0,2,length($0))}{p=$0}'\
|
||
|
| column -t
|
||
|
|