Re: Server-side preventing some files from being overwritten

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 14, 2016 at 11:27 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Thorsten Glaser <t.glaser@xxxxxxxxx> writes:
>
>>       if test x"0" != x"$(comm -23z \
>>           <(git ls-tree -r -z "$old" "$subdir" | sort -z) \
>>           <(git ls-tree -r -z "$new" "$subdir" | sort -z) | wc -c)"; then
>>               echo >&2 'Untouchable files touched, commit rejected!'
>>               exit 1
>>       fi
>
> Can't this become simpler, e.g.
>
>         if ! git diff-tree --quiet "$old" "$new" -- "$subdir"
>         then
>                 echo >&2 "Ooh, $subdir is touched"
>                 exit 1
>         fi

Ehh, you need to tell diff-tree to recurse, i.e. "diff-tree -r".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]