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

git-gui doesn't cleanup commit message (strip comments and blank lines) like git-commit #65

Open
r0nw opened this issue Oct 15, 2021 · 2 comments

Comments

@r0nw
Copy link

r0nw commented Oct 15, 2021

Git GUI does not cleanup commit message after editing, which is especially a problem when using commit templates, or in some other cases e.g. after merging when comments appear in the commit message.

I see this issue was actually fixed in Feb 2021 (commit b9a4386) but then reverted straight away in March (commit c0698df).

Do you plan to do the fix again, please?

Btw, executing git -c core.editor=true commit --amend --edit could be used to "post process" just created commit and cleanup it's message. If you'd be willing to accept such solution, I can send it as a patch to the mailinglist. It's very simple, but maybe does not really fit well into git-gui source which only seems to use lower level git plumbing commands.

Thanks.

@prati0100
Copy link
Owner

Do you plan to do the fix again, please?

Yes. Eric sent a patch which would work with older versions of Tcl. I didn't get around to looking into it back then. But it looks good to me so I will apply it.

Btw, executing git -c core.editor=true commit --amend --edit could be used to "post process" just created commit and cleanup it's message. If you'd be willing to accept such solution, I can send it as a patch to the mailinglist. It's very simple, but maybe does not really fit well into git-gui source which only seems to use lower level git plumbing commands.

Yes, we don't want to use porcelain commands since their interface is not guaranteed to be stable.

@r0nw
Copy link
Author

r0nw commented Oct 23, 2021

Yes. Eric sent a patch... it looks good to me so I will apply it.

That's great news, thank you.

Yes, we don't want to use porcelain commands since their interface is not guaranteed to be stable.

That's what I expected. Unfortunately it means you are reimplementing a lot of functionality which is already implemented in those porcelain commands. Looks to me like using them the git-gui code could be really much simpler/shorter, not to mention avoiding undesired differences/inconsistencies with command line git.

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