question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pre-commit hooks interfere with in-progress commit dev workflows

See original GitHub issue

Observed behavior

When working locally, git is a powerful tool for storing in-progress work. It’s often desirable to commit changes that are not yet complete, even if there are bugs or formatting issues.

Pre-commit hooks impede a developer’s ability to use git as a way to save in-progress work.

It’s possible to do with git commit --no-verify, but this is a hard command to remember and again impedes the flow of the developer’s work, especially because it’s not available from most git GUIs.

Expected behavior

Pre-commit should not get in the way of developer’s workflow.

The developer, and not the linter, ought to be in control of what is allowed to be committed in local, unshared working branches.

User-facing consequences

Certain kinds of dev workflows are impeded

Context

0.13.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
indirectlylitcommented, Mar 2, 2020

If that works for you then that’s fine, but there are more effective strategies for saving in-progress work using git

0reactions
benjaomingcommented, Mar 2, 2020

pre-commit inherently works against this

You can install it as pre-push or whichever local hook of your preference.

https://pre-commit.com/#pre-commit-install

Best practice in git is to commit early and often

I don’t do that? I use stashing quite a lot, though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automating tasks and improving developer workflow with pre ...
What's pre-commit hook? Git has various checkpoints that we can hook into by providing an executable in .git/hooks/ with the name of the...
Read more >
pre-commit
We run our hooks on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements....
Read more >
How to Use Git Hooks in Your Development Workflow - Medium
We will execute a simple hook to validate that the code being pushed doesn't have any commit with 'WIP' in the commit message....
Read more >
Using git hooks to improve your day-to-day workflow
The pre-commit hook is run first, before you even type in a commit message. It's used to inspect the snapshot that's about to...
Read more >
Git Hooks | Atlassian Git Tutorial
Git Hooks are scripts that run automatically every time a particular event occurs in a Git repository. Learn what they do and how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found