Skip to content

Commit e5a0d5d

Browse files
committed
Merge branch 'master' into ds/backfill
* master: (446 commits) The seventh batch The sixth batch The fifth batch The fourth batch refs/reftable: fix uninitialized memory access of `max_index` remote: announce removal of "branches/" and "remotes/" The third batch hash.h: drop unsafe_ function variants csum-file: introduce hashfile_checkpoint_init() t/helper/test-hash.c: use unsafe_hash_algo() csum-file.c: use unsafe_hash_algo() hash.h: introduce `unsafe_hash_algo()` csum-file.c: extract algop from hashfile_checksum_valid() csum-file: store the hash algorithm as a struct field t/helper/test-tool: implement sha1-unsafe helper trace2: prevent segfault on config collection with valueless true refs: fix creation of reflog entries for symrefs ci: wire up Visual Studio build with Meson ci: raise error when Meson generates warnings meson: fix compilation with Visual Studio ...
2 parents 0cb454c + bc204b7 commit e5a0d5d

File tree

649 files changed

+19048
-8208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

649 files changed

+19048
-8208
lines changed

.github/workflows/main.yml

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,13 @@ jobs:
113113
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
114114
steps:
115115
- uses: actions/checkout@v4
116-
- name: setup SDK
117-
shell: powershell
118-
run: ci/install-sdk.ps1
116+
- uses: git-for-windows/setup-git-for-windows-sdk@v1
119117
- name: build
120-
shell: powershell
118+
shell: bash
121119
env:
122120
HOME: ${{runner.workspace}}
123121
NO_PERL: 1
124-
run: git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
122+
run: . /etc/profile && ci/make-test-artifacts.sh artifacts
125123
- name: zip up tracked files
126124
run: git archive -o artifacts/tracked.tar.gz HEAD
127125
- name: upload tracked files and build artifacts
@@ -149,12 +147,10 @@ jobs:
149147
- name: extract tracked files and build artifacts
150148
shell: bash
151149
run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz
152-
- name: setup SDK
153-
shell: powershell
154-
run: ci/install-sdk.ps1
150+
- uses: git-for-windows/setup-git-for-windows-sdk@v1
155151
- name: test
156-
shell: powershell
157-
run: git-sdk/usr/bin/bash.exe -l -c 'ci/run-test-slice.sh ${{matrix.nr}} 10'
152+
shell: bash
153+
run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
158154
- name: print test failures
159155
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
160156
shell: bash
@@ -252,6 +248,58 @@ jobs:
252248
with:
253249
name: failed-tests-windows-vs-${{ matrix.nr }}
254250
path: ${{env.FAILED_TEST_ARTIFACTS}}
251+
252+
windows-meson-build:
253+
name: win+Meson build
254+
needs: ci-config
255+
if: needs.ci-config.outputs.enabled == 'yes'
256+
runs-on: windows-latest
257+
concurrency:
258+
group: windows-meson-build-${{ github.ref }}
259+
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
260+
steps:
261+
- uses: actions/checkout@v4
262+
- uses: actions/setup-python@v5
263+
- name: Set up dependencies
264+
shell: pwsh
265+
run: pip install meson ninja
266+
- name: Setup
267+
shell: pwsh
268+
run: meson setup build -Dperl=disabled
269+
- name: Compile
270+
shell: pwsh
271+
run: meson compile -C build
272+
- name: Upload build artifacts
273+
uses: actions/upload-artifact@v4
274+
with:
275+
name: windows-meson-artifacts
276+
path: build
277+
windows-meson-test:
278+
name: win+Meson test
279+
runs-on: windows-latest
280+
needs: [ci-config, windows-meson-build]
281+
strategy:
282+
fail-fast: false
283+
matrix:
284+
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
285+
concurrency:
286+
group: windows-meson-test-${{ matrix.nr }}-${{ github.ref }}
287+
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
288+
steps:
289+
- uses: actions/checkout@v4
290+
- uses: actions/setup-python@v5
291+
- name: Set up dependencies
292+
shell: pwsh
293+
run: pip install meson ninja
294+
- name: Download build artifacts
295+
uses: actions/download-artifact@v4
296+
with:
297+
name: windows-meson-artifacts
298+
path: build
299+
- name: Test
300+
shell: pwsh
301+
run: meson test -C build --list | Select-Object -Skip 1 | Select-String .* | Group-Object -Property { $_.LineNumber % 10 } | Where-Object Name -EQ ${{ matrix.nr }} | ForEach-Object { meson test -C build --no-rebuild --print-errorlogs $_.Group }
302+
255303
regular:
256304
name: ${{matrix.vector.jobname}} (${{matrix.vector.pool}})
257305
needs: ci-config
@@ -269,9 +317,8 @@ jobs:
269317
- jobname: linux-reftable
270318
cc: clang
271319
pool: ubuntu-latest
272-
- jobname: linux-gcc
320+
- jobname: linux-breaking-changes
273321
cc: gcc
274-
cc_package: gcc-8
275322
pool: ubuntu-20.04
276323
- jobname: linux-TEST-vars
277324
cc: gcc
@@ -286,9 +333,9 @@ jobs:
286333
- jobname: osx-gcc
287334
cc: gcc-13
288335
pool: macos-13
289-
- jobname: linux-gcc-default
290-
cc: gcc
291-
pool: ubuntu-latest
336+
- jobname: osx-meson
337+
cc: clang
338+
pool: macos-13
292339
- jobname: linux-leaks
293340
cc: gcc
294341
pool: ubuntu-latest
@@ -298,11 +345,15 @@ jobs:
298345
- jobname: linux-asan-ubsan
299346
cc: clang
300347
pool: ubuntu-latest
348+
- jobname: linux-meson
349+
cc: gcc
350+
pool: ubuntu-latest
301351
env:
302352
CC: ${{matrix.vector.cc}}
303353
CC_PACKAGE: ${{matrix.vector.cc_package}}
304354
jobname: ${{matrix.vector.jobname}}
305355
distro: ${{matrix.vector.pool}}
356+
TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t
306357
runs-on: ${{matrix.vector.pool}}
307358
steps:
308359
- uses: actions/checkout@v4
@@ -342,12 +393,21 @@ jobs:
342393
- jobname: linux-musl
343394
image: alpine
344395
distro: alpine-latest
396+
# Supported until 2025-04-02.
345397
- jobname: linux32
346398
image: i386/ubuntu:focal
347399
distro: ubuntu32-20.04
348400
- jobname: pedantic
349401
image: fedora
350402
distro: fedora-latest
403+
# A RHEL 8 compatible distro. Supported until 2029-05-31.
404+
- jobname: almalinux-8
405+
image: almalinux:8
406+
distro: almalinux-8
407+
# Supported until 2026-08-31.
408+
- jobname: debian-11
409+
image: debian:11
410+
distro: debian-11
351411
env:
352412
jobname: ${{matrix.vector.jobname}}
353413
distro: ${{matrix.vector.distro}}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
/GIT-TEST-SUITES
1313
/GIT-USER-AGENT
1414
/GIT-VERSION-FILE
15-
/bin-wrappers/
1615
/git
1716
/git-add
1817
/git-am
@@ -195,9 +194,11 @@
195194
/config-list.h
196195
/command-list.h
197196
/hook-list.h
197+
/version-def.h
198198
*.tar.gz
199199
*.dsc
200200
*.deb
201+
/git.rc
201202
/git.spec
202203
*.exe
203204
*.[aos]

.gitlab-ci.yml

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ test:linux:
2020
- saas-linux-medium-amd64
2121
variables:
2222
CUSTOM_PATH: "/custom"
23+
TEST_OUTPUT_DIRECTORY: "/tmp/test-output"
2324
before_script:
2425
- ./ci/install-dependencies.sh
2526
script:
@@ -31,29 +32,26 @@ test:linux:
3132
if test "$CI_JOB_STATUS" != 'success'
3233
then
3334
sudo --preserve-env --set-home --user=builder ./ci/print-test-failures.sh
35+
mv "$TEST_OUTPUT_DIRECTORY"/failed-test-artifacts t/
3436
fi
3537
parallel:
3638
matrix:
3739
- jobname: linux-old
38-
image: ubuntu:16.04
40+
image: ubuntu:20.04
3941
CC: gcc
4042
- jobname: linux-sha256
4143
image: ubuntu:latest
4244
CC: clang
4345
- jobname: linux-reftable
4446
image: ubuntu:latest
4547
CC: clang
46-
- jobname: linux-gcc
48+
- jobname: linux-breaking-changes
4749
image: ubuntu:20.04
4850
CC: gcc
49-
CC_PACKAGE: gcc-8
5051
- jobname: linux-TEST-vars
5152
image: ubuntu:20.04
5253
CC: gcc
5354
CC_PACKAGE: gcc-8
54-
- jobname: linux-gcc-default
55-
image: ubuntu:latest
56-
CC: gcc
5755
- jobname: linux-leaks
5856
image: ubuntu:latest
5957
CC: gcc
@@ -67,6 +65,9 @@ test:linux:
6765
image: fedora:latest
6866
- jobname: linux-musl
6967
image: alpine:latest
68+
- jobname: linux-meson
69+
image: ubuntu:latest
70+
CC: gcc
7071
artifacts:
7172
paths:
7273
- t/failed-test-artifacts
@@ -99,10 +100,13 @@ test:osx:
99100
parallel:
100101
matrix:
101102
- jobname: osx-clang
102-
image: macos-13-xcode-14
103+
image: macos-14-xcode-15
103104
CC: clang
104105
- jobname: osx-reftable
105-
image: macos-13-xcode-14
106+
image: macos-14-xcode-15
107+
CC: clang
108+
- jobname: osx-meson
109+
image: macos-14-xcode-15
106110
CC: clang
107111
artifacts:
108112
paths:
@@ -141,6 +145,44 @@ test:mingw64:
141145
- git-sdk/usr/bin/bash.exe -l -c 'ci/print-test-failures.sh'
142146
parallel: 10
143147

148+
.msvc-meson:
149+
tags:
150+
- saas-windows-medium-amd64
151+
before_script:
152+
- choco install -y git meson ninja openssl
153+
- Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
154+
- refreshenv
155+
# The certificate store for Python on Windows is broken and fails to fetch
156+
# certificates, see https://bugs.python.org/issue36011. This seems to
157+
# mostly be an issue with how the GitLab image is set up as it is a
158+
# non-issue on GitHub Actions. Work around the issue by importing
159+
# cetrificates manually.
160+
- Invoke-WebRequest https://curl.haxx.se/ca/cacert.pem -OutFile cacert.pem
161+
- openssl pkcs12 -export -nokeys -in cacert.pem -out certs.pfx -passout "pass:"
162+
- Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\Root -FilePath certs.pfx
163+
164+
build:msvc-meson:
165+
extends: .msvc-meson
166+
stage: build
167+
script:
168+
- meson setup build -Dperl=disabled
169+
- meson compile -C build
170+
artifacts:
171+
paths:
172+
- build
173+
174+
test:msvc-meson:
175+
extends: .msvc-meson
176+
stage: test
177+
when: manual
178+
timeout: 6h
179+
needs:
180+
- job: "build:msvc-meson"
181+
artifacts: true
182+
script:
183+
- meson test -C build --list | Select-Object -Skip 1 | Select-String .* | Group-Object -Property { $_.LineNumber % $Env:CI_NODE_TOTAL + 1 } | Where-Object Name -EQ $Env:CI_NODE_INDEX | ForEach-Object { meson test -C build --no-rebuild --print-errorlogs $_.Group }
184+
parallel: 10
185+
144186
test:fuzz-smoke-tests:
145187
image: ubuntu:latest
146188
stage: test

Documentation/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ cmds-*.txt
1212
mergetools-*.txt
1313
SubmittingPatches.txt
1414
tmp-doc-diff/
15+
tmp-meson-diff/
1516
GIT-ASCIIDOCFLAGS
1617
/.build/
1718
/GIT-EXCLUDED-PROGRAMS
19+
/asciidoc.conf
20+
/asciidoctor-extensions.rb

Documentation/BreakingChanges.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,31 @@ Cf. <[email protected]>,
154154
<CAKvOHKAFXQwt4D8yUCCkf_TQL79mYaJ=KAKhtpDNTvHJFuX1NA@mail.gmail.com>,
155155
156156

157+
* Support for storing shorthands for remote URLs in "$GIT_COMMON_DIR/branches/"
158+
and "$GIT_COMMON_DIR/remotes/" has been long superseded by storing remotes in
159+
the repository configuration.
160+
+
161+
The mechanism has originally been introduced in f170e4b39d ([PATCH] fetch/pull:
162+
short-hand notation for remote repositories., 2005-07-16) and was superseded by
163+
6687f8fea2 ([PATCH] Use .git/remote/origin, not .git/branches/origin.,
164+
2005-08-20), where we switched from ".git/branches/" to ".git/remotes/". That
165+
commit already mentions an upcoming deprecation of the ".git/branches/"
166+
directory, and starting with a1d4aa7424 (Add repository-layout document.,
167+
2005-09-01) we have also marked this layout as deprecated. Eventually we also
168+
started to migrate away from ".git/remotes/" in favor of config-based remotes,
169+
and we have marked the directory as legacy in 3d3d282146 (Documentation:
170+
Grammar correction, wording fixes and cleanup, 2011-08-23)
171+
+
172+
As our documentation mentions, these directories are not to be found in modern
173+
repositories at all and most users aren't even aware of these mechanisms. They
174+
have been deprecated for almost 20 years and 14 years respectively, and we are
175+
not aware of any active users that have complained about this deprecation.
176+
Furthermore, the ".git/branches/" directory is nowadays misleadingly named and
177+
may cause confusion as "branches" are almost exclusively used in the context of
178+
references.
179+
+
180+
These features will be removed.
181+
157182
== Superseded features that will not be deprecated
158183

159184
Some features have gained newer replacements that aim to improve the design in

Documentation/CodingGuidelines

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ For C programs:
583583
Run `GIT_DEBUGGER=1 ./bin-wrappers/git foo` to simply use gdb as is, or
584584
run `GIT_DEBUGGER="<debugger> <debugger-args>" ./bin-wrappers/git foo` to
585585
use your own debugger and arguments. Example: `GIT_DEBUGGER="ddd --gdb"
586-
./bin-wrappers/git log` (See `wrap-for-bin.sh`.)
586+
./bin-wrappers/git log` (See `bin-wrappers/wrap-for-bin.sh`.)
587587

588588
- The primary data structure that a subsystem 'S' deals with is called
589589
`struct S`. Functions that operate on `struct S` are named
@@ -703,16 +703,30 @@ Program Output
703703

704704
Error Messages
705705

706-
- Do not end error messages with a full stop.
706+
- Do not end a single-sentence error message with a full stop.
707707

708708
- Do not capitalize the first word, only because it is the first word
709-
in the message ("unable to open %s", not "Unable to open %s"). But
709+
in the message ("unable to open '%s'", not "Unable to open '%s'"). But
710710
"SHA-3 not supported" is fine, because the reason the first word is
711711
capitalized is not because it is at the beginning of the sentence,
712712
but because the word would be spelled in capital letters even when
713713
it appeared in the middle of the sentence.
714714

715-
- Say what the error is first ("cannot open %s", not "%s: cannot open")
715+
- Say what the error is first ("cannot open '%s'", not "%s: cannot open").
716+
717+
- Enclose the subject of an error inside a pair of single quotes,
718+
e.g. `die(_("unable to open '%s'"), path)`.
719+
720+
- Unless there is a compelling reason not to, error messages from
721+
porcelain commands should be marked for translation, e.g.
722+
`die(_("bad revision %s"), revision)`.
723+
724+
- Error messages from the plumbing commands are sometimes meant for
725+
machine consumption and should not be marked for translation,
726+
e.g., `die("bad revision %s", revision)`.
727+
728+
- BUG("message") are for communicating the specific error to developers,
729+
thus should not be translated.
716730

717731

718732
Externally Visible Names

0 commit comments

Comments
 (0)