git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git version of some common SVN hooks?
@ 2010-10-04 19:43 Dun Peal
  2010-10-04 20:58 ` Chris Packham
  0 siblings, 1 reply; 2+ messages in thread
From: Dun Peal @ 2010-10-04 19:43 UTC (permalink / raw
  To: git

Hi,

I'm porting a large and active repository from SVN to Git.

To provide the developers with the same features, I need the Git
version of the following common hooks:

1. svn2cl: the Subversion ChangeLog Generator. Basically a script that
sends a readable email listing a range of commits, showing just a
short summary for each commit: author name, timestamp, hash, paths
modified, commit message.
2. Hook to reject any commit containing a path with non-ASCII characters.
3. Hook to reject any commit causing the repository to contain two or
more paths that differ from each other only in letter case. For
instance, a commit adding foo/bar.py would be rejected if foo/Bar.py
was added as part of that same commit, or already existed in the repo.
4. Hook to trigger an action based on which path was committed to. For
example, if a developer commits into REPO_ROOT/foo, send an email to
address foo@somedomain, whereas a commit to REPO_ROOT/bar will send an
email to bar@somedomain.

I'm hoping there are Git versions of these hooks already written, but
if now any leads about implementing them would be appreciated.

Our full setup btw is a large repository hosted on a local instance of
Gitorious. All our users use Git >= 1.7, although they work on all 3
operating systems: Linux, OS X, Windows.

Thanks, D

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Git version of some common SVN hooks?
  2010-10-04 19:43 Git version of some common SVN hooks? Dun Peal
@ 2010-10-04 20:58 ` Chris Packham
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Packham @ 2010-10-04 20:58 UTC (permalink / raw
  To: Dun Peal; +Cc: git

On 04/10/10 12:43, Dun Peal wrote:
> Hi,
> 
> I'm porting a large and active repository from SVN to Git.
> 
> To provide the developers with the same features, I need the Git
> version of the following common hooks:
> 
> 1. svn2cl: the Subversion ChangeLog Generator. Basically a script that
> sends a readable email listing a range of commits, showing just a
> short summary for each commit: author name, timestamp, hash, paths
> modified, commit message.
> 2. Hook to reject any commit containing a path with non-ASCII characters.
> 3. Hook to reject any commit causing the repository to contain two or
> more paths that differ from each other only in letter case. For
> instance, a commit adding foo/bar.py would be rejected if foo/Bar.py
> was added as part of that same commit, or already existed in the repo.
> 4. Hook to trigger an action based on which path was committed to. For
> example, if a developer commits into REPO_ROOT/foo, send an email to
> address foo@somedomain, whereas a commit to REPO_ROOT/bar will send an
> email to bar@somedomain.
> 
> I'm hoping there are Git versions of these hooks already written, but
> if now any leads about implementing them would be appreciated.
> 
> Our full setup btw is a large repository hosted on a local instance of
> Gitorious. All our users use Git >= 1.7, although they work on all 3
> operating systems: Linux, OS X, Windows.
> 
> Thanks, D

I don't know if they suit all of your needs but there are a few default
hooks that ship with git. Have a look at .git/hooks/*.sample in any
init-ed git repository. You can also find them here
http://repo.or.cz/w/git.git/tree/HEAD:/templates

There are also some in http://repo.or.cz/w/git.git/tree/HEAD:/contrib/hooks

There are plenty of others but that's the extent of the googling I'm
going to do for you.

Pre-empting your next question. One point to note is that for security
reasons the hooks don't get included when you clone a repository. This
is OK for most people as you generally want these things on the server
containing the canonical repository anyway, what other people do with
their clones is up to them.

At $dayjob we have a few hooks enforcing coding/commit policy so we
wrote a simple script that can either wrap git clone or be run after git
clone to install the hooks for individual developers.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-04 20:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-04 19:43 Git version of some common SVN hooks? Dun Peal
2010-10-04 20:58 ` Chris Packham

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).