X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-filter-branch.sh;h=a2fcebc1c63082db03445b65e340286d0c129903;hb=71e55854fd6e5c9ce786bcd20efef43bd56f9df0;hp=cb43b59740e763da922ac93cd1fbace64c07acab;hpb=813b4734fcb82e541658b33b8563387c197d6247;p=git.git diff --git a/git-filter-branch.sh b/git-filter-branch.sh old mode 100755 new mode 100644 index cb43b5974..a2fcebc1c --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -178,6 +178,14 @@ # # git-filter-branch ... new-H C..H --not D # git-filter-branch ... new-H D..H --not C +# +# To move the whole tree into a subdirectory, or remove it from there: +# +# git-filter-branch --index-filter \ +# 'git-ls-files -s | sed "s-\t-&newsubdir/-" | +# GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ +# git-update-index --index-info && +# mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' directorymoved # Testsuite: TODO @@ -304,9 +312,10 @@ case "$GIT_DIR" in /*) ;; *) - export GIT_DIR="$(pwd)/../../$GIT_DIR" + GIT_DIR="$(pwd)/../../$GIT_DIR" ;; esac +export GIT_DIR GIT_WORK_TREE=. export GIT_INDEX_FILE="$(pwd)/../index" git-read-tree # seed the index file @@ -323,7 +332,7 @@ case "$filter_subdir" in ;; *) git-rev-list --reverse --topo-order --default HEAD \ - --parents "$@" -- "$filter_subdir" + --parents --full-history "$@" -- "$filter_subdir" esac > ../revs commits=$(cat ../revs | wc -l | tr -d " ")