Documentation: minor cleanups to branch/checkout wording
[gitweb.git] / git-filter-branch.sh
old mode 100755 (executable)
new mode 100644 (file)
index bfd118c..a2fcebc
 #
 #      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