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

Does not work with amend #55

Open
sbeyer opened this issue Oct 25, 2021 · 4 comments
Open

Does not work with amend #55

sbeyer opened this issue Oct 25, 2021 · 4 comments

Comments

@sbeyer
Copy link

sbeyer commented Oct 25, 2021

Committia is not triggered for git commit --amend... I also did not find a config option for that. (Moreover, I think no config option would be necessary...)

@bew
Copy link

bew commented Oct 25, 2021

Hmm it does work for me
However it only shows the diff of new changes (the changes amended to the commit), not all the changes in the commit + the new changes. (sometimes I like it, sometimes I want to see all...)

@sbeyer
Copy link
Author

sbeyer commented Oct 25, 2021

I tested it again, and it also works for me. The case when I thought it didn't work was when I used git commit --amend to only fix a typo in the commit message, that is, there were no changes so the diff would be empty. I guess the bug I reported is a feature, but I was confused by it. Still, now that I know, it's fine. We can probably close this issue.

@mmrwoods
Copy link
Contributor

mmrwoods commented Dec 9, 2021

FWIW, I also find this very confusing. When I commit, I normally use the --verbose option so I see the changes I am committing while writing the commit message. The same applies when I amend a commit. Whether I am adding a new change to a commit or just fixing a typo, I still want to see all of the changes this commit will introduce as I amend the message.

Even when using git commit --amend --verbose with commitia, it strips out the original changes and shows only new additions, making it unusable for me, which is a shame, because it is otherwise a great plugin. I'll probably have a look at the plugin code to see how easy it would be to add an option to allow this feature to be switched off, but in maybe @rhysd can suggest a workaround too?

@mmrwoods
Copy link
Contributor

FYI, had a look at the plugin code to see how easy it would be to show the full diff when amending commits...

It should be simple to extract the diff from COMMIT_EDITMSG if available, falling back to running git diff if needed, but this would also require extracting the status from COMMIT_EDITMSG rather than running git status, otherwise the status and diff windows could be mismatched. This seems messy, and potentially brittle, so not sure it's worth the effort.

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

3 participants