tuse git show for initial commit - gitzone - git-based zone management tool for static and dynamic domains HTML git clone https://git.parazyd.org/gitzone DIR Log DIR Files DIR Refs --- DIR commit 677e392007fab53e595c43d29293613a0ce710e4 DIR parent a5377a84d1283f8937a5214f3c40d214de219b42 HTML Author: tg(x) <*@tg-x.net> Date: Mon, 14 Feb 2011 07:25:09 +0100 use git show for initial commit Diffstat: M bin/gitzone | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- DIR diff --git a/bin/gitzone b/bin/gitzone t@@ -232,7 +232,11 @@ sub pre_receive { # check what changed git "checkout -qf $new"; - $_ = git "diff --raw $old..$new"; + if ($old =~ /^0+$/) { + $_ = git "show --raw $new"; + } else { + $_ = git "diff --raw $old..$new"; + } # parse diff output, add only valid zone names to %files for parsing $files{$1} = 0 while m,^:(?:[\w.]+\s+){5}([a-z0-9./-]+)$,gm;