All of lore.kernel.org
 help / color / mirror / Atom feed
* commit hooks on merge
@ 2009-06-25 19:43 Kurt Milligan
  2009-07-11  5:11 ` Tim Harper
  0 siblings, 1 reply; 3+ messages in thread
From: Kurt Milligan @ 2009-06-25 19:43 UTC (permalink / raw)
  To: git

Hi

I asked this in #git, and did a quick Google search to no avail...

According to the docs, merge does an auto-commit, but it seems that the 
pre/post commit hooks are not run for this commit. Is that intentional? 
Is there a way I can make them run for the merge commit? I see there is 
a post-merge hook, but that doesn't really help me if I want to stop the 
merge...

Thanks in advance

-Kurt

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

* Re: commit hooks on merge
  2009-06-25 19:43 commit hooks on merge Kurt Milligan
@ 2009-07-11  5:11 ` Tim Harper
  2009-07-11 11:56   ` Kurt Milligan
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Harper @ 2009-07-11  5:11 UTC (permalink / raw)
  To: Kurt Milligan; +Cc: git

Kurt

I don't think there is a hook to prevent a merge from occurring.  I
mean, you could probably rename git-merge, and then put a wrapper
script in its place.  That script could call the hook for the current
repository, if it exists and you could implement pre-merge.

This is if you REALLY REALLY want to do it :)

Tim

On Thu, Jun 25, 2009 at 1:43 PM, Kurt Milligan<kurt@surfmerchants.com> wrote:
> Hi
>
> I asked this in #git, and did a quick Google search to no avail...
>
> According to the docs, merge does an auto-commit, but it seems that the
> pre/post commit hooks are not run for this commit. Is that intentional? Is
> there a way I can make them run for the merge commit? I see there is a
> post-merge hook, but that doesn't really help me if I want to stop the
> merge...
>
> Thanks in advance
>
> -Kurt
> --
> 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
>

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

* Re: commit hooks on merge
  2009-07-11  5:11 ` Tim Harper
@ 2009-07-11 11:56   ` Kurt Milligan
  0 siblings, 0 replies; 3+ messages in thread
From: Kurt Milligan @ 2009-07-11 11:56 UTC (permalink / raw)
  To: Tim Harper; +Cc: git, kurt

Tim -

Thanks for the reply!

For completeness, my reason for wanting this hook is to be able to run 
some automated tests on the code.
I understand why you wouldn't want to execute a pre-commit hook on a 
merge that is just a fast-forward, but if it's not a fast-forward, then 
code is changing and automated tests could potentially fail...but the 
pre-commit hook is not run, and there is no pre-merge hook.

I searched the mailing lists, and it appears folks have submitted 
patches for both of these problems, but either they never made it into 
the tree or got rejected...but in any case, it implies that I'm not the 
only one with this concern.

Anyway, thanks for your suggestion...I will try that route!

Thanks

-Kurt


Tim Harper wrote:
> Kurt
>
> I don't think there is a hook to prevent a merge from occurring.  I
> mean, you could probably rename git-merge, and then put a wrapper
> script in its place.  That script could call the hook for the current
> repository, if it exists and you could implement pre-merge.
>
> This is if you REALLY REALLY want to do it :)
>
> Tim
>
> On Thu, Jun 25, 2009 at 1:43 PM, Kurt Milligan<kurt@surfmerchants.com> wrote:
>   
>> Hi
>>
>> I asked this in #git, and did a quick Google search to no avail...
>>
>> According to the docs, merge does an auto-commit, but it seems that the
>> pre/post commit hooks are not run for this commit. Is that intentional? Is
>> there a way I can make them run for the merge commit? I see there is a
>> post-merge hook, but that doesn't really help me if I want to stop the
>> merge...
>>
>> Thanks in advance
>>
>> -Kurt
>> --
>> 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
>>
>>     

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

end of thread, other threads:[~2009-07-11 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-25 19:43 commit hooks on merge Kurt Milligan
2009-07-11  5:11 ` Tim Harper
2009-07-11 11:56   ` Kurt Milligan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.