-
Notifications
You must be signed in to change notification settings - Fork 31
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
revise -c doesn't run git hooks on new commit #35
Comments
Note that git-revise doesn't ever check out the commits it creates, which would be necessary for running normal git hooks. |
I was afraid of something like that :( |
What kind of git hook is this? |
If it's just a commit-msg hook we could potentially run them though I'd rather make that a config. |
It seems like it is in fact commit-msg, if you want a copy of it I can probably upload it, let me make sure it's got nothing sensitive. |
The commit-related hooks appear to be:
Other than |
Yea, I can't really say what my normal workflow for splitting up a commit was before revise, its always a hard / annoying task and I don't remember how I normally end up managing it, but it definitely wasn't just a rebase so I can't really compare the hooks that would get run normally vs what revise runs :( I think my old strategy was always to branch off of the commit before the one i want to split, cherry pick, reset soft, add, make 1st commit, add the rest, make second commit, then rebase the remaining commits from the old branch to the new one and then move the head of the old branch to the new one. Bleh |
It might be possible to run commit hooks only when performing a |
The "maybe"s are why i want this to be prefgated, it should only be used with hooks that don't read from git state. |
PR #82 adds opt-in[1] support for the Opt-in because as mentioned the index usually does not match. Should this be also / alternatively configurable via a Support for 1: |
The rules are really arbitrary for For what it's worth, from among these, I think if a user really wanted to be informed of in-memory rewrites, it would be best to make a new kind of hook that would be invoked for such cases, which would be given the commit hash to operate on, instead of being expected to operate on the working copy.
FWIW again, This is to distinguish the case of
I think in-memory rebases are sufficiently different that it would be reasonable for us to come up with a new parameter to pass there, if the user wanted to be better-informed. |
I hope users don't need to set this differently depending on compatibility with other tools. Configuration is a failure. As such, I would worry about removing the preference later.
Sounds like a better idea. If the right interface doesn't exist, someone has to make it. And since the user can always symlink the new hook to the old, it's a superset of a preference. I don't know if specific hooks like |
How about the hermetic option – run It is indeed the If I'm not mistaken, this is the script you get. I tried it, and it indeed works outside the context of a repository: The irony of making a new hook for this purpose is that it would do exactly as the documentation for commit-msg already says: The script takes one argument – the path to the commit message file – and that's it. The hermetic approach would then be to deny any implicit context that the documentation doesn't say that it has. I've used Gerrit before, and it was fantastic: If you've thought you wanted dependent pull requests in GitHub or GitLab, with dependent feature branches that need constant rebasing, Gerrit lets you just force-push one big feature branch all day, and it understands that your commits are born dependent pull requests, with their own intact histories, without letting rebases, cherry-picks and stale base branches distract your peers. So that's what a change-id can give you, I guess. |
Not sure if this is intentional or not or something that can be fixed with revise's design, but we use gerrit at work so each commit has to have a change-id inserted into the commit message before it can be pushed. I tried splitting up a commit with
git revise -c
(awesome btw) and it worked perfectly but did not run the commit hook so I was left without the change id in the new commit.This isn't a huge issue, I just immediately ran
git commit --amend
after the revise and it added the change id no problem, but I figured I'd mention it in case its a feature you can / would like to add.The text was updated successfully, but these errors were encountered: