Re: merge hook

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Johannes Schindelin
Date: Friday, October 10, 2008 - 3:07 am

Hi,

On Fri, 10 Oct 2008, Erik Colson wrote:


From Documentation/githooks.txt:

-- snip --
prepare-commit-msg
------------------

This hook is invoked by 'git-commit' right after preparing the
default log message, and before the editor is started.

It takes one to three parameters.  The first is the name of the file that 
the commit log message.  The second is the source of the commit message, 
and can be: [...] `merge` (if the commit is a merge or a `.git/MERGE_MSG` 
file exists); [...]

If the exit status is non-zero, 'git-commit' will abort.
-- snap --

To see which files are affected, you'd just need to ask "git diff 
--name-only --cached".

I guess that you want to disallow merging in changes from people who 
changed files that are none of their business?  If so, it would be nice to 
contribute the hook as a patch to contrib/.

Ciao,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
merge hook, Erik Colson, (Fri Oct 10, 12:21 am)
Re: merge hook, Johannes Schindelin, (Fri Oct 10, 3:07 am)
Re: merge hook, Erik Colson, (Fri Oct 10, 3:26 am)
Re: merge hook, Johannes Schindelin, (Fri Oct 10, 5:30 am)