Re: Syntax check via update hook?

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Wed, May 20, 2009 at 11:13:09AM -0400, Mark Plaksin wrote:
>
>> Well, it's oh so close!  If we make changes that don't pass the syntax
>> check and try to push them the hook rejects the changes.  If we then
>> make a change that will pass the syntax check, leave the others broken,
>> and push, 'git diff-tree' doesn't list the previously rejected files so
>> the hook accepts the push.  Is there any way to get 'git diff-tree' to
>> list all of the files?
>
> Ah, yeah, that was my mistake. If you are looking at the whole tree,
> then you only need to look at what is being pushed, as it contains the
> changes for all of the commits being pushed. But if you are going to ask
> for a diff, you want to see not just the final commit, but the diff
> between what is in the ref now and what you are proposing to push.
>
> The old commit is passed as the second argument to the hook. So you
> should be able to just do:
>
>   git diff-tree "$2" "$3"

That did the trick once we put the '-r' back :)  Thanks very much!

--
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]