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

Is there a way to override standard git commit? #550

Closed
anurbol opened this issue Aug 16, 2018 · 5 comments
Closed

Is there a way to override standard git commit? #550

anurbol opened this issue Aug 16, 2018 · 5 comments

Comments

@anurbol
Copy link

anurbol commented Aug 16, 2018

Desired behavior:

  1. install commitizen
  2. run git commit
  3. see the same nice menu as when running git cz

Current behavior:

  1. install commitizen
  2. run git commit
  3. NO nice menu as when running git cz, just default git interface

I only interested in an answer, rather than actually requesting the feature.

@LinusU
Copy link
Contributor

LinusU commented Aug 16, 2018

Depends, are you okay with setting it up yourself? Or are you wondering wether it could work out of the box in any project?

I don't know if it's possible to check in some git settings file in a repo to override the commit command. But you can do it globally on your machine if you want to. I think just setting GIT_EDITOR=git-cz should do it 🤔

@anurbol
Copy link
Author

anurbol commented Aug 16, 2018

Hi, @LinusU! "Or are you wondering wether it could work out of the box in any project?" - Yes I would like to know if it is possible.

Isn't GIT_EDITOR just for setting text editor to make commit message? Anyway, setting an env variable does not satisfy the above criteria.

@LinusU
Copy link
Contributor

LinusU commented Aug 16, 2018

I would think that this is impossible by design, because if it was possible you could trick git into running arbitrary command just by cloning a repository.

@anurbol
Copy link
Author

anurbol commented Aug 16, 2018

Yes, but Commitizen could inject pre-commit hook or something. I guess you are right, there is no such feature, hence I can start implementing it by myself. But I'd like to keep this issue open for another couple of days, in case if there is someone who knows this undocumented or hidden feature... Thanks, @LinusU!

@anurbol
Copy link
Author

anurbol commented Aug 17, 2018

I guess this issue is a duplicate of #161, closing

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

No branches or pull requests

2 participants