git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* merge hook
@ 2008-10-10  7:21 Erik Colson
  2008-10-10 10:07 ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Erik Colson @ 2008-10-10  7:21 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]

Hello,

Is it possible to launch a custom script on all files involved in a
merge to master ? 
If yes, is it then also possible to reject the merge if the script
returns an error ?

Thanks
--
Erik

[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]

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

* Re: merge hook
  2008-10-10  7:21 merge hook Erik Colson
@ 2008-10-10 10:07 ` Johannes Schindelin
  2008-10-10 10:26   ` Erik Colson
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2008-10-10 10:07 UTC (permalink / raw)
  To: Erik Colson; +Cc: git

Hi,

On Fri, 10 Oct 2008, Erik Colson wrote:

> Is it possible to launch a custom script on all files involved in a 
> merge to master ? If yes, is it then also possible to reject the merge 
> if the script returns an error ?

>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

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

* Re: merge hook
  2008-10-10 10:07 ` Johannes Schindelin
@ 2008-10-10 10:26   ` Erik Colson
  2008-10-10 12:30     ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Erik Colson @ 2008-10-10 10:26 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 558 bytes --]

On Fri, Oct 10, 2008 at 12:07:16PM +0200, Johannes Schindelin wrote:

[..]

> From Documentation/githooks.txt:

thank you for pointing me there

[..]

> 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/.

wrong guess ;)
The purpose is to check if source code still has debug code in
it. Our policy is to have it removed before reaching master, but
checking by hand is way too buggy ;)

--
erik

[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]

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

* Re: merge hook
  2008-10-10 10:26   ` Erik Colson
@ 2008-10-10 12:30     ` Johannes Schindelin
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2008-10-10 12:30 UTC (permalink / raw)
  To: Erik Colson; +Cc: git

Hi,

On Fri, 10 Oct 2008, Erik Colson wrote:

> On Fri, Oct 10, 2008 at 12:07:16PM +0200, Johannes Schindelin wrote:
> 
> > 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/.
> 
> wrong guess ;) The purpose is to check if source code still has debug 
> code in it. Our policy is to have it removed before reaching master, but 
> checking by hand is way too buggy ;)

Heh.  Still, if it is not too specific, would be nice to have it in 
contrib/.  So I can point other people to it ;-)

Ciao,
Dscho

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

end of thread, other threads:[~2008-10-10 12:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-10  7:21 merge hook Erik Colson
2008-10-10 10:07 ` Johannes Schindelin
2008-10-10 10:26   ` Erik Colson
2008-10-10 12:30     ` Johannes Schindelin

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 NNTP newsgroup(s).