git log and git whatchanged shows 2 commits, but both have the same lines, so where was it deleted between them, so it added the same changes again?
I tried the command below, as there may be 2 commits having the same 2 lines that are added when there is no single commit inbetween that shows the lines as deleted. How to find out what happened with this file between these two commits?
git log --stat --follow -p at_Objects / AtResctrCase.cpp
commit 914f8e87cb88e2923ed089a579d69cfa21ae0bc4
at_Objects / AtResctrCase.cpp | 2 ++
1 file changed, 2 insertions (+), 0 deletions (-)
seller_bid_amount.clear(); //F 27116 auction_items.clear(); + //F-41959 + store_id.clear();
commit 6fe48ea09abae01a9bfea37e6ccf8e6c6fb360c2
at_Objects / AtResctrCase.cpp | 2 ++
1 file changed, 2 insertions (+), 0 deletions (-)
auction_items.clear(); //F-39023 is_acm_case = false; + //F-41959 + store_id.clear();
git diff 6fe48ea09abae01a9bfea37e6ccf8e6c6fb360c2 ^ .. 914f8e87cb88e2923ed089a579d69cfa21ae0bc4 - at_Objects / AtResctrCase.cpp
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(); }
While doing "git log", I found that several commits were made between them and checked if this file was modified in any of the commits. in order from last to oldest. A commit was found where the row was deleted. b4eec3024a18bd502735d88c31891eea646d3356 Combine: 9a74a46 66cc3f1. But why should it be deleted if no other commit between them changed this file? Did the machine delete the line? if this file was deleted during merge compilation, why it did not appear in "git log --stat --follow -p at_Objects / AtResctrCase.cpp" OR "git diff". Any suggestions that were highly appreciated.
$ 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
In the above commit, the row was manually added.
$ 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
Line F-41959 has been deleted here.
commit b4eec3024a18bd502735d88c31891eea646d3356 Merge: 9a74a46 66cc3f1
$ 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
The above commit is where the lines were originally added