mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
feature: supports parameters in commit template (#487)
- ${files_num} will be replaced with staged changes count - ${files} will be replaced with changed file paths - ${files:N} will be replaced with top N changes file paths and with `and {TOTAL - N} other files` at end of replaced string.
This commit is contained in:
parent
6932ce44a9
commit
900ebd8282
2 changed files with 61 additions and 7 deletions
|
@ -780,13 +780,9 @@ namespace SourceGit.ViewModels
|
|||
foreach (var change in _selectedUnstaged)
|
||||
{
|
||||
if (change.IsConflit)
|
||||
{
|
||||
hasConflicts = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
hasNoneConflicts = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasConflicts)
|
||||
|
@ -1160,7 +1156,7 @@ namespace SourceGit.ViewModels
|
|||
item.Icon = App.CreateMenuIcon("Icons.Code");
|
||||
item.Click += (_, e) =>
|
||||
{
|
||||
CommitMessage = template.Content;
|
||||
CommitMessage = template.Apply(_staged);
|
||||
e.Handled = true;
|
||||
};
|
||||
menu.Items.Add(item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue