Note that there are some explanatory texts on larger screens.

plurals
  1. POgit log and git whatchanged allowing duplicate commits
    text
    copied!<p>The git log and git whatchanged shows 2 commits, but both have same lines added, so where was it removed inbetween so it allwed adding same changes again?</p> <p>I tried the below command, how can there be 2 commits having the same 2 lines added, when there is not a single commit inbetween which show the lines as removed. How to i find what happened to this file, inbetween these 2 commit?</p> <p><strong>git log --stat --follow -p at_Objects/AtResctrCase.cpp</strong></p> <p>commit 914f8e87cb88e2923ed089a579d69cfa21ae0bc4</p> <p>at_Objects/AtResctrCase.cpp | 2 ++</p> <p>1 files changed, 2 insertions(+), 0 deletions(-)</p> <pre><code> seller_bid_amount.clear(); //F 27116 auction_items.clear(); + //F-41959 + store_id.clear(); </code></pre> <p>commit 6fe48ea09abae01a9bfea37e6ccf8e6c6fb360c2</p> <p>at_Objects/AtResctrCase.cpp | 2 ++</p> <p>1 files changed, 2 insertions(+), 0 deletions(-)</p> <pre><code> auction_items.clear(); //F-39023 is_acm_case = false; + //F-41959 + store_id.clear(); </code></pre> <p><strong>git diff 6fe48ea09abae01a9bfea37e6ccf8e6c6fb360c2^..914f8e87cb88e2923ed089a579d69cfa21ae0bc4 -- at_Objects/AtResctrCase.cpp</strong></p> <pre><code>diff --git a/at_Objects/AtResctrCase.cpp b/at_Objects/AtResctrCase.cpp index 91fe41a..878d184 100644 --- a/at_Objects/AtResctrCase.cpp +++ b/at_Objects/AtResctrCase.cpp @@ -32,4 +32,6 @@ void AtResctrCase::clear() auction_items.clear(); //F-39023 is_acm_case = false; + //F-41959 + store_id.clear(); } </code></pre> <p>Doing a "git log" i found a few commits inbetween and checked whether this file was modified in any of the commit. in the order of Recent to oldest. Found the commit where the line was removed. b4eec3024a18bd502735d88c31891eea646d3356 Merge: 9a74a46 66cc3f1. But why it should be removed when no other commit inbetween modified this file? Did the automerge remove the line? if this file was removed in the merge commit, why it didnt show up in "git log --stat --follow -p at_Objects/AtResctrCase.cpp" OR "git diff". Any suggestions much appreciated.</p> <pre><code>$ git show -m --name-status 914f8e87cb88e2923ed089a579d69cfa21ae0bc4 | grep AtResctrCase.cpp M at_Objects/AtResctrCase.cpp $ git show -m --name-status 914f8e87cb88e2923ed089a579d69cfa21ae0bc4:at_Objects/AtResctrCase.cpp | grep F-41959 //F-41959 </code></pre> <p><strong>In the above commit the line was manually re-added.</strong> </p> <pre><code>$ git show -m --name-status 62a3731fbc1d008342ac72614faaf7fd9e7e312b | grep AtResctrCase.cpp $ git show -m --name-status 8a8de0663381f70677d6685d4ae214becd1f4310 | grep AtResctrCase.cpp $ git show -m --name-status **b4eec3024a18bd502735d88c31891eea646d3356** | grep AtResctrCase.cpp M at_Objects/AtResctrCase.cpp $ git show -m --name-status b4eec3024a18bd502735d88c31891eea646d3356:at_Objects/AtResctrCase.cpp | grep F-41959 </code></pre> <p><strong>The line F-41959 has been removed here.</strong></p> <p>commit <strong>b4eec3024a18bd502735d88c31891eea646d3356</strong> Merge: <strong>9a74a46 66cc3f1</strong></p> <pre><code>$ git show -m --name-status **9a74a46a47e425e35bc73a532a374ab5e67ec478** | grep AtResctrCase.cpp $ git show -m --name-status **66cc3f136c91c2fb7c71915a1dbd4fbf9facf761** | grep AtResctrCase.cpp $ git show -m --name-status 50b5cfac734f3a4231e60144d6223d68412900b5 | grep AtResctrCase.cpp M at_Objects/AtResctrCase.cpp $ git show -m --name-status 50b5cfac734f3a4231e60144d6223d68412900b5:at_Objects/AtResctrCase.cpp | grep F-41959 //F-41959 </code></pre> <p><strong>The above commit is where the lines were initially added</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload