Following Trunk Based Development, shown below:
Assume there are two short-lived feature branches(f1
and f2
) created from master
(trunk). For implementation, source code files used for these branches overlap, in this scenario.
Assume, there is one CI/CD pipeline for master
(trunk) that gets triggered on code change.
One code conflict that can be possible is functional, f1
could remove or modify existing source code that f2
uses.... This is not a VCS conflict.
Developer1 has perform git commit
on f1
(in laptop) at time t
and yet to push
Developer2 has perform git commit
on f2
(in laptop) at time t+24
and yet to push
As per my understanding, below is the scenario in commit History file of laptop, before push:
Given above sccenario,
f1
can get merge with master
, which is a simple fast-forward merge. So, master
and f1
will point to 156b4bf
commit snapshot, after this merge, as shown below:
CI/CD pipeline gets triggered, as merge is successful, with no conflicts
But when f2
commit happens after 24 hours, Git will perform 3-way merge using 3 snapshots(156b4bf
, 96f5b29
and c435356
), as shown below:
CI/CD pipeline gets triggered again, if merge is successful. My understanding is, Git should block 3-way merge due to functional conflict.
1) Using Git, Does fast-forward/3-way merge detect functional conflict?
2) If yes, are there any other non-VCS conflict scenarios that ApartCI address? that Git cannot... if yes, how?
Note: No plan to use Gitflow workflow