From e037c2e41869489c1e17701a9f1c429ad9c18f9b Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 4 Aug 2021 23:50:45 +0000 Subject: git-rebase.txt: correct antiquated claims about --rebase-merges When --rebase-merges was first introduced, it only worked with the `recursive` strategy. Some time later, it gained support for merges using the `octopus` strategy. The limitation of only supporting these two strategies was documented in 25cff9f109 ("rebase -i --rebase-merges: add a section to the man page", 2018-04-25) and lifted in e145d99347 ("rebase -r: support merge strategies other than `recursive`", 2019-07-31). However, when the limitation was lifted, the documentation was not updated. Update it now. Acked-by: Johannes Schindelin Acked-by: Derrick Stolee Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- Documentation/git-rebase.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 55af6fd24e..8a67227846 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -1219,12 +1219,16 @@ successful merge so that the user can edit the message. If a `merge` command fails for any reason other than merge conflicts (i.e. when the merge operation did not even start), it is rescheduled immediately. -At this time, the `merge` command will *always* use the `recursive` -merge strategy for regular merges, and `octopus` for octopus merges, -with no way to choose a different one. To work around -this, an `exec` command can be used to call `git merge` explicitly, -using the fact that the labels are worktree-local refs (the ref -`refs/rewritten/onto` would correspond to the label `onto`, for example). +By default, the `merge` command will use the `recursive` merge +strategy for regular merges, and `octopus` for octopus merges. One +can specify a default strategy for all merges using the `--strategy` +argument when invoking rebase, or can override specific merges in the +interactive list of commands by using an `exec` command to call `git +merge` explicitly with a `--strategy` argument. Note that when +calling `git merge` explicitly like this, you can make use of the fact +that the labels are worktree-local refs (the ref `refs/rewritten/onto` +would correspond to the label `onto`, for example) in order to refer +to the branches you want to merge. Note: the first command (`label onto`) labels the revision onto which the commits are rebased; The name `onto` is just a convention, as a nod -- cgit v1.2.3 From b378df72ed147d346503341db06771c52cd2dbb8 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 4 Aug 2021 23:50:46 +0000 Subject: directory-rename-detection.txt: small updates due to merge-ort optimizations In commit 0c4fd732f0 ("Move computation of dir_rename_count from merge-ort to diffcore-rename", 2021-02-27), much of the logic for computing directory renames moved into diffcore-rename. directory-rename-detection.txt had claims that all of that logic was found in merge-recursive. Update the documentation. Acked-by: Derrick Stolee Acked-by: Johannes Schindelin Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- Documentation/technical/directory-rename-detection.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Documentation') diff --git a/Documentation/technical/directory-rename-detection.txt b/Documentation/technical/directory-rename-detection.txt index 49b83ef3cc..029ee2cedc 100644 --- a/Documentation/technical/directory-rename-detection.txt +++ b/Documentation/technical/directory-rename-detection.txt @@ -2,9 +2,9 @@ Directory rename detection ========================== Rename detection logic in diffcore-rename that checks for renames of -individual files is aggregated and analyzed in merge-recursive for cases -where combinations of renames indicate that a full directory has been -renamed. +individual files is also aggregated there and then analyzed in either +merge-ort or merge-recursive for cases where combinations of renames +indicate that a full directory has been renamed. Scope of abilities ------------------ @@ -88,9 +88,11 @@ directory rename detection support in: Folks have requested in the past that `git diff` detect directory renames and somehow simplify its output. It is not clear whether this would be desirable or how the output should be simplified, so this was - simply not implemented. Further, to implement this, directory rename - detection logic would need to move from merge-recursive to - diffcore-rename. + simply not implemented. Also, while diffcore-rename has most of the + logic for detecting directory renames, some of the logic is still found + within merge-ort and merge-recursive. Fully supporting directory + rename detection in diffs would require copying or moving the remaining + bits of logic to the diff machinery. * am -- cgit v1.2.3 From e80178eac6f3513bed7ec7ead9d5b0ebfa429241 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Wed, 4 Aug 2021 23:50:47 +0000 Subject: Documentation: edit awkward references to `git merge-recursive` A few places in the documentation referred to the "`recursive` strategy" using the phrase "`git merge-recursive`", suggesting that it was forking subprocesses to call a toplevel builtin. Perhaps that was relevant to when rebase was a shell script, but it seems like a rather indirect way to refer to the `recursive` strategy. Simplify the references. Acked-by: Derrick Stolee Acked-by: Johannes Schindelin Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- Documentation/git-rebase.txt | 5 ++--- Documentation/merge-options.txt | 4 ++-- Documentation/merge-strategies.txt | 9 +++++---- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 8a67227846..c3edcb07e3 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -354,9 +354,8 @@ See also INCOMPATIBLE OPTIONS below. -s :: --strategy=:: - Use the given merge strategy. - If there is no `-s` option 'git merge-recursive' is used - instead. This implies --merge. + Use the given merge strategy, instead of the default + `recursive`. This implies `--merge`. + Because 'git rebase' replays each commit from the working branch on top of the branch using the given strategy, using diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt index eb0aabd396..f819bd8dd6 100644 --- a/Documentation/merge-options.txt +++ b/Documentation/merge-options.txt @@ -112,8 +112,8 @@ With --squash, --commit is not allowed, and will fail. Use the given merge strategy; can be supplied more than once to specify them in the order they should be tried. If there is no `-s` option, a built-in list of strategies - is used instead ('git merge-recursive' when merging a single - head, 'git merge-octopus' otherwise). + is used instead (`recursive` when merging a single head, + `octopus` otherwise). -X