rehandalal / therapist

Work out your commitment issues.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a pre-push hook

rehandalal opened this issue · comments

commented

We should add an option to install a pre-push hook instead or alongside the pre-commit hook.

Hi Rehadalal,

How can we get this feature working? I tried the same script that is used for the pre-commit hook for pre-push hook but does not seems to be working.

commented

Hi! Thanks for your comment. Are you currently using therapist on your project(s)?

This was just an idea I had and I have not done much of a dive into it yet. I suspected the pre-commit hook would not work out the box because it looks for uncommitted code. At the time a push is occurring there is probably not any uncommitted code. With a pre-push hook we likely want to pass through all the tracked code but ignore any unstaged changes. So the line 18 of the hook would likely need to be modified with the appropriate options to account for all of that.

Hi,
Thanks for getting back. Yes, we have some team members in our project using it. I think you meant pre-push hook would not work out of the box.

commented

I think you meant pre-push hook would not work out of the box.

There currently is no pre-push hook. I meant that the existing pre-commit hook would not work out the box as a pre-push hook. It would need to be modified.

But now that I know this would be useful to a group of people using Therapist I'll bump it up in priority and hopefully get a new version out with built-in pre-push hook support shortly.