sublimehq / sublime_merge

Issue tracker for Sublime Merge
https://www.sublimemerge.com
276 stars 14 forks source link

Auto-complete suggestions for commit message #339

Open omertuc opened 5 years ago

omertuc commented 5 years ago

Problem description

The commit message text-box requires writing the entire commit message manually.

Preferred solution

The commit message text-box should offer auto-complete suggestions, to ease the writing of commit messages.

There are a lot of sources to bring suggestions from - previous (nearby) commit messages, modified file/folder names, commit diff.

Usually commit messages reference the functions and files that they modified, and it would be nice if these were suggested.

Git Extensions is an example for a client that does this (although with a lot of room for improvement).

I'm guessing this shouldn't be too difficult, as SublimeText does a very similar thing.

certainlyakey commented 5 years ago

It could be done also the simple way SourceTree does it: there's a dropdown near the message field that contains recently submitted messages. That dropdown can be opened via a keyboard shortcut. If a dropdown item is clicked then it will prefill the message field with an old message that can partly be used to compile a new one.

omertuc commented 5 years ago

It could be done also the simple way SourceTree does it: there's a dropdown near the message field that contains recently submitted messages. That dropdown can be opened via a keyboard shortcut. If a dropdown item is clicked then it will prefill the message field with an old message that can partly be used to compile a new one.

This is not quite what I'm looking for. "Previous commit messages" is the least useful auto-complete source out of the ones I've listed. The diff contents and diff file names are the most important ones. I often find myself referencing names of functions/files I've modified in the commit message, and these are unlikely to show up in previous/nearby commit messages.

Kraymer commented 5 years ago

Came here to make that same feature request.
My use case is the same as @omertuc : referencing filenames / packages or function names, all of those directly accessible from the modified files list present in the commit.

tajmone commented 5 years ago

It would be really nice if SM would support user-definable snippets and auto-completions in the Commit editor box. This could spare a lot of typing, with ST-like snippets being able to provide templates for common messages and text-structures, with the usual Tab-navigation between elements.

Ideally, snippets and completions could be defined not only globally but also on a per-project base — either on the local user machine, or even within a repository, so that collaborators could share common snippets too.

The commit messages editor could benefit from many of ST3 features to enhance the typing experience; after all, it's a small editor in its own right.

fatlazycat commented 4 years ago

Would like auto completion from the previous commit message as sadly need a Jira number within the commit message.

tgeijten commented 2 years ago

No updates on this yet? This would indeed be very useful -- even if it could only auto-complete the names of the files that are part of the commit. Saves a lot of typing and potential typos.