Skip to content

Commit 7668233

Browse files
committed
Merge branch 'master' of https://github.com/git/git
Upstream adds 8 new translatable messages. * 'master' of https://github.com/git/git: (93 commits) A bit more post -rc1 ... Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2 parents fc2a674 + b15384c commit 7668233

153 files changed

Lines changed: 3372 additions & 1462 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.

Documentation/CodingGuidelines

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,18 @@ For C programs:
668668
unsigned other_field:1;
669669
unsigned field_with_longer_name:1;
670670

671+
- When a function `F` accepts flags, those flags should be defined as `enum
672+
F_flags`. Individual flag definitions should start with `F` and be in
673+
all-uppercase letters. Flag values should be represented via bit shifts.
674+
E.g.
675+
676+
enum frobnicate_flags {
677+
FROBNICATE_FOO = (1 << 0),
678+
FROBNICATE_BAR = (1 << 1),
679+
};
680+
681+
int frobnicate(enum frobnicate_flags flags);
682+
671683
- Array names should be named in the singular form if the individual items are
672684
subject of use. E.g.:
673685

Documentation/RelNotes/2.54.0.adoc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ UI, Workflows & Features
119119
* "git replay" (experimental) learns, in addition to "pick" and
120120
"replay", a new operating mode "revert".
121121

122+
* git replay now supports replaying down to the root commit.
123+
124+
* Handling of signed commits and tags in fast-import has been made more
125+
configurable.
126+
122127

123128
Performance, Internal Implementation, Development Support etc.
124129
--------------------------------------------------------------
@@ -277,6 +282,40 @@ Performance, Internal Implementation, Development Support etc.
277282
* In case homebrew breaks REG_ENHANCED again, leave a in-code comment
278283
to suggest use of our replacement regex as a workaround.
279284
285+
* MinGW build updates.
286+
287+
* The way dash 0.5.13 handles non-ASCII contents in here-doc
288+
is buggy and breaks our existing tests, which unfortunately
289+
have been rewritten to avoid triggering the bug.
290+
291+
* Object name handling (disambiguation and abbreviation) has been
292+
refactored to be backend-generic, moving logic into the respective
293+
object database backends.
294+
295+
* pack-objects's --stdin-packs=follow mode learns to handle
296+
excluded-but-open packs.
297+
298+
* A few code paths that spawned child processes for network
299+
connection weren't wait(2)ing for their children and letting "init"
300+
reap them instead; they have been tightened.
301+
302+
* Adjust the codebase for C23 that changes functions like strchr()
303+
that discarded constness when they return a pointer into a const
304+
string to preserve constness.
305+
306+
* A handful of inappropriate uses of the_repository have been
307+
rewritten to use the right repository structure instance in the
308+
read-cache.c codepath.
309+
310+
* Internals of "git fsck" have been refactored to not depend on the
311+
global `the_repository` variable.
312+
313+
* Reduce dependency on `the_repository` in add-patch.c file.
314+
315+
* The way the "git log -L<range>:<file>" feature is bolted onto the
316+
log/diff machinery is being reworked a bit to make the feature
317+
compatible with more diff options, like -S/G.
318+
280319
281320
Fixes since v2.53
282321
-----------------
@@ -455,6 +494,27 @@ Fixes since v2.53
455494
refspec is a single-object refspec, which has been corrected.
456495
(merge 4e5dc601dd kj/refspec-parsing-outside-repository later to maint).
457496

497+
* Fix a regression in writing the commit-graph where commits with dates
498+
exceeding 34 bits (beyond year 2514) could cause an underflow and
499+
crash Git during the generation data overflow chunk writing.
500+
501+
* The value of a wrong pointer variable was referenced in an error
502+
message that reported that it shouldn't be NULL.
503+
(merge 753ecf4205 yc/path-walk-fix-error-reporting later to maint).
504+
505+
* The check in "receive-pack" to prevent a checked out branch from
506+
getting updated via updateInstead mechanism has been corrected.
507+
508+
* "git backfill" is capable of auto-detecting a sparsely checked out
509+
working tree, which was broken.
510+
(merge 339eba65a7 th/backfill-auto-detect-sparseness-fix later to maint).
511+
512+
* add_files_to_cache() used diff_files() to detect only the paths that
513+
are different between the index and the working tree and add them,
514+
which does not need rename detection, which interfered with unnecessary
515+
conflicts.
516+
(merge c0ce43376b ng/add-files-to-cache-wo-rename later to maint).
517+
458518
* Other code cleanup, docfix, build fix, etc.
459519
(merge d79fff4a11 jk/remote-tracking-ref-leakfix later to maint).
460520
(merge 7a747f972d dd/t5403-modernise later to maint).
@@ -506,3 +566,6 @@ Fixes since v2.53
506566
(merge 37182267a0 kh/doc-interpret-trailers-1 later to maint).
507567
(merge f64c50e768 jc/rerere-modern-strbuf-handling later to maint).
508568
(merge 699248d89e th/t8003-unhide-git-failures later to maint).
569+
(merge d8e34f971b za/t2000-modernise later to maint).
570+
(merge 849988bc74 th/t6101-unhide-git-failures later to maint).
571+
(merge 0f0ce07625 sp/doc-gitignore-oowt later to maint).

Documentation/git-fast-import.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ fast-import stream! This option is enabled automatically for
6666
remote-helpers that use the `import` capability, as they are
6767
already trusted to run their own code.
6868

69-
`--signed-tags=(verbatim|warn-verbatim|warn-strip|strip|abort)`::
69+
`--signed-tags=<mode>`::
7070
Specify how to handle signed tags. Behaves in the same way as
71-
the `--signed-commits=<mode>` below, except that the
72-
`strip-if-invalid` mode is not yet supported. Like for signed
73-
commits, the default mode is `verbatim`.
71+
the `--signed-commits=<mode>` below. Like for signed commits,
72+
the default mode is `verbatim`.
7473

7574
`--signed-commits=<mode>`::
7675
Specify how to handle signed commits. The following <mode>s
@@ -90,6 +89,8 @@ already trusted to run their own code.
9089
commit signatures and replaces invalid signatures with newly created ones.
9190
Valid signatures are left unchanged. If `<keyid>` is provided, that key is
9291
used for signing; otherwise the configured default signing key is used.
92+
* `abort-if-invalid` will make this program die when encountering a signed
93+
commit that is unable to be verified.
9394

9495
Options for Frontends
9596
~~~~~~~~~~~~~~~~~~~~~

Documentation/git-pack-objects.adoc

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,24 @@ base-name::
9494
included packs (those not beginning with `^`), excluding any
9595
objects listed in the excluded packs (beginning with `^`).
9696
+
97-
When `mode` is "follow", objects from packs not listed on stdin receive
98-
special treatment. Objects within unlisted packs will be included if
99-
those objects are (1) reachable from the included packs, and (2) not
100-
found in any excluded packs. This mode is useful, for example, to
101-
resurrect once-unreachable objects found in cruft packs to generate
102-
packs which are closed under reachability up to the boundary set by the
103-
excluded packs.
97+
When `mode` is "follow" packs may additionally be prefixed with `!`,
98+
indicating that they are excluded but not necessarily closed under
99+
reachability. In addition to objects in included packs, the resulting
100+
pack may include additional objects based on the following:
101+
+
102+
--
103+
* If any packs are marked with `!`, then objects reachable from such
104+
packs or included ones via objects outside of excluded-closed packs
105+
will be included. In this case, all `^` packs are treated as closed
106+
under reachability.
107+
* Otherwise (if there are no `!` packs), objects within unlisted packs
108+
will be included if those objects are (1) reachable from the
109+
included packs, and (2) not found in any excluded packs.
110+
--
111+
+
112+
This mode is useful, for example, to resurrect once-unreachable
113+
objects found in cruft packs to generate packs which are closed under
114+
reachability up to the boundary set by the excluded packs.
104115
+
105116
Incompatible with `--revs`, or options that imply `--revs` (such as
106117
`--all`), with the exception of `--unpacked`, which is compatible.

Documentation/git-replay.adoc

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ git-replay - EXPERIMENTAL: Replay commits on a new base, works with bare repos t
99
SYNOPSIS
1010
--------
1111
[verse]
12-
(EXPERIMENTAL!) 'git replay' ([--contained] --onto <newbase> | --advance <branch> | --revert <branch>) [--ref-action[=<mode>]] <revision-range>
12+
(EXPERIMENTAL!) 'git replay' ([--contained] --onto=<newbase> | --advance=<branch> | --revert=<branch>)
13+
[--ref=<ref>] [--ref-action=<mode>] <revision-range>
1314

1415
DESCRIPTION
1516
-----------
@@ -26,23 +27,23 @@ THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
2627
OPTIONS
2728
-------
2829

29-
--onto <newbase>::
30+
--onto=<newbase>::
3031
Starting point at which to create the new commits. May be any
3132
valid commit, and not just an existing branch name.
3233
+
3334
When `--onto` is specified, the branch(es) in the revision range will be
3435
updated to point at the new commits, similar to the way `git rebase --update-refs`
3536
updates multiple branches in the affected range.
3637

37-
--advance <branch>::
38+
--advance=<branch>::
3839
Starting point at which to create the new commits; must be a
3940
branch name.
4041
+
4142
The history is replayed on top of the <branch> and <branch> is updated to
4243
point at the tip of the resulting history. This is different from `--onto`,
4344
which uses the target only as a starting point without updating it.
4445

45-
--revert <branch>::
46+
--revert=<branch>::
4647
Starting point at which to create the reverted commits; must be a
4748
branch name.
4849
+
@@ -65,6 +66,16 @@ incompatible with `--contained` (which is a modifier for `--onto` only).
6566
Update all branches that point at commits in
6667
<revision-range>. Requires `--onto`.
6768

69+
--ref=<ref>::
70+
Override which reference is updated with the result of the replay.
71+
The ref must be fully qualified.
72+
When used with `--onto`, the `<revision-range>` should have a
73+
single tip and only the specified reference is updated instead of
74+
inferring refs from the revision range.
75+
When used with `--advance` or `--revert`, the specified reference is
76+
updated instead of the branch given to those options.
77+
This option is incompatible with `--contained`.
78+
6879
--ref-action[=<mode>]::
6980
Control how references are updated. The mode can be:
7081
+
@@ -79,8 +90,8 @@ The default mode can be configured via the `replay.refAction` configuration vari
7990

8091
<revision-range>::
8192
Range of commits to replay; see "Specifying Ranges" in
82-
linkgit:git-rev-parse[1]. In `--advance <branch>` or
83-
`--revert <branch>` mode, the range should have a single tip,
93+
linkgit:git-rev-parse[1]. In `--advance=<branch>` or
94+
`--revert=<branch>` mode, the range should have a single tip,
8495
so that it's clear to which tip the advanced or reverted
8596
<branch> should point. Any commits in the range whose changes
8697
are already present in the branch the commits are being
@@ -127,22 +138,22 @@ EXAMPLES
127138
To simply rebase `mybranch` onto `target`:
128139

129140
------------
130-
$ git replay --onto target origin/main..mybranch
141+
$ git replay --onto=target origin/main..mybranch
131142
------------
132143

133144
The refs are updated atomically and no output is produced on success.
134145

135146
To see what would be updated without actually updating:
136147

137148
------------
138-
$ git replay --ref-action=print --onto target origin/main..mybranch
149+
$ git replay --ref-action=print --onto=target origin/main..mybranch
139150
update refs/heads/mybranch ${NEW_mybranch_HASH} ${OLD_mybranch_HASH}
140151
------------
141152

142153
To cherry-pick the commits from mybranch onto target:
143154

144155
------------
145-
$ git replay --advance target origin/main..mybranch
156+
$ git replay --advance=target origin/main..mybranch
146157
------------
147158

148159
Note that the first two examples replay the exact same commits and on
@@ -154,7 +165,7 @@ What if you have a stack of branches, one depending upon another, and
154165
you'd really like to rebase the whole set?
155166

156167
------------
157-
$ git replay --contained --onto origin/main origin/main..tipbranch
168+
$ git replay --contained --onto=origin/main origin/main..tipbranch
158169
------------
159170

160171
All three branches (`branch1`, `branch2`, and `tipbranch`) are updated
@@ -165,7 +176,7 @@ commits to replay using the syntax `A..B`; any range expression will
165176
do:
166177

167178
------------
168-
$ git replay --onto origin/main ^base branch1 branch2 branch3
179+
$ git replay --onto=origin/main ^base branch1 branch2 branch3
169180
------------
170181

171182
This will simultaneously rebase `branch1`, `branch2`, and `branch3`,
@@ -176,7 +187,7 @@ that they have in common, but that does not need to be the case.
176187
To revert commits on a branch:
177188

178189
------------
179-
$ git replay --revert main topic~2..topic
190+
$ git replay --revert=main topic~2..topic
180191
------------
181192

182193
This reverts the last two commits from `topic`, creating revert commits on
@@ -188,6 +199,16 @@ NOTE: For reverting an entire merge request as a single commit (rather than
188199
commit-by-commit), consider using `git merge-tree --merge-base $TIP HEAD $BASE`
189200
which can avoid unnecessary merge conflicts.
190201

202+
To replay onto a specific commit while updating a different reference:
203+
204+
------------
205+
$ git replay --onto=112233 --ref=refs/heads/mybranch aabbcc..ddeeff
206+
------------
207+
208+
This replays the range `aabbcc..ddeeff` onto commit `112233` and updates
209+
`refs/heads/mybranch` to point at the result. This can be useful when you want
210+
to use bare commit IDs instead of branch names.
211+
191212
GIT
192213
---
193214
Part of the linkgit:git[1] suite

Documentation/git-stash.adoc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ git stash drop [-q | --quiet] [<stash>]
1414
git stash pop [--index] [-q | --quiet] [<stash>]
1515
git stash apply [--index] [-q | --quiet] [<stash>]
1616
git stash branch <branchname> [<stash>]
17-
git stash [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]
17+
git stash [push] [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]
1818
[-u | --include-untracked] [-a | --all] [(-m | --message) <message>]
1919
[--pathspec-from-file=<file> [--pathspec-file-nul]]
20-
[--] [<pathspec>...]]
20+
[--] [<pathspec>...]
2121
git stash save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]
2222
[-u | --include-untracked] [-a | --all] [<message>]
2323
git stash clear
@@ -60,10 +60,8 @@ COMMANDS
6060
the description along with the stashed state.
6161
+
6262
For quickly making a snapshot, you can omit "push". In this mode,
63-
non-option arguments are not allowed to prevent a misspelled
64-
subcommand from making an unwanted stash entry. The two exceptions to this
65-
are `stash -p` which acts as alias for `stash push -p` and pathspec elements,
66-
which are allowed after a double hyphen `--` for disambiguation.
63+
pathspec elements are only allowed after a double hyphen `--`
64+
to prevent a misspelled subcommand from making an unwanted stash entry.
6765

6866
`save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-u | --include-untracked] [-a | --all] [-q | --quiet] [<message>]`::
6967

Documentation/gitignore.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ PATTERN FORMAT
9696
particular `.gitignore` file itself. Otherwise the pattern may also
9797
match at any level below the `.gitignore` level.
9898
99+
- Patterns read from exclude sources that are outside the working tree,
100+
such as $GIT_DIR/info/exclude and core.excludesFile, are treated as if
101+
they are specified at the root of the working tree, i.e. a leading "/"
102+
in such patterns anchors the match at the root of the repository.
103+
99104
- If there is a separator at the end of the pattern then the pattern
100105
will only match directories, otherwise the pattern can match both
101106
files and directories.

Documentation/line-range-options.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212
(namely `--raw`, `--numstat`, `--shortstat`, `--dirstat`, `--summary`,
1313
`--name-only`, `--name-status`, `--check`) are not currently implemented.
1414
+
15+
Patch formatting options such as `--word-diff`, `--color-moved`,
16+
`--no-prefix`, and whitespace options (`-w`, `-b`) are supported,
17+
as are pickaxe options (`-S`, `-G`).
18+
+
1519
include::line-range-format.adoc[]

GIT-VERSION-GEN

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
DEF_VER=v2.54.0-rc0
3+
DEF_VER=v2.54.0-rc1
44

55
LF='
66
'

add-patch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
558558
strvec_push(&args,
559559
/* could be on an unborn branch */
560560
!strcmp("HEAD", s->revision) &&
561-
repo_get_oid(the_repository, "HEAD", &oid) ?
562-
empty_tree_oid_hex(the_repository->hash_algo) : s->revision);
561+
repo_get_oid(s->r, "HEAD", &oid) ?
562+
empty_tree_oid_hex(s->r->hash_algo) : s->revision);
563563
}
564564
color_arg_index = args.nr;
565565
/* Use `--no-color` explicitly, just in case `diff.color = always`. */
@@ -1271,7 +1271,7 @@ static int edit_hunk_manually(struct add_p_state *s, struct hunk *hunk)
12711271
"removed, then the edit is\n"
12721272
"aborted and the hunk is left unchanged.\n"));
12731273

1274-
if (strbuf_edit_interactively(the_repository, &s->buf,
1274+
if (strbuf_edit_interactively(s->r, &s->buf,
12751275
"addp-hunk-edit.diff", NULL) < 0)
12761276
return -1;
12771277

@@ -1679,7 +1679,7 @@ static size_t patch_update_file(struct add_p_state *s,
16791679
if (file_diff->hunk_nr) {
16801680
if (rendered_hunk_index != hunk_index) {
16811681
if (use_pager) {
1682-
setup_pager(the_repository);
1682+
setup_pager(s->r);
16831683
sigchain_push(SIGPIPE, SIG_IGN);
16841684
}
16851685
render_hunk(s, hunk, 0, colored, &s->buf);

0 commit comments

Comments
 (0)