Code change:
<!-- Do Not Delete This! featurerequesttemplate --<!-- Please read our Rules of Conduct: --<!-- Please search existing issues to avoid creating duplicates. --<!-- Describe the feature you'd like. --Currently the VS Code Git commit message box automatically synchronises with the contents of .git/MERGEMSG (provided you have not entered your own commit message yet into VS Code). I would like to request support for VS Code to do the same with .git/SQUASHMSG (produced when running ). This would provide better integration between VS code git related VS Code extensions which often have the ability to perform a squash merge via the extension GUI but do not typically replicate any of the existing VS Code git interface (commit message box and changed file list).
I wouldn't mind taking this on, and I've looked through the code so I have a pretty good idea of what's required to implement this. Just one question, though — is there any situation where and are both present? If so: which one do we think should take precedence as the 'default' commit message?
my suggestion would be to follow what git-gui does since it's bundled with git. Looks like it preferences MERGEMSG over SQUASHMSG (see )
That makes sense, and that's what I was thinking too. I'll put a PR in shortly!
I got this to partially work by: a file with some content like "HELLO" a local branch file sometimes gets filled with content, like the following it seems like the content of the file is not constant for me, and changes once I do a squash Reopening this for discussion. I also might be doing something wrong. Bonus bug: when chaning the content of the SQUASHMSG the scm input does not reg resized and ends up looking broken (picture attached). So I would recommend that we revert this PR and polish it a bit more. !
It worked fine (and always displayed the intended (?) squash msg), but maybe it's because I was only squashing another branch that only had one commit? I concur that it seems like the contents of SQUASHMSG aren't always consistent though, now that I've tried with a branch with more than one commit. EDIT: It seems like it displays all of the squashed commits in one message, prefaced by As for the bonus bug, is that issue exclusive to SQUASHMSG or does it also happen if you change the contents of MERGE_MSG?
You're not supposed to manually create or edit the file. This is a file created by git during the command. When you run this command you will have a commit pending... and the input box should be prepopulated with a template commit message. Can you try this again? Thanks for the input box issue though, will try to repro.
This was the intended behaviour behind this feature request. I'm not expecting VS Code to do anything magical here with SQUASHMSG. It should just be taking the entire contents of the file as other graphical git tools do (and as a command line call to does if SQUASHMSG exists). I do not think the PR needs reverting.
Added another commit, since the can exist but just have no content. In that case we should take . Please verify once again, now the feature is clearer.
Sorry for the confusion, just was not very clear to me. I will verify this later today.
Adding verified label since the git commit gets nicely preopulated with the squash message.

Related discussion:
text: } async getInputTemplate(): Promise<string> { <del> const mergeMessage = await this.repository.getMergeMessage(); </del> <ins> const commitMessage = (await Promise.all([this.repository.getMergeMessage(), this.repository.getSquashMessage()])).find(msg => msg !== undefined); </ins> <del> if (mergeMessage) { return mergeMessage; </del> <ins> if (commitMessage) { return commitMessage; </ins> } return await this.repository.getCommitTemplate();