GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix hooks firing during staged_files_only by domodwyer · Pull Request #1422 · pre-commit/pre-commit

Conversation

@domodwyer

@domodwyer domodwyer commented Apr 29, 2020 •
edited by asottile
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

pass through an environment variable to prevent hooks running

Fixes #1418.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@domodwyer

domodwyer commented Apr 29, 2020

Copy link
Copy Markdown
Contributor Author

Running git checkout-index --all --force is not equivalent, so changed to using the env var to skip hooks triggered by the git checkout call.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

asottile
asottile reviewed Apr 30, 2020
View reviewed changes
Comment thread pre_commit/commands/run.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pre_commit/staged_files_only.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@domodwyer

domodwyer commented Apr 30, 2020

Copy link
Copy Markdown
Contributor Author

I've pushed the changes - I started adding a test case for this, but it's a bit beyond my python skill level I'm afraid.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

asottile
asottile reviewed Apr 30, 2020
View reviewed changes
Comment thread pre_commit/commands/run.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pre_commit/staged_files_only.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@asottile

asottile commented Apr 30, 2020

Copy link
Copy Markdown
Member

needs a test as well

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@domodwyer

domodwyer commented Apr 30, 2020

Copy link
Copy Markdown
Contributor Author

needs a test as well

As I said, I'm trying to help without really knowing python - the tests are particularly hard to pick apart.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asottile

asottile commented Apr 30, 2020

Copy link
Copy Markdown
Member

oh ok, I can help wiht the test

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asottile asottile changed the title staged-files: use git checkout-index fix pre-commit firing during staged_files_only May 2, 2020
@asottile asottile changed the title fix pre-commit firing during staged_files_only fix hooks firing during staged_files_only May 2, 2020
asottile
asottile approved these changes May 2, 2020
View reviewed changes

@asottile asottile left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

added a test! thanks again!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@domodwyer @asottile
fix hooks firing during staged_files_only
928938a
@asottile
asottile merged commit df01824 into pre-commit:master May 2, 2020
@domodwyer

domodwyer commented May 3, 2020

Copy link
Copy Markdown
Contributor Author

Great cat, thanks for your help!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asottile

asottile commented May 11, 2020

Copy link
Copy Markdown
Member

thanks again for the fix and report, this has been released as part of v2.4.0 🎉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@asottile asottile asottile approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

post-checkout hook prevents pre-commit hooks from working with unstaged files

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@domodwyer @asottile
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.