Skip to content

Commit b623bf1

Browse files
committed
Completely remove :/ baseline skip
This rolls back all changes made to work around the Git 2.47.* bug that underlies #1622, including the change made in the immediately preceding commit. This undoes the changes to `regex.rs` from #1635, #1719, #1774, and 2400158 (which is the immediately preceding commit). That file is now as it was in 3745212. The rationale is that the disadvantages of inverting the CI check and extending the suppresson, as described in the previous commit, really outweigh the advantages. This is mainly due to the risk of generating archives that should not be committed but seem based on test results like they could be committed. (The suppressions being removed here will most likely not be needed in the future, but if they are then this commit can be reverted, and the suppression will be done locally but on on CI, consistently across feature for which the relevant tests are run, and only when Git is found to be a version in the 2.47.* range.) Closes #1622
1 parent 2400158 commit b623bf1

File tree

1 file changed

+16
-67
lines changed
  • gix/tests/gix/revision/spec/from_bytes

1 file changed

+16
-67
lines changed

gix/tests/gix/revision/spec/from_bytes/regex.rs

+16-67
Original file line numberDiff line numberDiff line change
@@ -67,40 +67,21 @@ mod find_youngest_matching_commit {
6767
fn contained_string_matches() {
6868
let repo = repo("complex_graph").unwrap();
6969

70-
// See the comment on `skip_some_baselines` in the `regex_matches` test function below.
71-
let skip_some_baselines = !is_ci::cached()
72-
&& std::env::var_os("GIX_TEST_IGNORE_ARCHIVES").is_some()
73-
&& ((2, 47, 0)..(2, 48, 0)).contains(&gix_testtools::GIT_VERSION);
74-
75-
if skip_some_baselines {
76-
assert_eq!(
77-
parse_spec_no_baseline(":/message", &repo).unwrap(),
78-
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
79-
);
80-
} else {
81-
assert_eq!(
82-
parse_spec(":/message", &repo).unwrap(),
83-
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
84-
);
85-
}
70+
assert_eq!(
71+
parse_spec(":/message", &repo).unwrap(),
72+
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
73+
);
8674

8775
assert_eq!(
8876
parse_spec("@^{/!-B}", &repo).unwrap(),
8977
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo)),
9078
"negations work as well"
9179
);
9280

93-
if skip_some_baselines {
94-
assert_eq!(
95-
parse_spec_no_baseline(":/!-message", &repo).unwrap(),
96-
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
97-
);
98-
} else {
99-
assert_eq!(
100-
parse_spec(":/!-message", &repo).unwrap(),
101-
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
102-
);
103-
}
81+
assert_eq!(
82+
parse_spec(":/!-message", &repo).unwrap(),
83+
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
84+
);
10485

10586
assert_eq!(
10687
parse_spec_no_baseline(":/messa.e", &repo).unwrap_err().to_string(),
@@ -114,52 +95,20 @@ mod find_youngest_matching_commit {
11495
fn regex_matches() {
11596
let repo = repo("complex_graph").unwrap();
11697

117-
// Traversal order with `:/` was broken in Git 2.47.*, so some `parse_spec` assertions
118-
// fail. The fix is in Git 2.48.* but is not backported. This causes incorrect baselines to
119-
// be computed when `GIX_TEST_IGNORE_ARCHIVES` is set. If that is not set, then archived
120-
// baselines are used and there is no problem. On CI, we assume a sufficiently new version
121-
// of Git. Otherwise, if `GIX_TEST_IGNORE_ARCHIVES` is set and Git 2.47.* is used, we skip
122-
// the baseline check, to allow the rest of the test to proceed. This accommodates local
123-
// development environments with a system-provided Git 2.47.*, though archives generated on
124-
// such a system should not be committed, as they would still contain incorrect baselines.
125-
// Please note that this workaround may be removed in the future. For more details, see:
126-
//
127-
// - https://lore.kernel.org/git/[email protected]/T/
128-
// - https://lore.kernel.org/git/[email protected]/T/
129-
// - https://github.com/git/git/blob/v2.48.0/Documentation/RelNotes/2.48.0.txt#L294-L296
130-
// - https://github.com/GitoxideLabs/gitoxide/issues/1622
131-
let skip_some_baselines = !is_ci::cached()
132-
&& std::env::var_os("GIX_TEST_IGNORE_ARCHIVES").is_some()
133-
&& ((2, 47, 0)..(2, 48, 0)).contains(&gix_testtools::GIT_VERSION);
134-
135-
if skip_some_baselines {
136-
assert_eq!(
137-
parse_spec_no_baseline(":/mes.age", &repo).unwrap(),
138-
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
139-
);
140-
} else {
141-
assert_eq!(
142-
parse_spec(":/mes.age", &repo).unwrap(),
143-
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
144-
);
145-
}
98+
assert_eq!(
99+
parse_spec(":/mes.age", &repo).unwrap(),
100+
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
101+
);
146102

147103
assert_eq!(
148104
parse_spec(":/not there", &repo).unwrap_err().to_string(),
149105
"None of 10 commits reached from all references matched regex \"not there\""
150106
);
151107

152-
if skip_some_baselines {
153-
assert_eq!(
154-
parse_spec_no_baseline(":/!-message", &repo).unwrap(),
155-
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
156-
);
157-
} else {
158-
assert_eq!(
159-
parse_spec(":/!-message", &repo).unwrap(),
160-
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
161-
);
162-
}
108+
assert_eq!(
109+
parse_spec(":/!-message", &repo).unwrap(),
110+
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
111+
);
163112

164113
assert_eq!(
165114
parse_spec("@^{/!-B}", &repo).unwrap(),

0 commit comments

Comments
 (0)