I often have a need to find something I coded in an old version of script but I don't know when. I usually try to jump around in the log finding different versions and seeing if they have the change, or I just give up and try something else.
What would be particularly useful is a command that outputs every version of a file between two dates or hashes. Then an easy grep would find what I'm looking for.
It would probably work something like this:
git showeverything d612905a..b39af32e /path/to/file /tmp/output
git has the perfect tool for this: git log -S which will search for a change and only show those commits
# search changes in all branches which touch the string $abc in a file
git log -p -S'$abc' --all -- path/to/file
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