AnkhSVN client side pre-commit hook

后端 未结 3 943
时光说笑
时光说笑 2020-12-19 20:28

Basically I want to do the same thing as the fella over there.

It seems that everybody was thinking about server-side hooks (with all their evil potential).

3条回答
  •  遥遥无期
    2020-12-19 20:57

    If you could move away from AnkhSVN and switch over to TortoiseSVN, you'll get support for client side hooks for free.

    You could use any executable thing as a hook and they get passed different parameters depending on the type of the hook scripts.

    The pre-commit hook for example gets the following parameters:

    PATH DEPTH MESSAGEFILE CWD
    

    Where the elements are the following:

    • PATH
      A path to a temporary file which contains all the paths for which the operation was started. Each path is on a separate line in the temp file.

    • DEPTH
      The depth with which the commit/update is done.

    • MESSAGEFILE
      Path to a file containing the log message for the commit. The file contains the text in UTF-8 encoding. After successful execution of the start-commit hook, the log message is read back, giving the hook a chance to modify it.

    • CWD
      The current working directory with which the script is run. This is set to the common root directory of all affected paths.

    While TortoiseSVN is not integrated into VS, I think it would be worth a look since you could use it as a general-purpose client for other projects too (i.e. all your other coding/scripting stuff that you don't do with VS).

提交回复
热议问题