1
0
forked from ovh/pci-test

feat: Added exercise 4

This commit is contained in:
syrell 2024-12-01 21:26:38 +01:00
parent 9ef89a992f
commit 9af118a396

3
ex4/README.md Normal file
View File

@ -0,0 +1,3 @@
# Check diff
We have a diff between merged and rebased branches because merge and rebase are two different process that will not necessarily end in the same result. With merge we retrieve the remote branch at current stage (HEAD points to latest commit from the remote branch) so we will end up with exactly the same code than on the remote branch. With checkout we retrieve all commits we don't have from remote branch onto the common ancestor and other commits from our local branch are put after. In our case, our local branch was A => B => F so afer the merge we end up with A => B => F => merge commit wheareas after the rebase we end up with A => B => C => D => E => F => G => B" => F" since the common ancestor is A. Although B and F from our local branch were cherry-picked from stein branch applying them on top of stein commits (A => B => C => D => E => F => G) made new changes. More precisely, some hunks modified by B are overriden by new commits from stein branch (C, D, E or G) therefore since the rebase process reapplied the B commit these hunks have been modified once more hence the diff we have between merged and rebased branches. Finally, hunks modified by F were not overriden by G thus reapplying F didn't make any new change that's why rebased branch git tree is A => B => C => D => E => F => G => B".