Is it possible to get the commit message on a Pre-commit hook?

64 views
Skip to first unread message

Wesley Keeling

unread,
Dec 5, 2017, 8:07:44 PM12/5/17
to TortoiseSVN
I'd like to receive the commit message to update a text file with it, just wondering if the entry point passes it as a parameter or how I could get it. 

Wesley Keeling

unread,
Dec 5, 2017, 8:42:54 PM12/5/17
to torto...@googlegroups.com
I still need to know if this is a possibility 
.  

Stefan

unread,
Dec 9, 2017, 2:30:08 AM12/9/17
to TortoiseSVN
Client-side hook in TSVN or a server side hook?

For client-side hooks, TSVN calls the script with the following parameters:

PATH DEPTH MESSAGEFILE CWD

which means the third parameter is a path to a file where the commit message is stored.


https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-settings.html#tsvn-dug-settings-hooks



Stefan


Void

unread,
Dec 11, 2017, 1:22:17 PM12/11/17
to TortoiseSVN
Really quick question about that, how exactly do I get the message if I have not committed yet? I need to set a file for my own changes when it's committed. 
Thanks for the Reply! 

Stefan

unread,
Dec 11, 2017, 3:05:07 PM12/11/17
to TortoiseSVN


On Monday, December 11, 2017 at 7:22:17 PM UTC+1, Void wrote:
Really quick question about that, how exactly do I get the message if I have not committed yet? I need to set a file for my own changes when it's committed. 
Thanks for the Reply! 

You get the message when your script runs. If you configured is as a pre-commit hook then it's run before the commit.

Stefan
 

Void

unread,
Dec 11, 2017, 6:07:56 PM12/11/17
to TortoiseSVN
I'm sorry I'm still a little confused, "You get the Message when your script runs" I'm referring to the actual "Commit message" -The actual version change log that a user enters to describe the committed files (Log Message). 
I want to take what the user puts into the change log and copy it and put it to a external file so they can view it without looking at the Log files of the SVN repo. 

Are we talking about the same thing? 

Stefan

unread,
Dec 12, 2017, 3:37:08 PM12/12/17
to TortoiseSVN


On Tuesday, December 12, 2017 at 12:07:56 AM UTC+1, Void wrote:
I'm sorry I'm still a little confused, "You get the Message when your script runs" I'm referring to the actual "Commit message" -The actual version change log that a user enters to describe the committed files (Log Message). 
I want to take what the user puts into the change log and copy it and put it to a external file so they can view it without looking at the Log files of the SVN repo. 

Are we talking about the same thing? 


You said you set up a hook script. That script is called with the parameters mentioned in the docs.
The MESSAGEFILE parameter is a path to a file, and that file contains the commit message.

Stefan


Reply all
Reply to author
Forward
0 new messages