From a1f8720e74219f9fd4c74ceebd7c33e94e90a2ba Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Tue, 9 May 2023 23:11:02 +0200 Subject: [PATCH] Add filtering script --- filter.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 filter.sh diff --git a/filter.sh b/filter.sh new file mode 100755 index 0000000..8189afb --- /dev/null +++ b/filter.sh @@ -0,0 +1,9 @@ +#!/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 push -f -u filtered filtered +git switch -