You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by th...@post.ch on 2016/04/19 09:44:53 UTC

Is it possible to change content of a commit by pre-commit hook?

Hi all

We export PowerCenter workflows as XML to commit those to subversion. We would like to make sure that the description attribute of the tags contain subversion information like Rev or Header. Is it possible to change the content i.e. the value of the xml description attribute by commit hook? I had a look at red bean book and search the net for hints. I only found 'svnlook cat' to echo the content of the file but I did not find a means to alter the content. Is it possible to achieve or do I need to make a check on the content and fail the commit if the required bits of information in the content is not present?

Kind regards

Thiemo

RE: Is it possible to change content of a commit by pre-commit hook?

Posted by th...@post.ch.
Thanks for your thoughts. I am already aware of the possibility of check and reject though checking the presence of the appropriate property evaded me so far.

I quite feel it might contradict the purpose of a versioning system if that system would allow changes within it and not just store in certain way what was handed over to it.

-----Original Message-----
From: Joseph Bruni [mailto:jbruni@icloud.com] 
Sent: Dienstag, 19. April 2016 22:27
To: Kellner Thiemo, IT124 extern
Cc: users@subversion.apache.org
Subject: Re: Is it possible to change content of a commit by pre-commit hook?


> On Apr 19, 2016, at 12:44 AM, thiemo.kellner@post.ch wrote:
> 
> Hi all
> 
> We export PowerCenter workflows as XML to commit those to subversion. We would like to make sure that the description attribute of the tags contain subversion information like Rev or Header. Is it possible to change the content i.e. the value of the xml description attribute by commit hook? I had a look at red bean book and search the net for hints. I only found 'svnlook cat' to echo the content of the file but I did not find a means to alter the content. Is it possible to achieve or do I need to make a check on the content and fail the commit if the required bits of information in the content is not present?
> 
> Kind regards
> 
> Thiemo


Have you tried using keywords?

http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.keywords.html

You might be able to use a pre-commit hook to verify that the keywords are present and that the svn:keywords property is set on the file -- not the modify the content but to reject the commit if they are missing.

Re: Is it possible to change content of a commit by pre-commit hook?

Posted by Joseph Bruni <jb...@icloud.com>.
> On Apr 19, 2016, at 12:44 AM, thiemo.kellner@post.ch wrote:
> 
> Hi all
> 
> We export PowerCenter workflows as XML to commit those to subversion. We would like to make sure that the description attribute of the tags contain subversion information like Rev or Header. Is it possible to change the content i.e. the value of the xml description attribute by commit hook? I had a look at red bean book and search the net for hints. I only found 'svnlook cat' to echo the content of the file but I did not find a means to alter the content. Is it possible to achieve or do I need to make a check on the content and fail the commit if the required bits of information in the content is not present?
> 
> Kind regards
> 
> Thiemo


Have you tried using keywords?

http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.keywords.html

You might be able to use a pre-commit hook to verify that the keywords are present and that the svn:keywords property is set on the file -- not the modify the content but to reject the commit if they are missing.

Re: Is it possible to change content of a commit by pre-commit hook?

Posted by Branko Čibej <br...@apache.org>.
On 19.04.2016 09:44, thiemo.kellner@post.ch wrote:
> Hi all
>
> We export PowerCenter workflows as XML to commit those to subversion. We would like to make sure that the description attribute of the tags contain subversion information like Rev or Header. Is it possible to change the content i.e. the value of the xml description attribute by commit hook?

It is theoretically possible but YOU MUST NOT DO THAT because you'll
break the working copy that the commit was made from.

-- Brane