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

feature: pre-commit support #79

Open
1 task done
Kraust opened this issue Jun 27, 2024 · 7 comments
Open
1 task done

feature: pre-commit support #79

Kraust opened this issue Jun 27, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@Kraust
Copy link

Kraust commented Jun 27, 2024

Did you check the docs?

  • I have read all the docs

Is your feature request related to a problem? Please describe.

https://pre-commit.com/

AFAIK pre-commit is commonly used in workflows these days, and I include it in mine. Currently fugit2 doesn't ave great support for it. I don't know if libgit2 has proper support for the hooks that pre-commit creates.

Describe the solution you'd like

I'd like the pre-commit hooks to be run on commit (like git commit does) and some kind of indication to the user if the hook fails fails.

Describe alternatives you've considered

This is not a show stopper preventing me from using fugit2. I can just invoke pre-commit manually as part of my workflow (and my CI/CD also runs it).

Additional context

No response

@Kraust Kraust added the enhancement New feature or request label Jun 27, 2024
@SuperBo
Copy link
Owner

SuperBo commented Jun 28, 2024

Hi @Kraust, pre-commit is not implemented in libgit2 libgit2/libgit2#964. It is the responsibility of IDE/plugin to implement it. In this case, Fugit2 have to handle and call pre-commit command explicitly.

Let's me investigate how to implement it. It may take a while because I'm not so familiar with pre-commit yet.

As always, Thank you for great suggestion! :D

@SuperBo
Copy link
Owner

SuperBo commented Nov 20, 2024

Hi @Kraust, pre-commit hook is preliminarily support via this MR #109. Sorry for taking this issue so long.

Can you help me test it?

Extra features that can added later:

  • Allow no-verify option.
  • Support pre-push hook.

@SuperBo SuperBo self-assigned this Nov 20, 2024
@Kraust
Copy link
Author

Kraust commented Nov 20, 2024

Will do. May take a couple of days depending on what repos I'm working on.

@Kraust
Copy link
Author

Kraust commented Nov 21, 2024

Having an issue with it, but I don't think it's related to the changes you've made. Looks like pre-commit creates a shell script, but because I'm on currently on Windows that shell script doesn't make any sense.

@SuperBo
Copy link
Owner

SuperBo commented Nov 21, 2024

@Kraust, Can you show me the error message on Windows. Maybe it can be useful.

@Kraust
Copy link
Author

Kraust commented Nov 21, 2024

image

Note: E:\work\aria is the git repo and the related path is correct. I don't think this is an issue with fugit2 at the moment.

@SuperBo
Copy link
Owner

SuperBo commented Nov 21, 2024

@Kraust, seem like path construction error, I can see the malformed path E:/work/aria\.git\hooks\pre-commit in the error. That path contains mix separator of / and \. Why it use / on Windows >.<

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

No branches or pull requests

2 participants