I\'ve looked around, and am not sure if this is possible, but here goes:
I have a (javascript) file (say /lib/client.js) in which I have a unique identifier assigned
If you adapt @rob's answer just a bit, git log will basically do this for you, if all you need is a visual comparison:
git log -U0 -S "var identifier =" path/to/file
-U0 means output in patch mode (-p), and show zero lines of context around the patch.
You can even do this across branches:
git log -U0 -S "var identifier =" branchname1 branchname2 -- path/to/file
There may be a way to suppress the diff header, but I don't know of one.