summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0f2890a)
raw | patch | inline | side by side (parent: 0f2890a)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Thu, 21 Jun 2007 17:05:30 +0000 (18:05 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 23 Jun 2007 06:20:44 +0000 (23:20 -0700) |
This is based on Jeff King's example in
20070621130137.GB4487@coredump.intra.peff.net
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20070621130137.GB4487@coredump.intra.peff.net
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-filter-branch.sh | [changed mode: 0755->0644] | patch | blob | history |
t/t7003-filter-branch.sh | patch | blob | history |
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
#
# 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
index 0fabe4904f7bfb942ba24287862d054e9a4d174c..f00c262e450f9ba23b8e065bce2e4780185821af 100755 (executable)
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
! git show sub:subdir
'
+test_expect_success 'use index-filter to move into a subdirectory' '
+ 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 &&
+ test -z "$(git diff HEAD directorymoved:newsubdir)"'
+
test_done