Skip to content

Commit c15c419

Browse files
dschoGit for Windows Build Agent
authored andcommitted
Merge branch 'fix-ci-failures-on-master'
This fixes the CI builds on Git's own `master`, which is broken for over two weeks already, with no signs that anyone might find anything wrong with that situation. I am upstreaming this in gitgitgadget#1994. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 parents f0d14d2 + 5a45c6c commit c15c419

4 files changed

Lines changed: 57 additions & 46 deletions

File tree

Documentation/technical/remembering-renames.adoc

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@ history as an optimization, assuming all merges are automatic and clean
1010

1111
Outline:
1212

13-
0. Assumptions
13+
1. Assumptions
1414

15-
1. How rebasing and cherry-picking work
15+
2. How rebasing and cherry-picking work
1616

17-
2. Why the renames on MERGE_SIDE1 in any given pick are *always* a
17+
3. Why the renames on MERGE_SIDE1 in any given pick are *always* a
1818
superset of the renames on MERGE_SIDE1 for the next pick.
1919

20-
3. Why any rename on MERGE_SIDE1 in any given pick is _almost_ always also
20+
4. Why any rename on MERGE_SIDE1 in any given pick is _almost_ always also
2121
a rename on MERGE_SIDE1 for the next pick
2222

23-
4. A detailed description of the counter-examples to #3.
23+
5. A detailed description of the counter-examples to #3.
2424

25-
5. Why the special cases in #4 are still fully reasonable to use to pair
25+
6. Why the special cases in #4 are still fully reasonable to use to pair
2626
up files for three-way content merging in the merge machinery, and why
2727
they do not affect the correctness of the merge.
2828

29-
6. Interaction with skipping of "irrelevant" renames
29+
7. Interaction with skipping of "irrelevant" renames
3030

31-
7. Additional items that need to be cached
31+
8. Additional items that need to be cached
3232

33-
8. How directory rename detection interacts with the above and why this
33+
9. How directory rename detection interacts with the above and why this
3434
optimization is still safe even if merge.directoryRenames is set to
3535
"true".
3636

3737

38-
=== 0. Assumptions ===
38+
== 1. Assumptions ==
3939

4040
There are two assumptions that will hold throughout this document:
4141

@@ -91,7 +91,7 @@ this config setting, but we have to discuss a few more cases to show why;
9191
this discussion is deferred until section 8.
9292

9393

94-
=== 1. How rebasing and cherry-picking work ===
94+
== 2. How rebasing and cherry-picking work ==
9595

9696
Consider the following setup (from the git-rebase manpage):
9797

@@ -138,8 +138,8 @@ Conceptually the two statements above are the same as a three-way merge of
138138
B, B', and C, at least the parts before you decide to record a commit.
139139

140140

141-
=== 2. Why the renames on MERGE_SIDE1 in any given pick are always a ===
142-
=== superset of the renames on MERGE_SIDE1 for the next pick. ===
141+
== 3. Why the renames on MERGE_SIDE1 in any given pick are always a ==
142+
== superset of the renames on MERGE_SIDE1 for the next pick. ==
143143

144144
The merge machinery uses the filenames it is fed from MERGE_BASE,
145145
MERGE_SIDE1, and MERGE_SIDE2. It will only move content to a different
@@ -181,8 +181,8 @@ are a subset of those between E and G. Equivalently, all renames between E
181181
and G are a superset of those between A and A'.
182182

183183

184-
=== 3. Why any rename on MERGE_SIDE1 in any given pick is _almost_ ===
185-
=== always also a rename on MERGE_SIDE1 for the next pick. ===
184+
== 4. Why any rename on MERGE_SIDE1 in any given pick is _almost_ ==
185+
== always also a rename on MERGE_SIDE1 for the next pick. ==
186186

187187
Let's again look at the first two picks:
188188

@@ -254,7 +254,7 @@ were detected as renames, A:oldfile and A':newfile should also be
254254
detectable as renames almost always.
255255

256256

257-
=== 4. A detailed description of the counter-examples to #3. ===
257+
== 5. A detailed description of the counter-examples to #3. ==
258258

259259
We already noted in section 3 that rename/rename(1to1) (i.e. both sides
260260
renaming a file the same way) was one counter-example. The more
@@ -285,9 +285,9 @@ E:oldfile -> G:newfile would be detected as a rename, but A:oldfile and
285285
A':newfile would not be.
286286

287287

288-
=== 5. Why the special cases in #4 are still fully reasonable to use to ===
289-
=== pair up files for three-way content merging in the merge machinery, ===
290-
=== and why they do not affect the correctness of the merge. ===
288+
== 6. Why the special cases in #4 are still fully reasonable to use to ==
289+
== pair up files for three-way content merging in the merge machinery, ==
290+
== and why they do not affect the correctness of the merge. ==
291291

292292
In the rename/rename(1to1) case, A:newfile and A':newfile are not renames
293293
since they use the *same* filename. However, files with the same filename
@@ -394,7 +394,7 @@ cases 1 and 3 seem to provide as good or better behavior with the
394394
optimization than without.
395395

396396

397-
=== 6. Interaction with skipping of "irrelevant" renames ===
397+
== 7. Interaction with skipping of "irrelevant" renames ==
398398

399399
Previous optimizations involved skipping rename detection for paths
400400
considered to be "irrelevant". See for example the following commits:
@@ -421,7 +421,7 @@ detection -- though we can limit it to the paths for which we have not
421421
already detected renames.
422422

423423

424-
=== 7. Additional items that need to be cached ===
424+
== 8. Additional items that need to be cached ==
425425

426426
It turns out we have to cache more than just renames; we also cache:
427427

@@ -482,9 +482,9 @@ we store the trees to compare with what we are asked to merge next
482482
time.
483483

484484

485-
=== 8. How directory rename detection interacts with the above and ===
486-
=== why this optimization is still safe even if ===
487-
=== merge.directoryRenames is set to "true". ===
485+
== 9. How directory rename detection interacts with the above and ==
486+
== why this optimization is still safe even if ==
487+
== merge.directoryRenames is set to "true". ==
488488

489489
As noted in the assumptions section:
490490

Documentation/technical/sparse-checkout.adoc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Table of contents:
1414
* Reference Emails
1515

1616

17-
=== Terminology ===
17+
== Terminology ==
1818

1919
cone mode: one of two modes for specifying the desired subset of files
2020
in a sparse-checkout. In cone-mode, the user specifies
@@ -92,7 +92,7 @@ vivifying: When a command restores a tracked file to the working tree (and
9292
file), this is referred to as "vivifying" the file.
9393

9494

95-
=== Purpose of sparse-checkouts ===
95+
== Purpose of sparse-checkouts ==
9696

9797
sparse-checkouts exist to allow users to work with a subset of their
9898
files.
@@ -255,7 +255,7 @@ will perceive the checkout as dense, and commands should thus behave as if
255255
all files are present.
256256

257257

258-
=== Usecases of primary concern ===
258+
== Usecases of primary concern ==
259259

260260
Most of the rest of this document will focus on Behavior A and Behavior
261261
B. Some notes about the other two cases and why we are not focusing on
@@ -300,7 +300,7 @@ Behavior C do not assume they are part of the Behavior B camp and propose
300300
patches that break things for the real Behavior B folks.
301301

302302

303-
=== Oversimplified mental models ===
303+
== Oversimplified mental models ==
304304

305305
An oversimplification of the differences in the above behaviors is:
306306

@@ -313,7 +313,7 @@ An oversimplification of the differences in the above behaviors is:
313313
they can later lazily be populated instead.
314314

315315

316-
=== Desired behavior ===
316+
== Desired behavior ==
317317

318318
As noted previously, despite the simple idea of just working with a subset
319319
of files, there are a range of different behavioral changes that need to be
@@ -542,7 +542,7 @@ understanding these differences can be beneficial.
542542
* gitk?
543543

544544

545-
=== Behavior classes ===
545+
== Behavior classes ==
546546

547547
From the above there are a few classes of behavior:
548548

@@ -609,7 +609,7 @@ From the above there are a few classes of behavior:
609609
specification.
610610

611611

612-
=== Subcommand-dependent defaults ===
612+
== Subcommand-dependent defaults ==
613613

614614
Note that we have different defaults depending on the command for the
615615
desired behavior :
@@ -749,7 +749,7 @@ desired behavior :
749749
implemented.
750750

751751

752-
=== Sparse specification vs. sparsity patterns ===
752+
== Sparse specification vs. sparsity patterns ==
753753

754754
In a well-behaved situation, the sparse specification is given directly
755755
by the $GIT_DIR/info/sparse-checkout file. However, it can transiently
@@ -821,7 +821,7 @@ under behavior B index operations are lumped with history and tend to
821821
operate full-tree.
822822

823823

824-
=== Implementation Questions ===
824+
== Implementation Questions ==
825825

826826
* Do the options --scope={sparse,all} sound good to others? Are there better
827827
options?
@@ -892,7 +892,7 @@ operate full-tree.
892892
is seamless for them.
893893

894894

895-
=== Implementation Goals/Plans ===
895+
== Implementation Goals/Plans ==
896896

897897
* Get buy-in on this document in general.
898898

@@ -920,15 +920,15 @@ operate full-tree.
920920
commands. IMPORTANT: make sure diff machinery changes don't mess with
921921
format-patch, fast-export, etc.
922922

923-
=== Known bugs ===
923+
== Known bugs ==
924924

925925
This list used to be a lot longer (see e.g. [1,2,3,4,5,6,7,8,9]), but we've
926926
been working on it.
927927

928-
0. Behavior A is not well supported in Git. (Behavior B didn't used to
928+
1. Behavior A is not well supported in Git. (Behavior B didn't used to
929929
be either, but was the easier of the two to implement.)
930930

931-
1. am and apply:
931+
2. am and apply:
932932

933933
apply, without `--index` or `--cached`, relies on files being present
934934
in the working copy, and also writes to them unconditionally. As
@@ -948,7 +948,7 @@ been working on it.
948948
files and then complain that those vivified files would be
949949
overwritten by merge.
950950

951-
2. reset --hard:
951+
3. reset --hard:
952952

953953
reset --hard provides confusing error message (works correctly, but
954954
misleads the user into believing it didn't):
@@ -971,13 +971,13 @@ been working on it.
971971
`git reset --hard` DID remove addme from the index and the working tree, contrary
972972
to the error message, but in line with how reset --hard should behave.
973973

974-
3. read-tree
974+
4. read-tree
975975

976976
`read-tree` doesn't apply the 'SKIP_WORKTREE' bit to *any* of the
977977
entries it reads into the index, resulting in all your files suddenly
978978
appearing to be "deleted".
979979

980-
4. Checkout, restore:
980+
5. Checkout, restore:
981981

982982
These command do not handle path & revision arguments appropriately:
983983

@@ -1030,7 +1030,7 @@ been working on it.
10301030
S tracked
10311031
H tracked-but-maybe-skipped
10321032

1033-
5. checkout and restore --staged, continued:
1033+
6. checkout and restore --staged, continued:
10341034

10351035
These commands do not correctly scope operations to the sparse
10361036
specification, and make it worse by not setting important SKIP_WORKTREE
@@ -1046,11 +1046,11 @@ been working on it.
10461046
the sparse specification, but then it will be important to set the
10471047
SKIP_WORKTREE bits appropriately.
10481048

1049-
6. Performance issues; see:
1049+
7. Performance issues; see:
10501050
https://lore.kernel.org/git/CABPp-BEkJQoKZsQGCYioyga_uoDQ6iBeW+FKr8JhyuuTMK1RDw@mail.gmail.com/
10511051

10521052

1053-
=== Reference Emails ===
1053+
== Reference Emails ==
10541054

10551055
Emails that detail various bugs we've had in sparse-checkout:
10561056

src/cargo-meson.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ then
55
exit 1
66
fi
77

8+
target="$1"
9+
shift
10+
811
SOURCE_DIR="$1"
912
BUILD_DIR="$2"
1013
BUILD_TYPE=debug
@@ -26,7 +29,7 @@ then
2629
exit $RET
2730
fi
2831

29-
if ! cmp "$BUILD_DIR/$BUILD_TYPE/libgitcore.a" "$BUILD_DIR/libgitcore.a" >/dev/null 2>&1
32+
if ! cmp "$BUILD_DIR/$BUILD_TYPE/$target" "$BUILD_DIR/$target" >/dev/null 2>&1
3033
then
31-
cp "$BUILD_DIR/$BUILD_TYPE/libgitcore.a" "$BUILD_DIR/libgitcore.a"
34+
cp "$BUILD_DIR/$BUILD_TYPE/$target" "$BUILD_DIR/$target"
3235
fi

src/meson.build

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ libgit_rs_sources = [
33
'varint.rs',
44
]
55

6+
# The exact file name depends on the compiler
7+
if meson.get_compiler('c').get_id() == 'msvc'
8+
target = 'gitcore.lib'
9+
else
10+
target = 'libgitcore.a'
11+
endif
12+
613
# Unfortunately we must use a wrapper command to move the output file into the
714
# current build directory. This can fixed once `cargo build --artifact-dir`
815
# stabilizes. See https://github.com/rust-lang/cargo/issues/6790 for that
916
# effort.
1017
cargo_command = [
1118
shell,
1219
meson.current_source_dir() / 'cargo-meson.sh',
20+
target,
1321
meson.project_source_root(),
1422
meson.current_build_dir(),
1523
]
@@ -21,7 +29,7 @@ libgit_rs = custom_target('git_rs',
2129
input: libgit_rs_sources + [
2230
meson.project_source_root() / 'Cargo.toml',
2331
],
24-
output: 'libgitcore.a',
32+
output: target,
2533
command: cargo_command,
2634
)
2735
libgit_dependencies += declare_dependency(link_with: libgit_rs)

0 commit comments

Comments
 (0)