From cca348425666081ac43bbe8e636370c7071b91a0 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 25 Apr 2023 11:23:09 +0200 Subject: [PATCH] debugging ... --- .githooks/post-merge | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.githooks/post-merge b/.githooks/post-merge index 8706448..567511a 100755 --- a/.githooks/post-merge +++ b/.githooks/post-merge @@ -25,11 +25,11 @@ get_blob () { # get the blob of the file(name) passed as $1 get_commit_for_blob () { # search for the blob in all commits for the file(name) $1 echo $1 >> /tmp/blob - echo $(git log --all --pretty=format:%H -- $1) >> /tmp/blob - echo $(git log --all --pretty=format:%H -- $1 | xargs -I{}) >> /tmp/blob - echo $(git log --all --pretty=format:%H -- $1 | xargs -I{} bash -c "git ls-tree {} -- $1") >> /tmp/blob + echo $(git log --all --pretty=format:%H -- $2) >> /tmp/blob + echo $(git log --all --pretty=format:%H -- $2 | xargs -I{}) >> /tmp/blob + echo $(git log --all --pretty=format:%H -- $2 | xargs -I{} bash -c "git ls-tree {} -- $2") >> /tmp/blob - echo $(git log --all --pretty=format:%H -- $1 | xargs -I{} bash -c "git ls-tree {} -- $1 | grep -q $1 && echo {}") + echo $(git log --all --pretty=format:%H -- $2 | xargs -I{} bash -c "git ls-tree {} -- $2 | grep -q $1 && echo {}") } for fn in $(git diff-tree -r HEAD@{1} HEAD --name-only); do @@ -39,7 +39,7 @@ for fn in $(git diff-tree -r HEAD@{1} HEAD --name-only); do fn=$(echo $fn | awk '{ printf "/"$0 }') if [[ -f "$fn" ]]; then blob=$(get_blob "$fn") - commit=$(get_commit_for_blob $blob) + commit=$(get_commit_for_blob $blob "$fn") fsize=$(ls -l "$fn" | awk '{ print $5 }') echo "$fn $fsize b=$blob c=$commit" >> $GIT_PULL_TMP fi