Pages

Tuesday, 23 May 2017

Git - find a specific version by stacktrace

So you have a stacktrace, something that tells you that on line XXX an exception has been raised. You want to find out what was the exact version of the code that was running at that time.

git log origin/neutron-ha-tool-maintenance --oneline -- files/default/neutron-ha-tool.py |
cut -d " " -f 1 |
while read revision; do echo $revision; git show $revision:files/default/neutron-ha-tool.py |
sed -n 576,577p ; done |
less

No comments:

Post a Comment