Thread (8 messages) flat view 8 messages, 3 authors, 2016-06-15

Re: is it possible filter the revision history of a single file into another repository?

From: Thomas Jarosch <hidden>
Date: 2016-06-15 22:45:48

On Friday, 19. December 2008 14:08:23 Whit Armstrong wrote:
thanks, Thomas. I could definitely pull from your tree.  seems like
the path of least resistance to get my repo split.
Here's the patch I use for git 1.6.0.5. According to Junio
it has the small drawback of always writing out the index,
even if there are no changes.

If you need an updated patch against HEAD, look for Junio's reply
to my patch in the list archive.

Enjoy,
Thomas

Signed-off-by: Thomas Jarosch <redacted>
--- git-1.6.0.5/builtin-update-index.c	2008-12-08 02:21:49.000000000 +0100
+++ git-1.6.0.5.index/builtin-update-index.c	2008-12-13 12:43:14.000000000 
+0100
@@ -297,6 +297,8 @@ static void read_index_info(int line_ter
 	struct strbuf buf;
 	struct strbuf uq;
 
+	int found_something = 0;
+
 	strbuf_init(&buf, 0);
 	strbuf_init(&uq, 0);
 	while (strbuf_getline(&buf, stdin, line_termination) != EOF) {
@@ -307,6 +309,8 @@ static void read_index_info(int line_ter
 		unsigned long ul;
 		int stage;
 
+		found_something = 1;
+
 		/* This reads lines formatted in one of three formats:
 		 *
 		 * (1) mode         SP sha1          TAB path
@@ -382,6 +386,11 @@ static void read_index_info(int line_ter
 	bad_line:
 		die("malformed index info %s", buf.buf);
 	}
+
+	/* Force creation of empty index - needed by git filter-branch */
+	if (!found_something)
+		active_cache_changed = 1;
+
 	strbuf_release(&buf);
 	strbuf_release(&uq);
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help