-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix optimisation bug for compose filter (#1159)
The optimiser incorrectly transformed :[:/y,:/x/y] into :[:/,:/x]:/y This is not correct because :/y is more restrictive than :/ and will therefore not match all the files that :/ does. Due to the compose filter guaranteeing uniqueness of mappings the led to files missing from the first filter. Change: fix-opt-bug
- Loading branch information
1 parent
a1c4ba4
commit fc857af
Showing
51 changed files
with
254 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
$ export TESTTMP=${PWD} | ||
|
||
$ cd ${TESTTMP} | ||
$ git init -q real_repo 1> /dev/null | ||
$ cd real_repo | ||
|
||
$ mkdir sub1 | ||
$ echo contents1 > sub1/file1 | ||
$ git add sub1 | ||
$ git commit -m "add file1" 1> /dev/null | ||
|
||
$ mkdir xx | ||
$ echo contents1 > xx/file2 | ||
$ git add xx | ||
$ git commit -m "add file2" 1> /dev/null | ||
|
||
$ mkdir -p sub/xx | ||
$ echo contents1 > sub/xx/file3 | ||
$ echo contents1 > sub/xx/file4 | ||
$ git add sub | ||
$ git commit -m "add file3" 1> /dev/null | ||
|
||
$ git diff ${EMPTY_TREE}..HEAD | ||
diff --git a/sub/xx/file3 b/sub/xx/file3 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/sub/xx/file3 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
diff --git a/sub/xx/file4 b/sub/xx/file4 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/sub/xx/file4 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
diff --git a/sub1/file1 b/sub1/file1 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/sub1/file1 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
diff --git a/xx/file2 b/xx/file2 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/xx/file2 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
|
||
|
||
$ josh-filter ":[:/sub1,:/xx]" | ||
$ git diff ${EMPTY_TREE}..FILTERED_HEAD | ||
diff --git a/file1 b/file1 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/file1 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
diff --git a/file2 b/file2 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/file2 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
|
||
$ josh-filter ":[:/xx,:/sub1]" | ||
$ git diff ${EMPTY_TREE}..FILTERED_HEAD | ||
diff --git a/file1 b/file1 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/file1 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
diff --git a/file2 b/file2 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/file2 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
|
||
$ josh-filter -s ":[:/sub/xx::file3,:/sub1,:/xx,:/sub/xx]" | ||
[1] :/sub1 | ||
[1] ::file3 | ||
[2] :/sub | ||
[3] :/xx | ||
[3] :[ | ||
:/sub/xx::file3 | ||
:/sub1 | ||
:/xx | ||
:/sub/xx | ||
] | ||
[3] :[ | ||
:/xx | ||
:/sub/xx | ||
] | ||
$ git diff ${EMPTY_TREE}..FILTERED_HEAD | ||
diff --git a/file1 b/file1 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/file1 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
diff --git a/file2 b/file2 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/file2 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
diff --git a/file3 b/file3 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/file3 | ||
@@ -0,0 +1 @@ | ||
+contents1 | ||
diff --git a/file4 b/file4 | ||
new file mode 100644 | ||
index 0000000..a024003 | ||
--- /dev/null | ||
+++ b/file4 | ||
@@ -0,0 +1 @@ | ||
+contents1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,7 +124,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,7 +124,7 @@ | |
"real_repo.git" = ["::sub1/"] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ | |
"real_repo.git" = ["::sub1/"] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
$ bash ${TESTDIR}/destroy_test_env.sh | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,7 +111,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ | |
"real_repo.git" = [":/sub1"] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
$ bash ${TESTDIR}/destroy_test_env.sh | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ | |
"real_repo.git" = [":prefix=sub1"] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -340,7 +340,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ | |
"real_repo.git" = ["::sub1/"] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,7 +97,7 @@ Check the branch again | |
] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ | |
] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ test for that. | |
"real_repo.git" = [] | ||
. | ||
|-- josh | ||
| `-- 14 | ||
| `-- 15 | ||
| `-- sled | ||
| |-- blobs | ||
| |-- conf | ||
|
Oops, something went wrong.