From e0835cf425b5c926833f6e58a0ab6db82cde2b2b Mon Sep 17 00:00:00 2001 From: "Christian P. V. Christoffersen" <88783438+br-cpvc@users.noreply.github.com> Date: Tue, 23 May 2023 14:15:28 +0200 Subject: [PATCH] added git-find-commit-containing-exact-same-file.sh --- git-find-commit-containing-exact-same-file.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 git-find-commit-containing-exact-same-file.sh diff --git a/git-find-commit-containing-exact-same-file.sh b/git-find-commit-containing-exact-same-file.sh new file mode 100755 index 0000000..65b6d33 --- /dev/null +++ b/git-find-commit-containing-exact-same-file.sh @@ -0,0 +1,11 @@ +#from: https://www.reddit.com/r/git/comments/ja0ro8/given_a_specific_file_how_can_i_find_on_which/ + +#find_by_hash() { + hash=`git hash-object $1` + git rev-list --all -- $2 | while read rev + do + git ls-tree -r "$rev" | grep $hash >/dev/null && echo "$rev" + done +#} +#find_by_hash() +