In the following graph, time flows from bottom to top:
| |
| |
3 | this is a commit on master, myfile.txt was modified by this commit
| |
| 2 this is a commit on branch mybranch, myfile.txt was modified by this commit
| |
|/
|
1 this is a commit on master, myfile.txt was modified by this commit
Now I need to merge mybranch into master, if I understood Git properly, myfile.txt now needs a file-level merge (see https://git-scm.com/docs/gitattributes#_performing_a_three_way_merge) because myfile.txt was modified in both the branches involved in the merge.
Regarding a custom merge driver, the help says that:
The
merge.*.drivervariable's value is used to construct a command to run to merge ancestor’s version (%O), current version (%A) and the other branches' version (%B). These three tokens are replaced with the names of temporary files that hold the contents of these versions when the command line is built.
My comprehension is that %O will be the name of a temporary file with the content of myfile.txt at commit 1, %A will be the name of a temporary file with the content of myfile.txt at commit 3 and %B will be the name of a temporary file with the content of at myfile.txt at commit 2.
Does the name of the temporary files embed in some way the commit id (the SHA-1)?
Is there any way to get the commit id of 1, 2 and 3?