{"thread":{"id":"8675","subject":"[PATCH] filter-branch: add example to move everything into a subdirectory","startedAt":"2007-06-21T17:05:30Z","lastAt":"2007-06-23T11:03:00Z","messageCount":3,"participants":["Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"45517","messageId":"Pine.LNX.4.64.0706211805010.4059@racer.site","threadId":"8675","inReplyTo":null,"subject":"[PATCH] filter-branch: add example to move everything into a subdirectory","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-06-21T17:05:30Z","receivedAt":"2007-06-21T17:05:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThis is based on Jeff King's example in\n\n\t20070621130137.GB4487@coredump.intra.peff.net\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-filter-branch.sh     |    8 ++++++++\n t/t7003-filter-branch.sh |    8 ++++++++\n 2 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex ffb31d6..297e09e 100644\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -181,6 +181,14 @@\n #\n #\tgit-filter-branch ... new-H C..H --not D\n #\tgit-filter-branch ... new-H D..H --not C\n+#\n+# To move the whole tree into a subdirectory, or remove it from there:\n+#\n+# git-filter-branch --index-filter \\\n+#\t'git-ls-files -s | sed \"s-\\t-&newsubdir/-\" |\n+#\t\tGIT_INDEX_FILE=$GIT_INDEX_FILE.new \\\n+#\t\t\tgit-update-index --index-info &&\n+#\t mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' directorymoved\n \n # Testsuite: TODO\n \ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 0fabe49..f00c262 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -99,4 +99,12 @@ test_expect_success 'subdirectory filter result looks okay' '\n \t! git show sub:subdir\n '\n \n+test_expect_success 'use index-filter to move into a subdirectory' '\n+\tgit-filter-branch --index-filter \\\n+\t\t \"git-ls-files -s | sed \\\"s-\\\\t-&newsubdir/-\\\" |\n+\t          GIT_INDEX_FILE=\\$GIT_INDEX_FILE.new \\\n+\t\t\tgit-update-index --index-info &&\n+\t\t  mv \\$GIT_INDEX_FILE.new \\$GIT_INDEX_FILE\" directorymoved &&\n+\ttest -z \"$(git diff HEAD directorymoved:newsubdir)\"'\n+\n test_done\n-- \n1.5.2.2.2822.g027a6-dirty\n"},{"id":"45593","messageId":"7vwsxv8a1a.fsf@assigned-by-dhcp.pobox.com","threadId":"8675","inReplyTo":"Pine.LNX.4.64.0706211805010.4059@racer.site","subject":"Re: [PATCH] filter-branch: add example to move everything into a subdirectory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-23T06:22:41Z","receivedAt":"2007-06-23T06:22:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> diff --git a/git-filter-branch.sh b/git-filter-branch.sh\n> index ffb31d6..297e09e 100644\n> --- a/git-filter-branch.sh\n> +++ b/git-filter-branch.sh\n> @@ -181,6 +181,14 @@\n\nKeeping your private repository out of sync with me is Ok, but\ncan you fix the filemode when you have chance?  The warning I\nget every time I apply a patch from you to this file about mode\nmismatch somewhat annoys me.\n\nThanks.\n"},{"id":"45602","messageId":"Pine.LNX.4.64.0706231201440.4059@racer.site","threadId":"8675","inReplyTo":"7vwsxv8a1a.fsf@assigned-by-dhcp.pobox.com","subject":"Re: [PATCH] filter-branch: add example to move everything into a subdirectory","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-06-23T11:03:00Z","receivedAt":"2007-06-23T11:03:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 22 Jun 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > diff --git a/git-filter-branch.sh b/git-filter-branch.sh\n> > index ffb31d6..297e09e 100644\n> > --- a/git-filter-branch.sh\n> > +++ b/git-filter-branch.sh\n> > @@ -181,6 +181,14 @@\n> \n> Keeping your private repository out of sync with me is Ok, but can you \n> fix the filemode when you have chance?  The warning I get every time I \n> apply a patch from you to this file about mode mismatch somewhat annoys \n> me.\n\nI am sorry! I did not even realize that I was _so_ out of sync. ATM AFAICT \nthere is only the \"skip\" hack in my repo.\n\nCiao,\nDscho\n"}]}