This repository has been archived on 2024-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
ecg-prog-filtered/filter.sh
2023-05-18 09:42:01 +02:00

10 lines
372 B
Bash
Executable file

#!/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|MIT)' -g '/u??/**/*' | tr '\n' ' ')" HEAD
git push -f -u filtered filtered
git switch -