threads / discuss / 27649

pre-dcommit hook for 'git svn dcommit' ?

Subject: pre-dcommit hook for 'git svn dcommit' ?

## tl;dr

2 messages between Jun 18, 2011 and Jun 20, 2011.

replies: 1people: 1as markdown or json

Frédéric Heitzmann· Jun 18, 2011, 15:55 UTC · lore
Hello.

There is no way to set a hook before 'git svn dcommit', similarly with pre-commit hook. I could use SVN hooks instead, but I have no rights to tune the SVN server (and it would also mean that my hooks would be applied to all SVN commits).

Any better idea than a pre-svn-dcommit hook ?
Thanks,
Fred
Frédéric Heitzmann· Jun 20, 2011, 20:54 UTC · re: Frédéric Heitzmann · lore

Re: pre-dcommit hook for 'git svn dcommit' ?

Frédéric Heitzmann <frederic.heitzmann <at> gmail.com> writes:
Show 6 quoted lines
> 
> There is no way to set a hook before 'git svn dcommit', similarly with
> pre-commit hook. I could use SVN hooks instead, but I have no rights to tune
> the SVN server (and it would also mean that my hooks would be applied to all
> SVN commits).
> 

For the sake of the discussion : I read some proposals for workaround my problem. It involves an intermediate bare repository. I push to this bare repo, and using pre-receive hook, I can perform any check I want. Then, with update hook may trigger a git svn dcommit. However, I now have another problem to solve : how to trigger a 'git svn rebase' on my intermediate repo, when I 'git pull' from my working repo ? Unless we considder adding a 'pre-fetch' hook, I will have to write a script to do it all at once.

It looks pretty ugly to me. The pre_svn_dcommit hook still looks like a more elegan solution.

Any comment is welcome.
-- Fred

← back to recent threads