svn-scm icon indicating copy to clipboard operation
svn-scm copied to clipboard

Support client-side commit hook scripts

Open Pauwris opened this issue 3 years ago • 7 comments

Offer the same functionality as delivered by Tortoise SVN https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-settings.html#tsvn-dug-settings-hooks

In our company, we like using your add-on directly from Visual Code, but then our commit Hook configured in Tortoise SVN is not triggered. We use it for changing our SVN Commit author (a technical name) into a human reable name.

Regards Kristof

Pauwris avatar Apr 13 '21 14:04 Pauwris

Potentially something like this could also be used to avoid comitting buggy changes, e.g. automatically run a test suite before committing. E.g. using a Check-commit hook. This could provide some value :)

Bios-Marcel avatar Jun 03 '21 06:06 Bios-Marcel

This would be a killer feature.

There's another extension (forked from this one) by @rroman6174 that implements this feature - https://github.com/rroman6174/svn-scm

RLThomaz avatar Jun 18 '21 05:06 RLThomaz

Thanks for the mention @RLThomaz. My fork is mostly a proof of concept, although it does work for my purposes. The only problem with my approach is that it requires the logic to be written by another extension rather than utilizing a user-supplied command or calling Tortoise SVN's logic.

My use case was that I wanted to be able to interface with some features that were already implemented in a VS Code extension (formatter, linter, etc) and make use of the VS Code API in my hooks.

If that approach is sufficient I could look at making the interface more robust and submitting a pull request, but I don't know if that's what the submitter is asking for here. I think there's value in calling Tortoise SVN to handle the commits using existing commit hooks.

rroman6174 avatar Jun 18 '21 13:06 rroman6174

No problem @rroman6174. Yes, I've noticed the limitation to other extensions. Since I needed to execute some shell scripts I just submitted a pull request. It's my first time working with typescript and VSCode extensions, so it may need some work. Nonetheless, it's working locally and I can execute any hook needed.

RLThomaz avatar Jun 18 '21 15:06 RLThomaz

I like @RLThomaz draft implementation. I can see the benefit of leveraging VSCode feature like formatting and linting but for simplicity i prefer just running a arbitrary user supplied script. However maybe importing a user supplied dynamic module could solve this issue.

JohnstonCode avatar Jun 19 '21 09:06 JohnstonCode

Hi, everyone.

Can you guys check if the current draft (PR) is achieving the goals here? It's currently only providing the ability to override arguments for the pre-commit hook, but we should be able to run any hooks as is.

I can continue working on it before merging, or we could merge it and improve as necessary.

RLThomaz avatar Aug 10 '21 04:08 RLThomaz

Expect this feature to be released!

evamango avatar May 11 '22 00:05 evamango