git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] filter-branch: add example to move everything into a subdirectory
@ 2007-06-21 17:05 Johannes Schindelin
  2007-06-23  6:22 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2007-06-21 17:05 UTC (permalink / raw)
  To: Jeff King, git, gitster


This is based on Jeff King's example in

	20070621130137.GB4487@coredump.intra.peff.net

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 git-filter-branch.sh     |    8 ++++++++
 t/t7003-filter-branch.sh |    8 ++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index ffb31d6..297e09e 100644
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -181,6 +181,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
 
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 0fabe49..f00c262 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -99,4 +99,12 @@ test_expect_success 'subdirectory filter result looks okay' '
 	! 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
-- 
1.5.2.2.2822.g027a6-dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] filter-branch: add example to move everything into a subdirectory
  2007-06-21 17:05 [PATCH] filter-branch: add example to move everything into a subdirectory Johannes Schindelin
@ 2007-06-23  6:22 ` Junio C Hamano
  2007-06-23 11:03   ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2007-06-23  6:22 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jeff King, git, gitster

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> diff --git a/git-filter-branch.sh b/git-filter-branch.sh
> index ffb31d6..297e09e 100644
> --- a/git-filter-branch.sh
> +++ b/git-filter-branch.sh
> @@ -181,6 +181,14 @@

Keeping your private repository out of sync with me is Ok, but
can you fix the filemode when you have chance?  The warning I
get every time I apply a patch from you to this file about mode
mismatch somewhat annoys me.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] filter-branch: add example to move everything into a subdirectory
  2007-06-23  6:22 ` Junio C Hamano
@ 2007-06-23 11:03   ` Johannes Schindelin
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2007-06-23 11:03 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git

Hi,

On Fri, 22 Jun 2007, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > diff --git a/git-filter-branch.sh b/git-filter-branch.sh
> > index ffb31d6..297e09e 100644
> > --- a/git-filter-branch.sh
> > +++ b/git-filter-branch.sh
> > @@ -181,6 +181,14 @@
> 
> Keeping your private repository out of sync with me is Ok, but can you 
> fix the filemode when you have chance?  The warning I get every time I 
> apply a patch from you to this file about mode mismatch somewhat annoys 
> me.

I am sorry! I did not even realize that I was _so_ out of sync. ATM AFAICT 
there is only the "skip" hack in my repo.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-06-23 11:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-21 17:05 [PATCH] filter-branch: add example to move everything into a subdirectory Johannes Schindelin
2007-06-23  6:22 ` Junio C Hamano
2007-06-23 11:03   ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).