Pre-commit Hook

162 views
Skip to first unread message

Jerry Gardner

unread,
Feb 5, 2016, 1:02:59 AM2/5/16
to SmartSVN
I've been trying to get pre-commit hooks to work on Windows without success.

I've put a file called pre-commit.bat in %APPDATA%\SmartSVN, which maps to
c:\Users\gardnerj\AppData\Roaming\SmartSVN on my machine.

When I commit a file from SmartSVN, this batch script doesn't appear to run.

Is there anything else I need to do to enable pre-commit hooks to work?

I have SmartSVN Professional v9.

SmartSVN Support

unread,
Feb 5, 2016, 2:57:40 AM2/5/16
to smar...@googlegroups.com
Hi Jerry,

According to <http://www.smartsvn.com/doc/display/SU/Commit#Commit-Client-sidepre-commithooks> you need to put the pre-commit.bat file into the settings directory - for your setup c:\Users\gardnerj\AppData\Roaming\SmartSVN\9\pre-commit.bat

--
Best regards,
Thomas Singer
syntevo GmbH
http://www.syntevo.com
> --
> You received this message because you are subscribed to the Google Groups
> "SmartSVN" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> smartsvn+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/smartsvn/a907dfe8-8ded-4881-a039-7b49b23993d4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Jerry Gardner

unread,
Feb 5, 2016, 11:07:26 AM2/5/16
to SmartSVN, smar...@smartsvn.com
On Thursday, February 4, 2016 at 11:57:40 PM UTC-8, SmartSVN Support wrote:
> Hi Jerry,
>
> According to <http://www.smartsvn.com/doc/display/SU/Commit#Commit-Client-sidepre-commithooks> you need to put the pre-commit.bat file into the settings directory - for your setup c:\Users\gardnerj\AppData\Roaming\SmartSVN\9\pre-commit.bat

That works. Thanks.

Jerry Gardner

unread,
Feb 5, 2016, 4:18:54 PM2/5/16
to SmartSVN, smar...@smartsvn.com
One more question regarding pre-commit hooks.

I notice that if I put "notepad %1" in the pre-commit.bat file, when I commit a file it opens notepad with the filename as text in notepad. I was expecting it to open the file that I was committing. Is there any way to do this?

I want to run Astyle on the files I'm committing to clean up the formatting before they go into the repository.

And yet one more question: Is it possible for the pre-commit.bat script to know which working directory the commit is happening in? Perhaps as an environment variable? I'd like to be able to do different actions in the pre-commit hook depending on which project I'm working on.

SmartSVN Support

unread,
Feb 8, 2016, 7:06:09 AM2/8/16
to smar...@googlegroups.com
Hi Jerry,

Please give the latest SmartSVN 9.1 preview intermediate build 5029 a try (Help | Check for Latest Build). This will

a) prefer pre-commit.cmd files over pre-commit.bat and
b) pass 2 arguments, the working directory and the temporary file containing all paths.

--
Best regards,
Thomas Singer
syntevo GmbH
http://www.syntevo.com


> --
> You received this message because you are subscribed to the Google Groups
> "SmartSVN" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> smartsvn+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/smartsvn/e02813fc-5b29-41f3-8914-3f8bb8ff9c66%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages