SVN 커밋 메시지에 특정 명령어를 넣어주면 해당되는 TRAC의 티켓에 댓글로 등록되도록 할 수 있다. 역시 SVN hook 스크립트를 사용한다.
커밋 메시지에 사용할 수 있는 명령어는 티켓을 닫을 수 있는 close, 커밋 메시지를 티켓에 등록하는 refs 등이 있다. 자세한건 스크립트에 있는 주석을 참고하고, 보통 커밋 메시지를 티켓에 등록하는 re, refs, references, see (모두 동일한 기능)를 많이 사용한다. 아래는 사용예이다.
# svn commit -m "커밋 메시지입니다. (see #140)"
우선 SVN 서버에서 이 기능을 적용하려는 레포지토리의 hooks 디렉토리에 post-commit 파일을 아래와 같이 만들어준다.
#!/bin/sh
# POST-COMMIT HOOK
#
# The post-commit hook is invoked after a commit. Subversion runs
# this hook by invoking a program (script, executable, binary,
# etc.) named 'post-commit' (for which
# this file is a template) with the following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] REV (the number of the revision just committed)
댓글