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

fix(git-hooks): non interactive hooks #91

Merged
merged 2 commits into from
May 29, 2024
Merged

fix(git-hooks): non interactive hooks #91

merged 2 commits into from
May 29, 2024

Conversation

AdeAttwood
Copy link
Collaborator

@AdeAttwood AdeAttwood commented May 13, 2024

fix(git-hooks): non interactive hooks

Summary:

When you are running hooks in a non interactive terminal, the hooks will fail
as they are expecting user input. This change will allow the hooks to run in a
non interactive terminal.

It splits out the writer to not show progress when when running in a non
interactive. You will now only get the output at the end of the process to see
what has passed and filed.

Test Plan:

No tests for now, this is quite hard to test because we are not actually
testing in a live terminal, everything is mocked.


Stack created with Sapling. Best reviewed with ReviewStack.

Summary:

Right now in our git hooks we are using `git rev-parse --show-toplevel` to get
the root of the repository. This is not working within a sapling repo.

This implements the root command so we can use that instead. It as a new `root`
method to the `SourceControlProvider` interface. This will then be implemented
by any provider we want to.

Test Plan:

No real way to test this other than running the command and checking the
output. As long as the hooks commands will be working for us this will be fine
for now.
Summary:

When you are running hooks in a non interactive terminal, the hooks will fail
as they are expecting user input. This change will allow the hooks to run in a
non interactive terminal.

It splits out the writer to not show progress when when running in a non
interactive. You will now only get the output at the end of the process to see
what has passed and filed.

Test Plan:

No tests for now, this is quite hard to test because we are not actually
testing in a live terminal, everything is mocked.
Base automatically changed from pr94 to 2.x May 29, 2024 20:03
@AdeAttwood AdeAttwood merged commit 0a03a7c into 2.x May 29, 2024
@AdeAttwood AdeAttwood deleted the pr91 branch May 29, 2024 20:04
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.

2 participants