Simon Berry wrote:
> I have run in to a bit of a catch-22 situation with tortoise's client
> side hooks. At first I was using the client pre-commit hook to check
> the validity of the files in the commit, as I thought that I could
> add the 'VERIFIED' tag to the log message without the user even
> seeing it. But it appears that even though the pre-commit hook passes
> a 'MESSAGEFILE' parameter, any modifications to the log file at this
> point do not get passed to the server (is it there only for read-only
> purposes ?).
As of r15257, TSVN now allows the pre-commit hook script to modify the
commit log message.
> So I then thought I would use the client start-commit hook. This does
> let me modify the log file - however it appears that the 'PATH'
> parameter at this point lists only the paths that the commit action
> was performed on, i.e. the parent folder and not the modified child
> files inside a folder. I need the list of modified files in my script
> to perform the validation against.
Yes, that's because the start commit script is executed before the
commit dialog had a chance to scan the working copy for modifications.
Also it wouldn't make much sense to pass all *possible* files which
*might* get committed to that script, because it is most likely that the
user deselects at least some of those files from the commit.
> I guess I could use the start-commit hook and work out the
> modifications for myself, but this seems messy and wasteful (as
> Tortoise is going to repeat this again as soon as my script exits).
And it wouldn't be reliable, see my comment above.
> Am I missing something obvious ? This doesn't seem right to me.
The hook scripts were implemented so that a script could *reject* (or
allow of course) a commit. So modifying the commit message was never
intended - the start commit hook can pre-fill the commit message with
some template. But we thought that modifying the message without the
user knowing about it was a bad idea - anyway, you can use the next
nightly build if you like which will allow the pre-commit hook to modify
that message.
Stefan
--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest Interface to (Sub)Version Control
/_/ \_\ http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=1091369
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-02-02 17:45:40 CET