How can I investigate how this commit got dropped?
The following commands show no history of the commit in the log:
git log -p apps/grants/views.py
gitk apps/grants/views.py
But the following all show the commit in the log:
git log
git log --follow -p apps/grants/views.py
git show 5034d44861fcc39fc28b069501577c8d15321b4f
UPDATE: No files were renamed in the commit. Here's the output of git log --stat
:
apps/articles/views.py | 4 +- apps/grants/tests.py | 16 +++++++----- apps/grants/views.py | 20 +++++++++------ static/css/modules.css | 36 ++++++++++++++-------------- templates/articles/learning_landing.html | 2 +- templates/grants/fellow_detail.html | 10 ++++++++ templates/modules/fellow_search_form.html | 2 +- 7 files changed, 53 insertions(+), 37 deletions(-)
Usually happens with a bad merge (i.e merge conflict)
in order to locate it
git log -U -m --simplify-merges --merges -- filename
You will see the missing code as well as the commit ids
It turns out that someone's merge commit was the culprit. Any information that wasn't included was lost in that merge. And since the merge commit didn't add or delete anything it didn't show up in the log run on the file.
The give away was git show 5eaa666
only had a subset of my changes.
I added the commit back in by cherry picking: git cherry-pick 5034d44
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With