gitSharp can it be used with pre-commit hook

34 views
Skip to first unread message

zak

unread,
Jun 5, 2011, 6:21:11 PM6/5/11
to GitSharp
I am moving from Subversion to .GIT and I want to see if I can use
gitSharp the same way I can use svnSharp with git hooks

I have created a pre-commit hook , it executes a .Net Application
that works OK using git# API, but using gitSharp.Reposiory.Head I
can only see the commited HEAD not the new proposed commit. So I
can't validate the current commit.

Whether this is sensible thing to do or not I am not sure as it may
not fit with DVCS as I want to use the .NET code to parse git commit
messages, check code headers ..

Even if I can get it to work , thinking about it now I can't see how
it will help unless the cloning copies the hook and binaries.



Meinrad Recheis

unread,
Jun 7, 2011, 7:46:40 AM6/7/11
to gits...@googlegroups.com
On Mon, Jun 6, 2011 at 12:21 AM, zak <zakh...@hotmail.com> wrote:
I am  moving from Subversion to .GIT and I want to  see if I can use
gitSharp the same way I can use svnSharp with git hooks

 I have created a pre-commit hook , it executes a .Net Application
that works OK using git# API,  but using gitSharp.Reposiory.Head  I
can only see the commited HEAD  not the new proposed commit. So I
can't validate the current commit.

if there is a commit blob in the repo and you happen to know its hash gitsharp can open and access it. Otherwise you need to dig into git to find out how to access all the information you need from within the hook.

Whether this  is sensible thing to do or not I am  not sure as it may
not fit with DVCS as I want to use the .NET code to parse git commit
messages, check code headers ..

Even if I can get it to work , thinking about it now I can't see how
it will help unless the cloning  copies  the hook and binaries.

I don't yet know how pre-commit hooks work
in original git and if they can be checked into the source tree so I can not be of much help here. sorry. 
-- henon


--
For infos about GitSharp visit http://www.eqqon.com/index.php/GitSharp
To join this group visit http://groups.google.com/group/gitsharp

Reply all
Reply to author
Forward
0 new messages