CS FundamentalsVery hardProduct-company placement · Git
main has A-B-C. feature branched from B and has D-E. On main you run git merge feature, creating merge commit M (first parent C, second parent E). With HEAD at M, what do HEAD^2 and HEAD~2 name?
- A. HEAD^2 = B and HEAD~2 = E
- B. HEAD^2 = E and HEAD~2 = B
- C. HEAD^2 = C and HEAD~2 = B
- D. HEAD^2 = E and HEAD~2 = D
Correct answer: B. HEAD^2 = E and HEAD~2 = B
^n picks the nth parent of a commit, so M^2 is E. ~n follows first parents n times: M~1 = C and M~2 = B. Following the second parent twice would give D, which is the trap.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- Which practice is characteristic of the Cleanroom software engineering process?
- A project has budget at completion ₹900 lakh, earned value ₹360 lakh and actual cost ₹420 lakh. What is the to-complete performance index…
- The Jelinski–Moranda model says the failure intensity before the i-th failure is φ(N − i + 1), where N is the initial number of faults and…
- In McCall's quality model, factors are grouped under product operation, product revision and product transition. Match each factor with…
- A loop while i < n: i = i + 1 (integers) has the invariant i ≤ n. To prove TOTAL correctness rather than only partial correctness, what…
- Match each UML sequence-diagram combined fragment with its meaning. P. alt Q. opt R. loop S. par 1. Runs only if its single guard is true…