From: Oleg Broytman Date: Tue, 25 Jun 2024 23:31:00 +0000 (+0300) Subject: Add `filter-branch-all` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;ds=sidebyside;h=refs%2Fheads%2Fmaster;hp=f483adb65ce3845a400488bd289eb3b6eac4b53a;p=git-scripts.git Add `filter-branch-all` --- diff --git a/filter-branch-all b/filter-branch-all new file mode 100755 index 0000000..6a4abb3 --- /dev/null +++ b/filter-branch-all @@ -0,0 +1,7 @@ +#! /bin/sh + +# Just a reminder how to properly run `git filter-branch --all` + +FILTER_BRANCH_SQUELCH_WARNING=1 exec git filter-branch \ + --tag-name-filter cat "$@" -- --branches --tags + diff --git a/submodules/remove b/submodules/remove index 1db57c2..f9436ce 100755 --- a/submodules/remove +++ b/submodules/remove @@ -1,8 +1,12 @@ #! /bin/sh # See https://stackoverflow.com/q/1260748/7976758 +case "$1" in + -c|--cached) cached=--cached; shift ;; +esac && + if [ $# != 1 ]; then - echo "Usage: $0 submodule_name" >&2 + echo "Usage: $0 [-c|--cached] submodule_name" >&2 exit 1 fi @@ -21,7 +25,7 @@ if [ -z "$path" ]; then exit 1 fi -git rm "$path" && +git rm $cached "$path" && rm -rf "`git rev-parse --git-dir`"/modules/"$name" && git config --remove-section submodule."$name" &&