tags:

views:

99

answers:

1

So I was tasked at replacing some dummy code that our project requires for historical compatibility reasons but has mysteriously dropped out sometime since the last release. Since disappearing code makes me nervous about what else might have gone missing but un-noticed I've been digging through the logs trying to find in what commit this handful of lines was removed. I've tried a number of things including "git log -S'add-visit-resource-pcf'", git blame, and even git bisect with a script that simply checks for the existence of the line but have been unable to pinpoint exactly where these lines were removed. I find this very perplexing, particularly since the last log entry (obtained by the above command) before my re-introduction of this code was someone else adding the code as well.

commit 0b0556fa87ff80d0ffcc2b451cca1581289bbc3c
Author: Andrew 
Date:   Thu May 13 10:55:32 2010 -0400

    Re-introduced add-visit-resource-pcf, see PR-65034.

diff --git a/spike/hst/scheduler/defpackage.lisp b/spike/hst/scheduler/defpackage.lisp
index f8e692d..a6f8d38 100644
--- a/spike/hst/scheduler/defpackage.lisp
+++ b/spike/hst/scheduler/defpackage.lisp
@@ -115,6 +115,7 @@
     #:add-to-current-resource-pcf
     #:add-user-package-nickname
     #:add-value-criteria
+    #:add-visit-resource-pcf
     #:add-window-to-gs-params
     #:adjust-derived-resources
     #:adjust-links-candidate-criteria-types

commit 9fb10e25572c537076284a248be1fbf757c1a6e1
Author: Bob 
Date:   Sun Jan 17 18:35:16 2010 -0500

    update-defpackage for Spike 33.1 Delivery

diff --git a/spike/hst/scheduler/defpackage.lisp b/spike/hst/scheduler/defpackage.lisp
index 983666d..47f1a9a 100644
--- a/spike/hst/scheduler/defpackage.lisp
+++ b/spike/hst/scheduler/defpackage.lisp
@@ -118,6 +118,7 @@
     #:add-user-package-nickname
     #:add-value-criteria
     #:add-vars-from-proposal
+    #:add-visit-resource-pcf
     #:add-window-to-gs-params
     #:adjust-derived-resources
     #:adjust-links-candidate-criteria-types

This is for one of our package definition files, but the relevant source file reflects something similar. Does anyone know what could be going on here and how I could find the information I want? It's not really that important but this kind of things makes me a bit nervous.

+3  A: 

I suspect you may have an evil merge - a merge commit which makes an actual change. Perhaps it was an innocent mistake as part of conflict resolution. Assuming this is what happened, let's see how to find it...

git log -Sstring doesn't seem to deal with evil merges properly. (And unfortunately git log --cc -Sstring doesn't convince it to look at them properly; it just selects all merge commits.)

With this handicap, I can think of two options:

  • Manually test merge commits

  • Kludge your own log -S: search the output of git log --merges -p -cc for the target line. It should look like -- #:add-visit-resource-pcf, though the quickest way is probably just to pipe to less and search for add-visit-resource-pcf.

The moral of the story is, of course, that there's a reason evil merges are called evil.

I'm surprised you weren't able to find it with a bisect, by the way. I'm pretty sure bisect's capable of giving merge commits as results.

Jefromi
Thanks for the ideas, I'll try them when I get in tomorrow.
Andrew Myers
Thanks Jefromi, I was able to find the merge commit where it dropped out using the kludge method.
Andrew Myers