feat(run): warn instead of error when --files is used outside a git repo#3650
Closed
vmandela wants to merge 1 commit intopre-commit:mainfrom
Closed
feat(run): warn instead of error when --files is used outside a git repo#3650vmandela wants to merge 1 commit intopre-commit:mainfrom
vmandela wants to merge 1 commit intopre-commit:mainfrom
Conversation
When `pre-commit run --files <files>` is called outside a git repository, the tool previously raised a FatalError and exited with code 1. - Print a warning that pre-commit is running outside a git repository and only the explicitly passed files will be checked - Continue execution rather than aborting - All other commands (and `run` without `--files`) retain the existing fatal error behavior This modification helps use pre-commit in jujutsu worktrees as long as the modified file list is supplied on command line. Signed-off-by: Venkateswara Rao Mandela <[email protected]>
Member
|
even with |
Author
|
I have run this for jj workspace root and it functions without issues. Can you explain what you mean by "even with --files pre-commit must cd to the repo root" ? |
Member
|
the line you're skipping at the end of the function. also if you search the tracker there's already an extensive conversation specifically about this |
Author
|
I found the old discussions on this topic. Lets leave the PR closed. This functionality is quite useful to me as I use jj worktrees with a main repo versioned in git. I will keep this in my branch. Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When
pre-commit run --files <files>is called outside a git repository, the tool previously raised a FatalError and exited with code 1.runwithout--files) retain the existing fatal error behaviorThis modification helps use pre-commit in jujutsu worktrees as long as the modified file list is supplied on command line.