diff --git a/.gitignore b/.gitignore index 78a45cb5bec991..24635cf2d6f4a3 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,7 @@ /git-grep /git-hash-object /git-help +/git-history /git-hook /git-http-backend /git-http-fetch diff --git a/Documentation/RelNotes/2.54.0.adoc b/Documentation/RelNotes/2.54.0.adoc index 20c660d82a40cf..59bb58e449b165 100644 --- a/Documentation/RelNotes/2.54.0.adoc +++ b/Documentation/RelNotes/2.54.0.adoc @@ -7,6 +7,17 @@ UI, Workflows & Features * "git add -p" and friends note what the current status of the hunk being shown is. + * "git history" history rewriting (experimental) command has been + added. + + + * "git replay" is taught to drop commits that become empty (not the + ones that are empty in the original). + + * The help text and the documentation for the "--expire" option of + "git worktree [list|prune]" have been improved. + + Performance, Internal Implementation, Development Support etc. -------------------------------------------------------------- @@ -15,6 +26,11 @@ Performance, Internal Implementation, Development Support etc. each other by encoding submodule names before using them as path components. + * The string_list API gains a new helper, string_list_sort_u(), and + new unit tests to extend coverage. + + * Improve set-up time of a perf test. + Fixes since v2.53 ----------------- @@ -31,6 +47,11 @@ Fixes since v2.53 "-z") in the "git last-modified" command have been updated. (merge 9dcc09bed1 tc/last-modified-options-cleanup later to maint). + * A handful of code paths that started using batched ref update API + (after Git 2.51 or so) lost detailed error output, which have been + corrected. + (merge eff9299eac kn/ref-batch-output-error-reporting-fix later to maint). + * Other code cleanup, docfix, build fix, etc. (merge d79fff4a11 jk/remote-tracking-ref-leakfix later to maint). (merge 7a747f972d dd/t5403-modernise later to maint). diff --git a/Documentation/git-history.adoc b/Documentation/git-history.adoc new file mode 100644 index 00000000000000..154e262b76a698 --- /dev/null +++ b/Documentation/git-history.adoc @@ -0,0 +1,73 @@ +git-history(1) +============== + +NAME +---- +git-history - EXPERIMENTAL: Rewrite history + +SYNOPSIS +-------- +[synopsis] +git history reword [--ref-action=(branches|head|print)] + +DESCRIPTION +----------- + +Rewrite history by rearranging or modifying specific commits in the +history. + +THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE. + +This command is related to linkgit:git-rebase[1] in that both commands can be +used to rewrite history. There are a couple of major differences though: + +* linkgit:git-history[1] can work in a bare repository as it does not need to + touch either the index or the worktree. +* linkgit:git-history[1] does not execute any linkgit:githooks[5] at the + current point in time. This may change in the future. +* linkgit:git-history[1] by default updates all branches that are descendants + of the original commit to point to the rewritten commit. + +Overall, linkgit:git-history[1] aims to provide a more opinionated way to modify +your commit history that is simpler to use compared to linkgit:git-rebase[1] in +general. + +Use linkgit:git-rebase[1] if you want to reapply a range of commits onto a +different base, or interactive rebases if you want to edit a range of commits +at once. + +LIMITATIONS +----------- + +This command does not (yet) work with histories that contain merges. You +should use linkgit:git-rebase[1] with the `--rebase-merges` flag instead. + +Furthermore, the command does not support operations that can result in merge +conflicts. This limitation is by design as history rewrites are not intended to +be stateful operations. The limitation can be lifted once (if) Git learns about +first-class conflicts. + +COMMANDS +-------- + +The following commands are available to rewrite history in different ways: + +`reword `:: + Rewrite the commit message of the specified commit. All the other + details of this commit remain unchanged. This command will spawn an + editor with the current message of that commit. + +OPTIONS +------- + +`--ref-action=(branches|head|print)`:: + Control which references will be updated by the command, if any. With + `branches`, all local branches that point to commits which are + descendants of the original commit will be rewritten. With `head`, only + the current `HEAD` reference will be rewritten. With `print`, all + updates as they would be performed with `branches` are printed in a + format that can be consumed by linkgit:git-update-ref[1]. + +GIT +--- +Part of the linkgit:git[1] suite diff --git a/Documentation/git-replay.adoc b/Documentation/git-replay.adoc index c3b214ec6964c7..8d696ce3abb491 100644 --- a/Documentation/git-replay.adoc +++ b/Documentation/git-replay.adoc @@ -62,7 +62,9 @@ The default mode can be configured via the `replay.refAction` configuration vari Range of commits to replay; see "Specifying Ranges" in linkgit:git-rev-parse[1]. In `--advance ` mode, the range should have a single tip, so that it's clear to which tip the - advanced should point. + advanced should point. Any commits in the range whose + changes are already present in the branch the commits are being + replayed onto will be dropped. :git-replay: 1 include::rev-list-options.adoc[] diff --git a/Documentation/git-worktree.adoc b/Documentation/git-worktree.adoc index d74ad7b0e9bd75..fbf8426cd974e4 100644 --- a/Documentation/git-worktree.adoc +++ b/Documentation/git-worktree.adoc @@ -131,7 +131,13 @@ with linked worktrees if you move the main worktree manually.) `prune`:: -Prune worktree information in `$GIT_DIR/worktrees`. +Remove worktree information in `$GIT_DIR/worktrees` for worktrees +whose working trees are missing. Useful after manually removing +a working tree that is no longer needed (but use "git worktree +remove" next time you want to do so). Also, if you _moved_ a +working tree elsewhere causing the worktree information to become +dangling, see "git worktree repair" to reconnect the worktree to +the new working tree location. `remove`:: @@ -271,7 +277,7 @@ mismatch, even if the links are correct. With `list`, output additional information about worktrees (see below). `--expire