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

# Used to detect when we cp-moved and not mv-moved. This could break git log --follow and the such. Need to remove the originals.
# Merging the EFL repo caused all of that.

#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