-
Notifications
You must be signed in to change notification settings - Fork 269
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
Improve squash merge commit message #331
Comments
Hi @philipstarkey, Thanks for raising this improvement request! I wasn't aware of the SQUASH_MSG file, thanks for letting me know. From what I can see, when
This means that the commit subject (what is shown in the Description column of Git Graph), is just "Squashed commit of the following:". There doesn't appear to be a way with If you're fine with this, please let me know as I'd be happy to add an extension setting to let users choose their preferred format (the existing behaviour, or SQUASH_MSG). |
Hi @mhutchie, Yes, an option as you suggest in the extension settings to use the default squash commit message would be excellent! As an possible extension to this, I was wondering if the selection of "squash commits" and "no commit" when merging with git graph could result in the VS Code git commit message box being prepopulated with the commit message? That way people could modify the message prior to committing (if they didn't like the first line or if they wanted to add additional information). I believe prepopulating the VS Code commit message box is possible because the VS Code GitHub Pull Request extension does it when you "start working on an issue". Happy to open this as a separate feature request if you would prefer them to be separate (the idea just occurred to me after you said the commit subject wasn't very informative in the squash message!) |
Thanks for confirming that this will work for you, I'll add the extension setting in the next few days. As for "squash commits" and "no commit": The Visual Studio Code Git Extension's Message Input is automatically populated with the contents of Out of curiosity I had a look at how vscode-pull-request-github populates the commit message (see here): As the extension is made by Microsoft they integrate with the Visual Studio Code Git Extension's repository representation, which allows access to set the input field. I've deliberately avoided using the Visual Studio Code Git Extension's repository representation, as they have many restrictions that would have prevented heaps of functionality that is available in Git Graph - things most Git Graph users take for granted. It would be a mess to be dealing with both Git Graph's repository representation and the Visual Studio Code Git Extension's. |
That makes sense! I've logged it as microsoft/vscode#101078 |
…uash commit that is created when the "Squash Commits" option is selected on the Merge & Pull Branch Dialogs respectively.
This will be available in v1.25.0. If you'd like to use it before the next release, you can download v1.25.0-beta.2, and install it following the instructions provided here. |
Hi guys. I think I am having a problem related to this. I am using Git graph extension (which is great!) to start an interactive rebase (not merge), where I squash some commits. I looked into .git folder and there is a SQUASHMSG with all the comments, along with COMMIT_EDITMSG that I edit in vscode. However even deleting that file does not change anything. So far I haven't found a way to change the resulting commit message (except amending the commit later). |
Ah wait, I think it worked the second time I tried it. It was probably a case of git graph not refreshing itself automatically, so I was looking at a commit made during the process of rebasing. |
Describe the improvement that you'd like
Right now, when you do a squash merge using git-graph it uses a commit message along the lines of:
Merge commit 'd8b8343f10ee8235a113a9f18a5b07fe2fa474c3'
A much more detailed message is written to .git/SQUASH_MSG and is automatically used if you were to manually do the commit using:
git commit
orgit commit --no-edit
It would be very useful if there was an option for git-graph to use that detailed squash merge message automatically (basically run
git commit --no-edit
instead ofgit commit -m "<one-line git graph message>"
). Right now I'm ticking the "squash commits" and "no commit" checkboxes when doing the merge from git-graph and then manually runninggit commit --no-edit
from a terminal.The text was updated successfully, but these errors were encountered: