script de shell post commit hook que apenas data /tmp/post-commit.log nada é gravado no arquivo de log

1

Eu instalei o servidor svn com o apache 2 no Ubuntu 10

Eu criei um post-commit.sh com um único 2 linhas de código

repository / hooks / post-commit.sh:

#!/bin/sh
date > /tmp/post-commit.log

nada é gravado nesse arquivo alguém pode ajudar por favor?

    
por Jason 23.04.2011 / 11:43

2 respostas

1

De aqui :

Name

post-commit — Notification of a successful commit.

Description

The post-commit hook is run after the transaction is committed, and a new revision created. Most people use this hook to send out descriptive emails about the commit or to notify some other tool (such as an issue tracker) that a commit has happened. Some configurations also use this hook to trigger backup processes.

The output from, and exit value returned by the post-commit hook program are ignored.

O que você deseja é um gancho de pré-compromisso (uma espécie de óbvio quando você pensa sobre esses nomes):

Name

pre-commit — Notification just prior to commit completion.

Description

The pre-commit hook is run just before a commit transaction is promoted to a new revision. Typically, this hook is used to protect against commits that are disallowed due to content or location (for example, your site might require that all commits to a certain branch include a ticket number from the bug tracker, or that the incoming log message is non-empty).

If the pre-commit hook program returns a non-zero exit value, the commit is aborted, the commit transaction is removed, and anything printed to stderr is marshalled back to the client.

Além disso, certifique-se de tornar o arquivo de script executável e use o nome exato pre-commit ou post-commit , ou seja, sem a extensão de nome de arquivo!

    
por 23.04.2011 / 12:40
1

Tente renomear o script para repository/hooks/post-commit . Não deve haver nenhuma extensão no nome do arquivo. Leia o arquivo repository/hooks/post-commit.tmpl para mais informações (especificamente o primeiro parágrafo que diz:

The post-commit hook is invoked after a commit. Subversion runs this hook by invoking a program (script, executable, binary, etc.) named 'post-commit'

    
por 24.04.2011 / 14:13