Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only test the prospective commit: ignore unstaged changes. #1

Merged
merged 1 commit into from Oct 4, 2019

Conversation

wimleers
Copy link
Contributor

@wimleers wimleers commented Mar 4, 2014

Prevents e.g. PHPUnit from tripping over xdebug_break() statements that you're not even trying to commit.

pre-commit Outdated
@@ -85,5 +88,10 @@ if [ "$CHECK_PHPUNIT" == "1" ] ; then
# PHPUnit will handle the output.
STATUS=1
fi
cd "$(git rev-parse --show-toplevel)"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'll need to do this before the stash too

@alexpott
Copy link
Owner

I've always been unsure about this PR. Because it is super annoying that unstaged code can affect the checks - so that's wrong. But also I use these githooks on my regular code dev environment and often have unstaged code lying around.

@wimleers
Copy link
Contributor Author

wimleers commented Oct 4, 2019

I completely lost track of this, because I stopped using d8githooks because the DX problem that this PR was trying to fix was getting in the way all the time for me. Picking this up again…

pre-commit Outdated
@@ -77,6 +80,7 @@ for FILE in $FILES; do
done

if [ "$CHECK_PHPUNIT" == "1" ] ; then
ORIGINAL_DIR=`pwd`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems out of scope?

@wimleers
Copy link
Contributor Author

wimleers commented Oct 4, 2019

Rewritten solution, based on https://stackoverflow.com/a/34116244 :)

@alexpott alexpott merged commit fa5be61 into alexpott:master Oct 4, 2019
alexpott added a commit that referenced this pull request Oct 12, 2019
…only if previously stashed. (#1)"

This reverts commit fa5be61.
@alexpott
Copy link
Owner

I reverted this change it was causing issues with my work flow.

I kept on getting

Please commit your changes or stash them before you merge.
Aborting
The stash entry is kept in case you need it again.

Which is more annoying for me than the problem this is solving. We need to file another way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants