[PATCH] post-receive.hook: rename detection

Jan Remmet j.remmet at phytec.de
Tue Apr 19 18:21:23 AEST 2016


patches which descripes renamed files show different hashes with git
show and pwclient. Use git show -C (Detect copies as well as renames.)

Signed-off-by: Jan Remmet <j.remmet at phytec.de>
---
$ git --version
git version 1.9.1
$ pwclient view 1453 | python /home/share/tools/patchwork/apps/patchwork/parser.py --hash
c144f83c228155ad0111bf36a45991eeb5ab8c68
$ git show 7482dae | python /home/share/tools/patchwork/apps/patchwork/parser.py --hash
e74e44602c685136ab6ad4bad2356d7bdf0a53a9
$ git show -C 7482dae | python /home/share/tools/patchwork/apps/patchwork/parser.py --hash
c144f83c228155ad0111bf36a45991eeb5ab8c68

 tools/post-receive.hook | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/post-receive.hook b/tools/post-receive.hook
index 8f05b8d..78ddf9b 100755
--- a/tools/post-receive.hook
+++ b/tools/post-receive.hook
@@ -23,7 +23,7 @@ trap "do_exit=1" INT
 get_patchwork_hash()
 {
   local hash
-  hash=$(git show $1 | python $PWDIR/parser.py --hash)
+  hash=$(git show -C $1 | python $PWDIR/parser.py --hash)
   echo $hash
   test -n "$hash"
 }
-- 
1.9.1



More information about the Patchwork mailing list