Skip to content

Commit 23e17af

Browse files
authored
Merge branch 'git:master' into implement-nested-rebase
2 parents a432a32 + a30f80f commit 23e17af

859 files changed

Lines changed: 60492 additions & 33817 deletions

File tree

Some content is hidden

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

.cirrus.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ freebsd_task:
55
env:
66
GIT_PROVE_OPTS: "--timer --jobs 10"
77
GIT_TEST_OPTS: "--no-chain-lint --no-bin-wrappers"
8-
MAKEFLAGS: "-j4"
8+
GIT_SKIP_TESTS: t7815.12
9+
MAKEFLAGS: -j4
910
DEFAULT_TEST_TARGET: prove
11+
DEFAULT_UNIT_TEST_TARGET: unit-tests-prove
1012
DEVELOPER: 1
1113
freebsd_instance:
12-
image_family: freebsd-13-4
14+
image_family: freebsd-14-3
1315
memory: 2G
1416
install_script:
1517
pkg install -y gettext gmake perl5
@@ -19,4 +21,4 @@ freebsd_task:
1921
build_script:
2022
- su git -c gmake
2123
test_script:
22-
- su git -c 'gmake DEFAULT_UNIT_TEST_TARGET=unit-tests-prove test unit-tests'
24+
- su git -c 'gmake test unit-tests'

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CODE_OF_CONDUCT.md -whitespace
1313
/mergetools/* text eol=lf
1414
/t/oid-info/* text eol=lf
1515
/Documentation/git-merge.adoc conflict-marker-size=32
16+
/Documentation/git-merge-file.adoc conflict-marker-size=32
1617
/Documentation/gitk.adoc conflict-marker-size=32
1718
/Documentation/user-manual.adoc conflict-marker-size=32
1819
/t/t????-*.sh conflict-marker-size=32

.github/workflows/coverity.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,13 @@ jobs:
147147
key: cov-build-${{ env.COVERITY_LANGUAGE }}-${{ env.COVERITY_PLATFORM }}-${{ steps.lookup.outputs.hash }}
148148
- name: build with cov-build
149149
run: |
150-
export PATH="$RUNNER_TEMP/cov-analysis/bin:$PATH" &&
150+
export PATH="$PATH:$RUNNER_TEMP/cov-analysis/bin" &&
151151
cov-configure --gcc &&
152-
cov-build --dir cov-int make
152+
if ! cov-build --dir cov-int make
153+
then
154+
cat cov-int/build-log.txt
155+
exit 1
156+
fi
153157
- name: package the build
154158
run: tar -czvf cov-int.tgz cov-int
155159
- name: submit the build to Coverity Scan

.github/workflows/main.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ jobs:
265265
run: pip install meson ninja
266266
- name: Setup
267267
shell: pwsh
268-
run: meson setup build -Dperl=disabled -Dcredential_helpers=wincred
268+
run: meson setup build --vsenv -Dbuildtype=release -Dperl=disabled -Dcredential_helpers=wincred
269269
- name: Compile
270270
shell: pwsh
271271
run: meson compile -C build
@@ -349,6 +349,7 @@ jobs:
349349
if: needs.ci-config.outputs.enabled == 'yes'
350350
env:
351351
CC: clang
352+
CI_JOB_IMAGE: ubuntu-latest
352353
runs-on: ubuntu-latest
353354
steps:
354355
- uses: actions/checkout@v4
@@ -407,12 +408,27 @@ jobs:
407408
jobname: ${{matrix.vector.jobname}}
408409
CC: ${{matrix.vector.cc}}
409410
CI_JOB_IMAGE: ${{matrix.vector.image}}
411+
CUSTOM_PATH: /custom
410412
runs-on: ubuntu-latest
411413
container: ${{matrix.vector.image}}
412414
steps:
413415
- name: prepare libc6 for actions
414416
if: matrix.vector.jobname == 'linux32'
415417
run: apt -q update && apt -q -y install libc6-amd64 lib64stdc++6
418+
- name: install git in container
419+
run: |
420+
if command -v git
421+
then
422+
: # nothing to do
423+
elif command -v apk
424+
then
425+
apk add --update git
426+
elif command -v dnf
427+
then
428+
dnf -yq update && dnf -yq install git
429+
else
430+
apt-get -q update && apt-get -q -y install git
431+
fi
416432
- uses: actions/checkout@v4
417433
- run: ci/install-dependencies.sh
418434
- run: useradd builder --create-home
@@ -432,6 +448,7 @@ jobs:
432448
if: needs.ci-config.outputs.enabled == 'yes'
433449
env:
434450
jobname: StaticAnalysis
451+
CI_JOB_IMAGE: ubuntu-22.04
435452
runs-on: ubuntu-22.04
436453
concurrency:
437454
group: static-analysis-${{ github.ref }}
@@ -446,20 +463,12 @@ jobs:
446463
if: needs.ci-config.outputs.enabled == 'yes'
447464
env:
448465
jobname: sparse
449-
runs-on: ubuntu-20.04
466+
CI_JOB_IMAGE: ubuntu-22.04
467+
runs-on: ubuntu-22.04
450468
concurrency:
451469
group: sparse-${{ github.ref }}
452470
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
453471
steps:
454-
- name: Download a current `sparse` package
455-
# Ubuntu's `sparse` version is too old for us
456-
uses: git-for-windows/get-azure-pipelines-artifact@v0
457-
with:
458-
repository: git/git
459-
definitionId: 10
460-
artifact: sparse-20.04
461-
- name: Install the current `sparse` package
462-
run: sudo dpkg -i sparse-20.04/sparse_*.deb
463472
- uses: actions/checkout@v4
464473
- name: Install other dependencies
465474
run: ci/install-dependencies.sh
@@ -473,6 +482,7 @@ jobs:
473482
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
474483
env:
475484
jobname: Documentation
485+
CI_JOB_IMAGE: ubuntu-latest
476486
runs-on: ubuntu-latest
477487
steps:
478488
- uses: actions/checkout@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
/git-diff
5656
/git-diff-files
5757
/git-diff-index
58+
/git-diff-pairs
5859
/git-diff-tree
5960
/git-difftool
6061
/git-difftool--helper

.gitlab-ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ build:msvc-meson:
164164
extends: .msvc-meson
165165
stage: build
166166
script:
167-
- meson setup build -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred
167+
- meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred
168168
- meson compile -C build
169169
artifacts:
170170
paths:
@@ -173,7 +173,6 @@ build:msvc-meson:
173173
test:msvc-meson:
174174
extends: .msvc-meson
175175
stage: test
176-
when: manual
177176
timeout: 6h
178177
needs:
179178
- job: "build:msvc-meson"

Documentation/BreakingChanges.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,20 @@ references.
178178
+
179179
These features will be removed.
180180

181+
* Support for "--stdin" option in the "name-rev" command was
182+
deprecated (and hidden from the documentation) in the Git 2.40
183+
timeframe, in preference to its synonym "--annotate-stdin". Git 3.0
184+
removes the support for "--stdin" altogether.
185+
186+
* The git-whatchanged(1) command has outlived its usefulness more than
187+
10 years ago, and takes more keystrokes to type than its rough
188+
equivalent `git log --raw`. We have nominated the command for
189+
removal, have changed the command to refuse to work unless the
190+
`--i-still-use-this` option is given, and asked the users to report
191+
when they do so. So far there hasn't been a single complaint.
192+
+
193+
The command will be removed.
194+
181195
== Superseded features that will not be deprecated
182196

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

Documentation/CodingGuidelines

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ For C programs:
315315
encouraged to have a blank line between the end of the declarations
316316
and the first statement in the block.
317317

318+
- Do not explicitly initialize global variables to 0 or NULL;
319+
instead, let BSS take care of the zero initialization.
320+
318321
- NULL pointers shall be written as NULL, not as 0.
319322

320323
- When declaring pointers, the star sides with the variable
@@ -861,6 +864,9 @@ Markup:
861864
_<git-dir>_
862865
_<key-id>_
863866

867+
Characters are also surrounded by underscores:
868+
_LF_, _CR_, _CR_/_LF_, _NUL_, _EOF_
869+
864870
Git's Asciidoc processor has been tailored to treat backticked text
865871
as complex synopsis. When literal and placeholders are mixed, you can
866872
use the backtick notation which will take care of correctly typesetting
@@ -874,6 +880,17 @@ Markup:
874880
As a side effect, backquoted placeholders are correctly typeset, but
875881
this style is not recommended.
876882

883+
When documenting multiple related `git config` variables, place them on
884+
a separate line instead of separating them by commas. For example, do
885+
not write this:
886+
`core.var1`, `core.var2`::
887+
Description common to `core.var1` and `core.var2`.
888+
889+
Instead write this:
890+
`core.var1`::
891+
`core.var2`::
892+
Description common to `core.var1` and `core.var2`.
893+
877894
Synopsis Syntax
878895

879896
The synopsis (a paragraph with [synopsis] attribute) is automatically

Documentation/Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ SP_ARTICLES += howto/coordinate-embargoed-releases
109109
API_DOCS = $(patsubst %.adoc,%,$(filter-out technical/api-index-skel.adoc technical/api-index.adoc, $(wildcard technical/api-*.adoc)))
110110
SP_ARTICLES += $(API_DOCS)
111111

112+
TECH_DOCS += BreakingChanges
112113
TECH_DOCS += DecisionMaking
113114
TECH_DOCS += ReviewingGuidelines
114115
TECH_DOCS += MyFirstContribution
@@ -316,8 +317,8 @@ cmds_txt = cmds-ancillaryinterrogators.adoc \
316317

317318
$(cmds_txt): cmd-list.made
318319

319-
cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
320-
$(QUIET_GEN)$(PERL_PATH) ./cmd-list.perl .. . $(cmds_txt) && \
320+
cmd-list.made: cmd-list.sh ../command-list.txt $(MAN1_TXT)
321+
$(QUIET_GEN)$(SHELL_PATH) ./cmd-list.sh .. . $(cmds_txt) && \
321322
date >$@
322323

323324
mergetools-%.adoc: generate-mergetool-list.sh ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
@@ -397,9 +398,9 @@ user-manual.html: user-manual.xml $(XSLT)
397398
git.info: user-manual.texi
398399
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
399400

400-
user-manual.texi: user-manual.xml
401+
user-manual.texi: user-manual.xml fix-texi.sh
401402
$(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@+ && \
402-
$(PERL_PATH) fix-texi.perl <$@+ >$@ && \
403+
$(SHELL_PATH) fix-texi.sh <$@+ >$@ && \
403404
$(RM) $@+
404405

405406
user-manual.pdf: user-manual.xml
@@ -509,7 +510,12 @@ lint-docs-meson:
509510
awk "/^manpages = {$$/ {flag=1 ; next } /^}$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047 : [157],\$$/, \"\"); print }" meson.build | \
510511
grep -v -e '#' -e '^$$' | \
511512
sort >tmp-meson-diff/meson.adoc && \
512-
ls git*.adoc scalar.adoc | grep -v -e git-bisect-lk2009.adoc -e git-tools.adoc >tmp-meson-diff/actual.adoc && \
513+
ls git*.adoc scalar.adoc | \
514+
grep -v -e git-bisect-lk2009.adoc \
515+
-e git-pack-redundant.adoc \
516+
-e git-tools.adoc \
517+
-e git-whatchanged.adoc \
518+
>tmp-meson-diff/actual.adoc && \
513519
if ! cmp tmp-meson-diff/meson.adoc tmp-meson-diff/actual.adoc; then \
514520
echo "Meson man pages differ from actual man pages:"; \
515521
diff -u tmp-meson-diff/meson.adoc tmp-meson-diff/actual.adoc; \

Documentation/MyFirstContribution.adoc

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@ the list by sending an email to <git+subscribe@vger.kernel.org>
4040
The https://lore.kernel.org/git[archive] of this mailing list is
4141
available to view in a browser.
4242

43-
==== https://groups.google.com/forum/#!forum/git-mentoring[git-mentoring@googlegroups.com]
44-
45-
This mailing list is targeted to new contributors and was created as a place to
46-
post questions and receive answers outside of the public eye of the main list.
47-
Veteran contributors who are especially interested in helping mentor newcomers
48-
are present on the list. In order to avoid search indexers, group membership is
49-
required to view messages; anyone can join and no approval is required.
50-
5143
==== https://web.libera.chat/#git-devel[#git-devel] on Libera Chat
5244

5345
This IRC channel is for conversations between Git contributors. If someone is
@@ -150,15 +142,31 @@ command in `builtin/psuh.c`. Create that file, and within it, write the entry
150142
point for your command in a function matching the style and signature:
151143

152144
----
153-
int cmd_psuh(int argc, const char **argv, const char *prefix)
145+
int cmd_psuh(int argc UNUSED, const char **argv UNUSED,
146+
const char *prefix UNUSED, struct repository *repo UNUSED)
154147
----
155148

149+
A few things to note:
150+
151+
* A subcommand implementation takes its command line arguments
152+
in `int argc` + `const char **argv`, like `main()` would.
153+
154+
* It also takes two extra parameters, `prefix` and `repo`. What
155+
they mean will not be discussed until much later.
156+
157+
* Because this first example will not use any of the parameters,
158+
your compiler will give warnings on unused parameters. As the
159+
list of these four parameters is mandated by the API to add
160+
new built-in commands, you cannot omit them. Instead, you add
161+
`UNUSED` to each of them to tell the compiler that you *know*
162+
you are not (yet) using it.
163+
156164
We'll also need to add the declaration of psuh; open up `builtin.h`, find the
157165
declaration for `cmd_pull`, and add a new line for `psuh` immediately before it,
158166
in order to keep the declarations alphabetically sorted:
159167

160168
----
161-
int cmd_psuh(int argc, const char **argv, const char *prefix);
169+
int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo);
162170
----
163171

164172
Be sure to `#include "builtin.h"` in your `psuh.c`. You'll also need to
@@ -174,7 +182,8 @@ Throughout the tutorial, we will mark strings for translation as necessary; you
174182
should also do so when writing your user-facing commands in the future.
175183

176184
----
177-
int cmd_psuh(int argc, const char **argv, const char *prefix)
185+
int cmd_psuh(int argc UNUSED, const char **argv UNUSED,
186+
const char *prefix UNUSED, struct repository *repo UNUSED)
178187
{
179188
printf(_("Pony saying hello goes here.\n"));
180189
return 0;
@@ -287,8 +296,9 @@ on the reference implementation linked at the top of this document.
287296
It's probably useful to do at least something besides printing out a string.
288297
Let's start by having a look at everything we get.
289298

290-
Modify your `cmd_psuh` implementation to dump the args you're passed, keeping
291-
existing `printf()` calls in place:
299+
Modify your `cmd_psuh` implementation to dump the args you're passed,
300+
keeping existing `printf()` calls in place; because the args are now
301+
used, remove the `UNUSED` macro from them:
292302

293303
----
294304
int i;
@@ -312,26 +322,27 @@ on the command line, including the name of our command. (If `prefix` is empty
312322
for you, try `cd Documentation/ && ../bin-wrappers/git psuh`). That's not so
313323
helpful. So what other context can we get?
314324

315-
Add a line to `#include "config.h"`. Then, add the following bits to the
325+
Add a line to `#include "config.h"` and `#include "repository.h"`.
326+
Then, add the following bits to the function body:
316327
function body:
317328

318329
----
319330
const char *cfg_name;
320331
321332
...
322333
323-
git_config(git_default_config, NULL);
324-
if (git_config_get_string_tmp("user.name", &cfg_name) > 0)
334+
repo_config(repo, git_default_config, NULL);
335+
if (repo_config_get_string_tmp(repo, "user.name", &cfg_name))
325336
printf(_("No name is found in config\n"));
326337
else
327338
printf(_("Your name: %s\n"), cfg_name);
328339
----
329340

330-
`git_config()` will grab the configuration from config files known to Git and
331-
apply standard precedence rules. `git_config_get_string_tmp()` will look up
341+
`repo_config()` will grab the configuration from config files known to Git and
342+
apply standard precedence rules. `repo_config_get_string_tmp()` will look up
332343
a specific key ("user.name") and give you the value. There are a number of
333344
single-key lookup functions like this one; you can see them all (and more info
334-
about how to use `git_config()`) in `Documentation/technical/api-config.adoc`.
345+
about how to use `repo_config()`) in `Documentation/technical/api-config.adoc`.
335346

336347
You should see that the name printed matches the one you see when you run:
337348

@@ -364,9 +375,10 @@ status_init_config(&s, git_status_config);
364375
----
365376

366377
But as we drill down, we can find that `status_init_config()` wraps a call
367-
to `git_config()`. Let's modify the code we wrote in the previous commit.
378+
to `repo_config()`. Let's modify the code we wrote in the previous commit.
368379

369380
Be sure to include the header to allow you to use `struct wt_status`:
381+
370382
----
371383
#include "wt-status.h"
372384
----
@@ -379,8 +391,8 @@ prepare it, and print its contents:
379391
380392
...
381393
382-
wt_status_prepare(the_repository, &status);
383-
git_config(git_default_config, &status);
394+
wt_status_prepare(repo, &status);
395+
repo_config(repo, git_default_config, &status);
384396
385397
...
386398

0 commit comments

Comments
 (0)