Add filtering script

Simon Bruder 2023-05-09 23:11:02 +02:00
parent b3a9d83d10
commit 83f953f8d8
1 changed files with 8 additions and 0 deletions

8
filter.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later
set -euo pipefail
export FILTER_BRANCH_SQUELCH_WARNING=1
git branch -D filtered
git switch -c filtered
git filter-branch -f --tree-filter "rm -f $(rg --files-without-match 'SPDX-License-Identifier: (L)?GPL-3.0-or-later' -g '/u??/**/*' | tr '\n' ' ')" HEAD
git switch -