1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-04-19 10:33:52 +02:00

Revert "Merge branch 'pb/complete-and-document-auto-merge-and-friends' into next"

This reverts commit 2728a01622, reversing
changes made to 6fb9527bf5, as it will be
replaced when 'next' is rebuilt.
This commit is contained in:
Junio C Hamano 2023-05-23 17:20:55 +09:00
parent 5a3d083765
commit ff1a2b2f28
5 changed files with 7 additions and 56 deletions

View File

@ -102,11 +102,7 @@ If --merge-base is given, use the merge base of the two commits for the
Just in case you are doing something exotic, it should be
noted that all of the <commit> in the above description, except
in the `--merge-base` case and in the last two forms that use `..`
notations, can be any <tree>. A tree of interest is the one pointed to
by the special ref `AUTO_MERGE`, which is written by the 'ort' merge
strategy upon hitting merge conflicts (see linkgit:git-merge[1]).
Comparing the working tree with `AUTO_MERGE` shows changes you've made
so far to resolve conflicts (see the examples below).
notations, can be any <tree>.
For a more complete list of ways to spell <commit>, see
"SPECIFYING REVISIONS" section in linkgit:gitrevisions[7].
@ -156,7 +152,6 @@ Various ways to check your working tree::
$ git diff <1>
$ git diff --cached <2>
$ git diff HEAD <3>
$ git diff AUTO_MERGE <4>
------------
+
<1> Changes in the working tree not yet staged for the next commit.
@ -164,7 +159,6 @@ $ git diff AUTO_MERGE <4>
would be committing if you run `git commit` without `-a` option.
<3> Changes in the working tree since your last commit; what you
would be committing if you run `git commit -a`
<4> Changes in the working tree you've made to resolve conflicts so far.
Comparing with arbitrary commits::
+

View File

@ -194,13 +194,9 @@ happens:
versions: stage 1 stores the version from the common ancestor,
stage 2 from `HEAD`, and stage 3 from `MERGE_HEAD` (you
can inspect the stages with `git ls-files -u`). The working
tree files contain the result of the merge operation; i.e. 3-way
tree files contain the result of the "merge" program; i.e. 3-way
merge results with familiar conflict markers `<<<` `===` `>>>`.
5. A special ref `AUTO_MERGE` is written, pointing to a tree corresponding
to the current content of the working tree (including conflict markers).
Note that this ref is only written when the 'ort' merge strategy
is used (the default).
6. No other changes are made. In particular, the local
5. No other changes are made. In particular, the local
modifications you had before you started merge will stay the
same and the index entries for them stay as they were,
i.e. matching `HEAD`.
@ -340,8 +336,7 @@ You can work through the conflict with a number of tools:
* Look at the diffs. `git diff` will show a three-way diff,
highlighting changes from both the `HEAD` and `MERGE_HEAD`
versions. `git diff AUTO_MERGE` will show what changes you've
made so far to resolve conlicts.
versions.
* Look at the diffs from each branch. `git log --merge -p <path>`
will show diffs first for the `HEAD` version and then the

View File

@ -32,9 +32,8 @@ characters and to avoid word splitting.
first match in the following rules:
. If '$GIT_DIR/<refname>' exists, that is what you mean (this is usually
useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD`,
`REBASE_HEAD`, `REVERT_HEAD`, `CHERRY_PICK_HEAD`, `BISECT_HEAD`
and `AUTO_MERGE`);
useful only for `HEAD`, `FETCH_HEAD`, `ORIG_HEAD`, `MERGE_HEAD`
and `CHERRY_PICK_HEAD`);
. otherwise, 'refs/<refname>' if it exists;
@ -56,18 +55,8 @@ you can easily change the tip of the branch back to the state before you ran
them.
`MERGE_HEAD` records the commit(s) which you are merging into your branch
when you run `git merge`.
`REBASE_HEAD`, during a rebase, records the commit at which the
operation is currently stopped, either because of conflicts or an `edit`
command in an interactive rebase.
`REVERT_HEAD` records the commit which you are reverting when you
run `git revert`.
`CHERRY_PICK_HEAD` records the commit which you are cherry-picking
when you run `git cherry-pick`.
`BISECT_HEAD` records the current commit to be tested when you
run `git bisect --no-checkout`.
`AUTO_MERGE` records a tree object corresponding to the state the
'ort' merge strategy wrote to the working tree when a merge operation
resulted in conflicts.
+
Note that any of the 'refs/*' cases above may come either from
the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file.

View File

@ -1343,33 +1343,6 @@ $ git diff -3 file.txt # diff against stage 3
$ git diff --theirs file.txt # same as the above.
-------------------------------------------------
When using the 'ort' merge strategy (the default), before updating the working
tree with the result of the merge, Git writes a special ref named AUTO_MERGE
reflecting the state of the tree it is about to write. Conflicted paths that
could not be automatically merged are written to this tree with conflict
markers, just as in the working tree. AUTO_MERGE can thus be used with
linkgit:git-diff[1] to show the changes you've made so far to resolve
conflicts. Using the same example as above, after resolving the conflict we
get:
-------------------------------------------------
$ git diff AUTO_MERGE
diff --git a/file.txt b/file.txt
index cd10406..8bf5ae7 100644
--- a/file.txt
+++ b/file.txt
@@ -1,5 +1 @@
-<<<<<<< HEAD:file.txt
-Hello world
-=======
-Goodbye
->>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
+Goodbye world
-------------------------------------------------
Notice that the diff shows we deleted the conflict markers and both versions,
and wrote "Goodbye world" instead.
The linkgit:git-log[1] and linkgit:gitk[1] commands also provide special help
for merges:

View File

@ -767,7 +767,7 @@ __git_refs ()
track=""
;;
*)
for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD REVERT_HEAD BISECT_HEAD AUTO_MERGE; do
for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD CHERRY_PICK_HEAD; do
case "$i" in
$match*|$umatch*)
if [ -e "$dir/$i" ]; then