summaryrefslogtreecommitdiff
path: root/remove_legacy_dup.sh
blob: 0633c26e8fa43bc7d3587fbd94424e6f9a392f1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

#cat /tmp/modifies | while read dir
git log -C -C -M -M --name-status $GIT_COMMIT^..$GIT_COMMIT | while read dir
do
   DELFILE="$(echo $dir | sed -n 's/^C\S*\s*\(legacy.*\)$/\1/pg' | grep -v '\s\+legacy/' | grep -v 'Makefile\.am' | cut -d' ' -f1)"
   # If empty, continue.
   [ -z "$DELFILE" ] && continue
   echo "$DELFILE" >> /tmp/future_dels
done

if [ -f /tmp/future_dels ]; then
   cat /tmp/future_dels | xargs git rm --cached --ignore-unmatch -q
fi

true