Skip to content

Commit 176e463

Browse files
committed
Merge branch 'ps/history' into pw/replay-drop-empty
* ps/history: (185 commits) builtin/history: implement "reword" subcommand builtin: add new "history" command wt-status: provide function to expose status for trees replay: yield the object ID of the final rewritten commit replay: small set of cleanups builtin/replay: move core logic into "libgit.a" builtin/replay: extract core logic to replay revisions The 15th batch t3650: add more regression tests for failure conditions replay: die if we cannot parse object replay: improve code comment and die message replay: die descriptively when invalid commit-ish is given replay: find *onto only after testing for ref name replay: remove dead code and rearrange The 14th batch The 13th batch config: use git_parse_int() in git_config_get_expiry_in_days() receive-pack: convert receive hooks to hook API receive-pack: convert update hooks to new API hooks: allow callers to capture output ...
2 parents f0ef5b6 + e125df7 commit 176e463

File tree

187 files changed

+5728
-2597
lines changed

Some content is hidden

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

187 files changed

+5728
-2597
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ jobs:
443443
- run: ci/install-dependencies.sh
444444
- run: useradd builder --create-home
445445
- run: chown -R builder .
446-
- run: sudo --preserve-env --set-home --user=builder ci/run-build-and-tests.sh
446+
- run: chmod a+w $GITHUB_ENV && sudo --preserve-env --set-home --user=builder ci/run-build-and-tests.sh
447447
- name: print test failures
448448
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
449449
run: sudo --preserve-env --set-home --user=builder ci/print-test-failures.sh

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
/git-grep
8080
/git-hash-object
8181
/git-help
82+
/git-history
8283
/git-hook
8384
/git-http-backend
8485
/git-http-fetch

Documentation/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ TECH_DOCS += technical/shallow
143143
TECH_DOCS += technical/sparse-checkout
144144
TECH_DOCS += technical/sparse-index
145145
TECH_DOCS += technical/trivial-merge
146+
TECH_DOCS += technical/unambiguous-types
146147
TECH_DOCS += technical/unit-tests
147148
SP_ARTICLES += $(TECH_DOCS)
148149
SP_ARTICLES += technical/api-index

Documentation/RelNotes/2.53.0.adoc

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ UI, Workflows & Features
2020

2121
* Add a new manual that describes the data model.
2222

23+
* "git fast-import" learns "--strip-if-invalid" option to drop
24+
invalid cryptographic signature from objects.
25+
26+
* The use of "revision" (a connected set of commits) has been
27+
clarified in the "git replay" documentation.
28+
29+
* A help message from "git branch" now mentions "git help" instead of
30+
"man" when suggesting to read some documentation.
31+
32+
* "git repo struct" learned to take "-z" as a synonym to "--format=nul".
33+
34+
* More object database related information are shown in "git repo
35+
structure" output.
36+
2337

2438
Performance, Internal Implementation, Development Support etc.
2539
--------------------------------------------------------------
@@ -38,6 +52,46 @@ Performance, Internal Implementation, Development Support etc.
3852
* A part of code paths that deals with loose objects has been cleaned
3953
up.
4054
55+
* "make strip" has been taught to strip "scalar" as well as "git".
56+
57+
* Dockerised jobs at the GitHub Actions CI have been taught to show
58+
more details of failed tests.
59+
60+
* Code refactoring around object database sources.
61+
62+
* Halve the memory consumed by artificial filepairs created during
63+
"git diff --find-copioes-harder", also making the operation run
64+
faster.
65+
66+
* The "git_istream" abstraction has been revamped to make it easier
67+
to interface with pluggable object database design.
68+
69+
* Rewrite the only use of "mktemp()" that is subject to TOCTOU race
70+
and Stop using the insecure "mktemp()" function.
71+
(merge 10bba537c4 rs/ban-mktemp later to maint).
72+
73+
* In-code comment update to clarify that single-letter options are
74+
outside of the scope of command line completion script.
75+
(merge dc8a00fafe jc/completion-no-single-letter-options later to maint).
76+
77+
* MEMZERO_ARRAY() helper is introduced to avoid clearing only the
78+
first N bytes of an N-element array whose elements are larger than
79+
a byte.
80+
81+
* "git diff-files -R --find-copies-harder" has been taught to use
82+
the potential copy sources from the index correctly.
83+
84+
* Require C99 style flexible array member support from all platforms.
85+
86+
* The code path that enumerates promisor objects have been optimized
87+
to skip pointlessly parsing blob objects.
88+
89+
* Prepare test suite for Git for Windows that supports symbolic
90+
links.
91+
92+
* Use hook API to replace ad-hoc invocation of hook scripts with the
93+
run_command() API.
94+
4195
4296
Fixes since v2.52
4397
-----------------
@@ -105,8 +159,96 @@ Fixes since v2.52
105159
* Various issues detected by Asan have been corrected.
106160
(merge a031b6181a jk/asan-bonanza later to maint).
107161

162+
* "git config get --path" segfaulted on an ":(optional)path" that
163+
does not exist, which has been corrected.
164+
(merge 0bd16856ff jc/optional-path later to maint).
165+
166+
* The "--committer-date-is-author-date" option of "git am/rebase" is
167+
a misguided one. The documentation is updated to discourage its
168+
use.
169+
(merge fbf3d0669f kh/doc-committer-date-is-author-date later to maint).
170+
171+
* The option help text given by "git config unset -h" described
172+
the "--all" option to "replace", not "unset", multiple variables,
173+
which has been corrected.
174+
(merge 18bf67b753 rs/config-unset-opthelp-fix later to maint).
175+
176+
* The error message given by "git config set", when the variable
177+
being updated has more than one values defined, used old style "git
178+
config" syntax with an incorrect option in its hint, both of which
179+
have been corrected.
180+
(merge df963f0df4 rs/config-set-multi-error-message-fix later to maint).
181+
182+
* "git replay" forgot to omit the "gpgsig-sha256" extended header
183+
from the resulting commit the same way it omits "gpgsig", which has
184+
been corrected.
185+
(merge 9f3a115087 pw/replay-exclude-gpgsig-fix later to maint).
186+
187+
* A few tests have been updated to work under the shell compatible
188+
mode of zsh.
189+
(merge a92f243a94 bc/zsh-testsuite later to maint).
190+
191+
* The way patience diff finds LCS has been optimized.
192+
(merge c7e3b8085b yc/xdiff-patience-optim later to maint).
193+
194+
* Recent optimization to "last-modified" command introduced use of
195+
uninitialized block of memory, which has been corrected.
196+
(merge fe4e60759b tc/last-modified-active-paths-optimization later to maint).
197+
198+
* "git last-modified" used to mishandle "--" to mark the beginning of
199+
pathspec, which has been corrected.
200+
(merge 05491b90ce js/last-modified-with-sparse-checkouts later to maint).
201+
202+
* Emulation code clean-up.
203+
(merge 42aa7603aa gf/win32-pthread-cond-init later to maint).
204+
205+
* "git submodule add" to add a submodule under <name> segfaulted,
206+
when a submodule.<name>.something is already in .gitmodules file
207+
without defining where its submodule.<name>.path is, which has been
208+
corrected.
209+
(merge dd8e8c786e jc/submodule-add later to maint).
210+
211+
* "git fetch" that involves fetching tags, when a tag being fetched
212+
needs to overwrite existing one, failed to fetch other tags, which
213+
has been corrected.
214+
(merge b7b17ec8a6 kn/fix-fetch-backfill-tag-with-batched-ref-updates later to maint).
215+
216+
* Document "rev-list --filter-provided-objects" better.
217+
(merge 6d8dc99478 jt/doc-rev-list-filter-provided-objects later to maint).
218+
219+
* Even when there is no changes in the packfile and no need to
220+
recompute bitmaps, "git repack" recomputed and updated the MIDX
221+
file, which has been corrected.
222+
(merge 6ce9d558ce ps/repack-avoid-noop-midx-rewrite later to maint).
223+
224+
* Update HTTP tests to adjust for changes in curl 8.18.0
225+
(merge 17f4b01da7 jk/test-curl-updates later to maint).
226+
227+
* Workaround the "iconv" shipped as part of macOS, which is broken
228+
handling stateful ISO/IEC 2022 encoded strings.
229+
(merge cee341e9dd rs/macos-iconv-workaround later to maint).
230+
108231
* Other code cleanup, docfix, build fix, etc.
109232
(merge 46207a54cc qj/doc-http-bad-want-response later to maint).
110233
(merge df90eccd93 kh/doc-commit-extra-references later to maint).
111234
(merge f18aa68861 rs/xmkstemp-simplify later to maint).
112235
(merge fddba8f737 ja/doc-synopsis-style later to maint).
236+
(merge 22ce0cb639 en/xdiff-cleanup-2 later to maint).
237+
(merge 8ef7355a8f je/doc-pull later to maint).
238+
(merge 48176f953f jc/capability-leak later to maint).
239+
(merge 8cbbdc92f7 kh/doc-pre-commit-fix later to maint).
240+
(merge d4bc39a4d9 mh/doc-config-gui-gcwarning later to maint).
241+
(merge 41d425008a kh/doc-send-email-paragraph-fix later to maint).
242+
(merge d4b732899e jc/macports-darwinports later to maint).
243+
(merge bab391761d kj/pull-options-decl-cleanup later to maint).
244+
(merge 007b8994d4 rs/t4014-git-version-string-fix later to maint).
245+
(merge 4ce170c522 ds/doc-scalar-config later to maint).
246+
(merge a0c813951a jc/doc-commit-signoff-config later to maint).
247+
(merge 8ee262985a ja/doc-misc-fixes later to maint).
248+
(merge 1722c2244b mh/doc-core-attributesfile later to maint).
249+
(merge c469ca26c5 dk/ci-rust-fix later to maint).
250+
(merge 12f0be0857 gf/clear-path-cache-cleanup later to maint).
251+
(merge 949df6ed6b js/test-func-comment-fix later to maint).
252+
(merge 93f894c001 bc/checkout-error-message-fix later to maint).
253+
(merge abf05d856f rs/show-branch-prio-queue later to maint).
254+
(merge 06188ea5f3 rs/parse-config-expiry-simplify later to maint).

Documentation/config/core.adoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,9 @@ core.askPass::
492492
command-line argument and write the password on its STDOUT.
493493

494494
core.attributesFile::
495-
In addition to `.gitattributes` (per-directory) and
496-
`.git/info/attributes`, Git looks into this file for attributes
497-
(see linkgit:gitattributes[5]). Path expansions are made the same
498-
way as for `core.excludesFile`. Its default value is
495+
Specifies the pathname to the file that contains attributes (see
496+
linkgit:gitattributes[5]), in addition to `.gitattributes` (per-directory)
497+
and `.git/info/attributes`. Its default value is
499498
`$XDG_CONFIG_HOME/git/attributes`. If `$XDG_CONFIG_HOME` is either not
500499
set or empty, `$HOME/.config/git/attributes` is used instead.
501500

Documentation/config/gui.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,8 @@ gui.blamehistoryctx::
5555
linkgit:gitk[1] for the selected commit, when the `Show History
5656
Context` menu item is invoked from 'git gui blame'. If this
5757
variable is set to zero, the whole history is shown.
58+
59+
gui.GCWarning::
60+
Determines whether linkgit:git-gui[1] should prompt for garbage
61+
collection when git detects a large number of loose objects in
62+
the repository. The default value is "true".

Documentation/git-am.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ Valid <action> for the `--whitespace` option are:
162162
commit creation as the committer date. This allows the
163163
user to lie about the committer date by using the same
164164
value as the author date.
165+
+
166+
WARNING: The history walking machinery assumes that commits have
167+
non-decreasing commit timestamps. You should consider if you really need
168+
to use this option. Then you should only use this option to override the
169+
committer date when applying commits on top of a base which commit is
170+
older (in terms of the commit date) than the oldest patch you are
171+
applying.
165172

166173
--ignore-date::
167174
By default the command records the date from the e-mail

Documentation/git-checkout.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ ARGUMENT DISAMBIGUATION
509509
-----------------------
510510
511511
When you run `git checkout <something>`, Git tries to guess whether
512-
`<something>` is intended to be a branch, a commit, or a set of file(s),
512+
_<something>_ is intended to be a branch, a commit, or a set of file(s),
513513
and then either switches to that branch or commit, or restores the
514514
specified files.
515515

Documentation/git-fast-import.adoc

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,26 @@ 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)::
70-
Specify how to handle signed tags. Behaves in the same way
71-
as the same option in linkgit:git-fast-export[1], except that
72-
default is 'verbatim' (instead of 'abort').
73-
74-
--signed-commits=(verbatim|warn-verbatim|warn-strip|strip|abort)::
75-
Specify how to handle signed commits. Behaves in the same way
76-
as the same option in linkgit:git-fast-export[1], except that
77-
default is 'verbatim' (instead of 'abort').
69+
`--signed-tags=(verbatim|warn-verbatim|warn-strip|strip|abort)`::
70+
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`.
74+
75+
`--signed-commits=<mode>`::
76+
Specify how to handle signed commits. The following <mode>s
77+
are supported:
78+
+
79+
* `verbatim`, which is the default, will silently import commit
80+
signatures.
81+
* `warn-verbatim` will import them, but will display a warning.
82+
* `abort` will make this program die when encountering a signed
83+
commit.
84+
* `strip` will silently make the commits unsigned.
85+
* `warn-strip` will make them unsigned, but will display a warning.
86+
* `strip-if-invalid` will check signatures and, if they are invalid,
87+
will strip them and display a warning. The validation is performed
88+
in the same way as linkgit:git-verify-commit[1] does it.
7889

7990
Options for Frontends
8091
~~~~~~~~~~~~~~~~~~~~~

Documentation/git-history.adoc

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
git-history(1)
2+
==============
3+
4+
NAME
5+
----
6+
git-history - EXPERIMENTAL: Rewrite history
7+
8+
SYNOPSIS
9+
--------
10+
[synopsis]
11+
git history reword <commit> [--ref-action=(branches|head|print)]
12+
13+
DESCRIPTION
14+
-----------
15+
16+
Rewrite history by rearranging or modifying specific commits in the
17+
history.
18+
19+
THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
20+
21+
This command is related to linkgit:git-rebase[1] in that both commands can be
22+
used to rewrite history. There are a couple of major differences though:
23+
24+
* linkgit:git-history[1] can work in a bare repository as it does not need to
25+
touch either the index or the worktree.
26+
* linkgit:git-history[1] does not execute any linkgit:githooks[5] at the
27+
current point in time. This may change in the future.
28+
* linkgit:git-history[1] by default updates all branches that are descendants
29+
of the original commit to point to the rewritten commit.
30+
31+
Overall, linkgit:git-history[1] aims to provide a more opinionated way to modify
32+
your commit history that is simpler to use compared to linkgit:git-rebase[1] in
33+
general.
34+
35+
Use linkgit:git-rebase[1] if you want to reapply a range of commits onto a
36+
different base, or interactive rebases if you want to edit a range of commits
37+
at once.
38+
39+
LIMITATIONS
40+
-----------
41+
42+
This command does not (yet) work with histories that contain merges. You
43+
should use linkgit:git-rebase[1] with the `--rebase-merges` flag instead.
44+
45+
Furthermore, the command does not support operations that can result in merge
46+
conflicts. This limitation is by design as history rewrites are not intended to
47+
be stateful operations. The limitation can be lifted once (if) Git learns about
48+
first-class conflicts.
49+
50+
COMMANDS
51+
--------
52+
53+
Several commands are available to rewrite history in different ways:
54+
55+
`reword <commit>`::
56+
Rewrite the commit message of the specified commit. All the other
57+
details of this commit remain unchanged. This command will spawn an
58+
editor with the current message of that commit.
59+
60+
OPTIONS
61+
-------
62+
63+
`--ref-action=(branches|head|print)`::
64+
Control which references will be updated by the command, if any. With
65+
`branches`, all local branches that point to commits which are
66+
decendants of the original commit will be rewritten. With `head`, only
67+
the current `HEAD` reference will be rewritten. With `print`, all
68+
updates as they would be performed with `branches` are printed in a
69+
format that can be consumed by linkgit:git-update-ref[1].
70+
71+
GIT
72+
---
73+
Part of the linkgit:git[1] suite

0 commit comments

Comments
 (0)