Question on merge order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have a question on the order with which commits are applied on a merge.

I am merging two branches that have changes on the same text file and
I'd like to ask you about the merge result.

The following output is provided on the two branches to be merged, by
the command:
git show-branch --date-order branchA branchB

! [branchA] file.txt got form A
 * [branchB] file.txt got form B
--
+  [branchA] file.txt got form A
 * [branchB] file.txt got form B
+  [branchA^] file.txt got form B
+* [branchA~2] First version of file.txt (form A)

Now, this text file alternates between the following contents:

According to form A, file.txt contains only one line of text:
Gerasimos

According to form B, file.txt contains three lines of text:
PL-3
PL-4
PL-5

The merge is done with the following commands:
git checkout branchA
git merge branchB

Now, the result of the merge gets file.txt to form B, i.e. it contains
the above 3 lines of text.
My question is, why does the merge have the file resolve to form B and
not to form A ?
Theoretically, the merge could resolve to either A or B form. If the
date is taken into account, maybe the A
could even appear to be a better result.

Thank you in advance and BRs,
Gerasimos
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]