Skip to content

gabsdocompiuter/vscode-keep-last-commit-message

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keep Last Commit Message

keep-last-commit-message is a VS Code extension written in TypeScript that keeps the last Source Control commit message available for reuse in the current workspace.

What it does

  • Reads and writes the last saved message through ExtensionContext.workspaceState
  • Restores the message only when the Source Control input is empty
  • Shares one saved message across all Git repositories in the same workspace
  • Avoids restoring while Git is in special states such as merge, rebase, or cherry-pick
  • Updates the saved message from the latest commit returned by repository.log({ maxEntries: 1 })

Settings

  • keepLastCommitMessage.enabled
  • keepLastCommitMessage.restoreOnStartup
  • keepLastCommitMessage.restoreAfterCommit

Package and share a VSIX

This project can be packaged as a .vsix file and shared directly without publishing to the VS Code Marketplace.

  1. Install vsce: npm install -g @vscode/vsce
  2. Build the extension: npm run compile
  3. Generate the package: vsce package
  4. Share the generated .vsix file.

Reference: VS Code docs - Packaging Extensions

Install a VSIX

There are two common ways to install the packaged extension:

  1. In VS Code, open the Extensions view, select the ... menu, and choose Install from VSIX....
  2. From the command line, run: code --install-extension keep-last-commit-message-0.0.1.vsix

Run locally

  1. Open this folder in VS Code.
  2. Run npm install.
  3. Run npm run compile.
  4. Press F5 to launch a new Extension Development Host window.
  5. Open a Git workspace in the development host and use Source Control commits to verify the behavior.

About

A VS Code extension to avoid the last commit message be cleared after commit

Topics

Resources

License

Stars

Watchers

Forks

Contributors