4.1 Exercise 1

Problem

Take branch exercise1/branchA from the exercises repo. There is a short list of irregular verbs inside irregular.txt in alphabetical order. Add these two verbs: drink and know. Then take branch example1/branchB and add these other 2 verbs: lose and keep . Merge the two branches.

Conflict

You should see a conflict like this:

Listing 4.1:Exercise 1 - conflict
1# List of irregular verbs 
2# simple form<tab>past tense<tab>past participle 
3catch  caughtcaught 
4draw  drew  drawn 
5drink  drank  drinken 
6eat    ate    eaten 
7fight  foughtfought 
8fly    flew  flown 
9grow  grew  grown 
10hang  hung  hung 
11<<<<<<< HEAD 
12know  knew  known 
13======= 
14keep  kept  kept 
15>>>>>>> exercise1/branchB 
16let    let    let 
17lose  lost  lost 
18read  read  read 
19run    ran    run 
20sleep  slept  slept

You might have gotten the conflct section branches in reverse order (first keep, then know) if you were on branchB and then tried to merge branchA. Notice how the conflict is only related to know/keep. The other two verbs, drink and lose, were merged correctly, even though they come from different branches.

Resolution

Given that the verbs are ordered alphabetically, the resulting file looks like this:

Listing 4.2:Exercise 1 - Resolution
1# List of irregular verbs 
2# simple form<tab>past tense<tab>past participle 
3catch  caughtcaught 
4draw  drew  drawn 
5drink  drank  drinken 
6eat    ate    eaten 
7fight  foughtfought 
8fly    flew  flown 
9grow  grew  grown 
10hang  hung  hung 
11keep  kept  kept 
12know  knew  known 
13let    let    let 
14lose  lost  lost 
15read  read  read 
16run    ran    run 
17sleep  slept  slept

Given that the list is sorted alphabetically, keep had to be placed before know.