mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-26 21:17:20 -08:00
Compare commits
12 commits
3da52208ba
...
7c253637fc
Author | SHA1 | Date | |
---|---|---|---|
|
7c253637fc | ||
|
07cc0b7423 | ||
|
d3bca20034 | ||
|
72b46a6e16 | ||
|
9153bbe07f | ||
|
2821bab77c | ||
|
62ac4290ca | ||
|
f2de7a0c21 | ||
|
a3b0fec67a | ||
|
1e11a74a49 | ||
|
2cfa2bf6c5 | ||
|
1277112a5e |
18 changed files with 455 additions and 50 deletions
28
src/Models/ConventionalCommitType.cs
Normal file
28
src/Models/ConventionalCommitType.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace SourceGit.Models
|
||||
{
|
||||
public class ConventionalCommitType
|
||||
{
|
||||
public string Type { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
public static readonly List<ConventionalCommitType> Supported = new List<ConventionalCommitType>()
|
||||
{
|
||||
new ConventionalCommitType("feat", "Adding a new feature"),
|
||||
new ConventionalCommitType("fix", "Fixing a bug"),
|
||||
new ConventionalCommitType("docs", "Updating documentation"),
|
||||
new ConventionalCommitType("style", "Elements or code styles without changing the code logic"),
|
||||
new ConventionalCommitType("test", "Adding or updating tests"),
|
||||
new ConventionalCommitType("chore", "Making changes to the build process or auxiliary tools and libraries"),
|
||||
new ConventionalCommitType("revert", "Undoing a previous commit"),
|
||||
new ConventionalCommitType("refactor", "Restructuring code without changing its external behavior")
|
||||
};
|
||||
|
||||
public ConventionalCommitType(string type, string description)
|
||||
{
|
||||
Type = type;
|
||||
Description = description;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,9 +5,9 @@ namespace SourceGit.Models
|
|||
{
|
||||
public partial class Remote
|
||||
{
|
||||
[GeneratedRegex(@"^http[s]?://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/~]+/[\w\-\.]+(\.git)?$")]
|
||||
[GeneratedRegex(@"^http[s]?://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/~%]+/[\w\-\.%]+(\.git)?$")]
|
||||
private static partial Regex REG_HTTPS();
|
||||
[GeneratedRegex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-/~]+/[\w\-\.]+(\.git)?$")]
|
||||
[GeneratedRegex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-/~%]+/[\w\-\.%]+(\.git)?$")]
|
||||
private static partial Regex REG_SSH1();
|
||||
[GeneratedRegex(@"^ssh://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/~]+/[\w\-\.]+(\.git)?$")]
|
||||
private static partial Regex REG_SSH2();
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<StreamGeometry x:Key="Icons.Code">M853 102H171C133 102 102 133 102 171v683C102 891 133 922 171 922h683C891 922 922 891 922 853V171C922 133 891 102 853 102zM390 600l-48 48L205 512l137-137 48 48L301 512l88 88zM465 819l-66-18L559 205l66 18L465 819zm218-171L634 600 723 512l-88-88 48-48L819 512 683 649z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.ColorPicker">M128 854h768v86H128zM390 797c13 13 29 19 48 19s35-6 45-19l291-288c26-22 26-64 0-90L435 83l-61 61L426 192l-272 269c-22 22-22 64 0 90l237 246zm93-544 211 211-32 32H240l243-243zM707 694c0 48 38 86 86 86 48 0 86-38 86-86 0-22-10-45-26-61L794 576l-61 61c-13 13-26 35-26 58z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Commit">M796 471A292 292 0 00512 256a293 293 0 00-284 215H0v144h228A293 293 0 00512 832a291 291 0 00284-217H1024V471h-228M512 688A146 146 0 01366 544A145 145 0 01512 400c80 0 146 63 146 144A146 146 0 01512 688</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.CommitMessageGenerator">M796 561a5 5 0 014 7l-39 90a5 5 0 004 7h100a5 5 0 014 8l-178 247a5 5 0 01-9-4l32-148a5 5 0 00-5-6h-89a5 5 0 01-4-7l86-191a5 5 0 014-3h88zM731 122a73 73 0 0173 73v318a54 54 0 00-8-1H731V195H244v634h408l-16 73H244a73 73 0 01-73-73V195a73 73 0 0173-73h488zm-219 366v73h-195v-73h195zm146-146v73H317v-73h341z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Compare">M645 448l64 64 220-221L704 64l-64 64 115 115H128v90h628zM375 576l-64-64-220 224L314 960l64-64-116-115H896v-90H262z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Conflict">M608 0q48 0 88 23t63 63 23 87v70h55q35 0 67 14t57 38 38 57 14 67V831q0 34-14 66t-38 57-57 38-67 13H426q-34 0-66-13t-57-38-38-57-14-66v-70h-56q-34 0-66-14t-57-38-38-57-13-67V174q0-47 23-87T109 23 196 0h412m175 244H426q-46 0-86 22T278 328t-26 85v348H608q47 0 86-22t63-62 25-85l1-348m-269 318q18 0 31 13t13 31-13 31-31 13-31-13-13-31 13-31 31-13m0-212q13 0 22 9t11 22v125q0 14-9 23t-22 10-23-7-11-22l-1-126q0-13 10-23t23-10z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Copy">M896 811l-128 0c-23 0-43-19-43-43 0-23 19-43 43-43l107 0c13 0 21-9 21-21L896 107c0-13-9-21-21-21L448 85c-13 0-21 9-21 21l0 21c0 23-19 43-43 43-23 0-43-19-43-43L341 85c0-47 38-85 85-85l469 0c47 0 85 38 85 85l0 640C981 772 943 811 896 811zM683 299l0 640c0 47-38 85-85 85L128 1024c-47 0-85-38-85-85L43 299c0-47 38-85 85-85l469 0C644 213 683 252 683 299zM576 299 149 299c-13 0-21 9-21 21l0 597c0 13 9 21 21 21l427 0c13 0 21-9 21-21L597 320C597 307 589 299 576 299z</StreamGeometry>
|
||||
|
@ -85,6 +86,7 @@
|
|||
<StreamGeometry x:Key="Icons.Pull">M432 0h160c27 0 48 21 48 48v336h175c36 0 53 43 28 68L539 757c-15 15-40 15-55 0L180 452c-25-25-7-68 28-68H384V48c0-27 21-48 48-48zm592 752v224c0 27-21 48-48 48H48c-27 0-48-21-48-48V752c0-27 21-48 48-48h293l98 98c40 40 105 40 145 0l98-98H976c27 0 48 21 48 48zm-248 176c0-22-18-40-40-40s-40 18-40 40s18 40 40 40s40-18 40-40zm128 0c0-22-18-40-40-40s-40 18-40 40s18 40 40 40s40-18 40-40z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Push">M592 768h-160c-27 0-48-21-48-48V384h-175c-36 0-53-43-28-68L485 11c15-15 40-15 55 0l304 304c25 25 7 68-28 68H640v336c0 27-21 48-48 48zm432-16v224c0 27-21 48-48 48H48c-27 0-48-21-48-48V752c0-27 21-48 48-48h272v16c0 62 50 112 112 112h160c62 0 112-50 112-112v-16h272c27 0 48 21 48 48zm-248 176c0-22-18-40-40-40s-40 18-40 40s18 40 40 40s40-18 40-40zm128 0c0-22-18-40-40-40s-40 18-40 40s18 40 40 40s40-18 40-40z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Rebase">M277 85a149 149 0 00-43 292v230a32 32 0 0064 0V555h267A160 160 0 00725 395v-12a149 149 0 10-64-5v17a96 96 0 01-96 96H299V383A149 149 0 00277 85zM228 720a32 32 0 00-37-52 150 150 0 00-53 68 32 32 0 1060 23 85 85 0 0130-39zm136-52a32 32 0 00-37 52 86 86 0 0130 39 32 32 0 1060-23 149 149 0 00-53-68zM204 833a32 32 0 10-55 32 149 149 0 0063 58 32 32 0 0028-57 85 85 0 01-36-33zm202 32a32 32 0 00-55-32 85 85 0 01-36 33 32 32 0 0028 57 149 149 0 0063-58z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Reference">M854 234a171 171 0 00-171 171v51c13-5 28-7 43-7h35a136 136 0 01136 136v93a198 198 0 01-198 198 101 101 0 01-101-101V405a256 256 0 01256-256h21a21 21 0 0121 21v43a21 21 0 01-21 21h-21zM213 456c13-5 28-7 43-7h35a136 136 0 01136 136v93a198 198 0 01-198 198 101 101 0 01-101-101V405a256 256 0 01256-256h21a21 21 0 0121 21v43a21 21 0 01-21 21h-21a171 171 0 00-171 171v51z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Relation">m224 154a166 166 0 00-166 166v192a166 166 0 00166 166h64v-76h-64a90 90 0 01-90-90v-192a90 90 0 0190-90h320a90 90 0 0190 90v192a90 90 0 01-90 90h-128v77h128a166 166 0 00166-167v-192a166 166 0 00-166-166h-320zm166 390a90 90 0 0190-90h128v-76h-128a166 166 0 00-166 166v192a166 166 0 00166 166h320a166 166 0 00166-166v-192a166 166 0 00-166-166h-64v77h64a90 90 0 0190 90v192a90 90 0 01-90 90h-320a90 90 0 01-90-90v-192z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Remote">M512 128M706 302a289 289 0 00-173 44 27 27 0 1029 46 234 234 0 01125-36c23 0 45 3 66 9 93 28 161 114 161 215C914 704 813 805 687 805H337C211 805 110 704 110 580c0-96 61-178 147-210C282 263 379 183 495 183a245 245 0 01210 119z</StreamGeometry>
|
||||
<StreamGeometry x:Key="Icons.Remote.Add">M364 512h67v108h108v67h-108v108h-67v-108h-108v-67h108v-108zm298-64A107 107 0 01768 555C768 614 720 660 660 660h-108v-54h-108v-108h-94v108h-94c4-21 22-47 44-51l-1-12a75 75 0 0171-75a128 128 0 01239-7a106 106 0 0153-14z</StreamGeometry>
|
||||
|
|
|
@ -361,10 +361,8 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">Interaktiver Rebase</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">Ziel Branch:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">Auf:</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">FEHLER</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">INFO</x:String>
|
||||
<x:String x:Key="Text.Launcher.Menu" xml:space="preserve">Hauptmenü öffnen</x:String>
|
||||
<x:String x:Key="Text.Merge" xml:space="preserve">Branch mergen</x:String>
|
||||
<x:String x:Key="Text.Merge.Into" xml:space="preserve">Ziel-Branch:</x:String>
|
||||
<x:String x:Key="Text.Merge.Mode" xml:space="preserve">Merge Option:</x:String>
|
||||
|
@ -373,9 +371,7 @@
|
|||
<x:String x:Key="Text.MoveRepositoryNode.Target" xml:space="preserve">Wähle Vorgänger-Knoten für:</x:String>
|
||||
<x:String x:Key="Text.Name" xml:space="preserve">Name:</x:String>
|
||||
<x:String x:Key="Text.NotConfigured" xml:space="preserve">Git wurde NICHT konfiguriert. Gehe bitte zuerst in die [Einstellungen] und konfiguriere Git.</x:String>
|
||||
<x:String x:Key="Text.Notice" xml:space="preserve">BENACHRICHTIGUNG</x:String>
|
||||
<x:String x:Key="Text.OpenAppDataDir" xml:space="preserve">App-Daten Ordner öffnen</x:String>
|
||||
<x:String x:Key="Text.OpenFolder" xml:space="preserve">ORDNER AUSWÄHLEN</x:String>
|
||||
<x:String x:Key="Text.OpenWith" xml:space="preserve">Öffne mit...</x:String>
|
||||
<x:String x:Key="Text.Optional" xml:space="preserve">Optional.</x:String>
|
||||
<x:String x:Key="Text.PageTabBar.New" xml:space="preserve">Neue Seite erstellen</x:String>
|
||||
|
|
|
@ -158,6 +158,13 @@
|
|||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">Workspaces</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">Color</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">Restore tabs on startup</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">Conventional Commit Helper</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">Breaking Change:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">Closed Issue:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.Detail" xml:space="preserve">Detail Changes:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.Scope" xml:space="preserve">Scope:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ShortDescription" xml:space="preserve">Short Description:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.Type" xml:space="preserve">Type of Change:</x:String>
|
||||
<x:String x:Key="Text.Copy" xml:space="preserve">Copy</x:String>
|
||||
<x:String x:Key="Text.CopyAllText" xml:space="preserve">Copy All Text</x:String>
|
||||
<x:String x:Key="Text.CopyMessage" xml:space="preserve">COPY MESSAGE</x:String>
|
||||
|
@ -361,10 +368,8 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">Interactive Rebase</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">Target Branch:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">On:</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">ERROR</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">NOTICE</x:String>
|
||||
<x:String x:Key="Text.Launcher.Menu" xml:space="preserve">Open Main Menu</x:String>
|
||||
<x:String x:Key="Text.Merge" xml:space="preserve">Merge Branch</x:String>
|
||||
<x:String x:Key="Text.Merge.Into" xml:space="preserve">Into:</x:String>
|
||||
<x:String x:Key="Text.Merge.Mode" xml:space="preserve">Merge Option:</x:String>
|
||||
|
@ -373,9 +378,7 @@
|
|||
<x:String x:Key="Text.MoveRepositoryNode.Target" xml:space="preserve">Select parent node for:</x:String>
|
||||
<x:String x:Key="Text.Name" xml:space="preserve">Name:</x:String>
|
||||
<x:String x:Key="Text.NotConfigured" xml:space="preserve">Git has NOT been configured. Please to go [Preference] and configure it first.</x:String>
|
||||
<x:String x:Key="Text.Notice" xml:space="preserve">NOTICE</x:String>
|
||||
<x:String x:Key="Text.OpenAppDataDir" xml:space="preserve">Open App Data Dir</x:String>
|
||||
<x:String x:Key="Text.OpenFolder" xml:space="preserve">SELECT FOLDER</x:String>
|
||||
<x:String x:Key="Text.OpenWith" xml:space="preserve">Open With...</x:String>
|
||||
<x:String x:Key="Text.Optional" xml:space="preserve">Optional.</x:String>
|
||||
<x:String x:Key="Text.PageTabBar.New" xml:space="preserve">Create New Page</x:String>
|
||||
|
@ -503,6 +506,7 @@
|
|||
<x:String x:Key="Text.Repository.ClearAllCommitsFilter" xml:space="preserve">Clear all</x:String>
|
||||
<x:String x:Key="Text.Repository.Configure" xml:space="preserve">Configure this repository</x:String>
|
||||
<x:String x:Key="Text.Repository.Continue" xml:space="preserve">CONTINUE</x:String>
|
||||
<x:String x:Key="Text.Repository.EnableReflog" xml:space="preserve">Enable '--reflog' Option</x:String>
|
||||
<x:String x:Key="Text.Repository.Explore" xml:space="preserve">Open In File Browser</x:String>
|
||||
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">Search Branches/Tags/Submodules</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommitPrefix" xml:space="preserve">FILTERED BY:</x:String>
|
||||
|
|
|
@ -342,19 +342,15 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">Interactive Rebase</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">Target Branch:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">On:</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">ERROR</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">NOTICE</x:String>
|
||||
<x:String x:Key="Text.Launcher.Menu" xml:space="preserve">Open Main Menu</x:String>
|
||||
<x:String x:Key="Text.Merge" xml:space="preserve">Merge Branch</x:String>
|
||||
<x:String x:Key="Text.Merge.Into" xml:space="preserve">Into:</x:String>
|
||||
<x:String x:Key="Text.Merge.Mode" xml:space="preserve">Merge Option:</x:String>
|
||||
<x:String x:Key="Text.Merge.Source" xml:space="preserve">Source Branch:</x:String>
|
||||
<x:String x:Key="Text.Name" xml:space="preserve">Nom :</x:String>
|
||||
<x:String x:Key="Text.NotConfigured" xml:space="preserve">Git n'a PAS été configuré. Veuillez d'abord le faire dans le menu Préférence.</x:String>
|
||||
<x:String x:Key="Text.Notice" xml:space="preserve">NOTICE</x:String>
|
||||
<x:String x:Key="Text.OpenAppDataDir" xml:space="preserve">Ouvrir le dossier AppData</x:String>
|
||||
<x:String x:Key="Text.OpenFolder" xml:space="preserve">SELECT FOLDER</x:String>
|
||||
<x:String x:Key="Text.OpenWith" xml:space="preserve">Open With...</x:String>
|
||||
<x:String x:Key="Text.Optional" xml:space="preserve">Optional.</x:String>
|
||||
<x:String x:Key="Text.PageTabBar.New" xml:space="preserve">Créer un nouvel onglet</x:String>
|
||||
|
|
|
@ -337,19 +337,15 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">Rebase Interativo</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">Ramo Alvo:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">Em:</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">ERRO</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">AVISO</x:String>
|
||||
<x:String x:Key="Text.Launcher.Menu" xml:space="preserve">Abrir Menu Principal</x:String>
|
||||
<x:String x:Key="Text.Merge" xml:space="preserve">Mesclar Ramo</x:String>
|
||||
<x:String x:Key="Text.Merge.Into" xml:space="preserve">Para:</x:String>
|
||||
<x:String x:Key="Text.Merge.Mode" xml:space="preserve">Opção de Mesclagem:</x:String>
|
||||
<x:String x:Key="Text.Merge.Source" xml:space="preserve">Ramo de Origem:</x:String>
|
||||
<x:String x:Key="Text.Name" xml:space="preserve">Nome:</x:String>
|
||||
<x:String x:Key="Text.NotConfigured" xml:space="preserve">O Git NÃO foi configurado. Por favor, vá para [Preferências] e configure primeiro.</x:String>
|
||||
<x:String x:Key="Text.Notice" xml:space="preserve">AVISO</x:String>
|
||||
<x:String x:Key="Text.OpenAppDataDir" xml:space="preserve">Abrir Pasta de Dados do Aplicativo</x:String>
|
||||
<x:String x:Key="Text.OpenFolder" xml:space="preserve">SELECIONAR PASTA</x:String>
|
||||
<x:String x:Key="Text.OpenWith" xml:space="preserve">Abrir Com...</x:String>
|
||||
<x:String x:Key="Text.Optional" xml:space="preserve">Opcional.</x:String>
|
||||
<x:String x:Key="Text.PageTabBar.New" xml:space="preserve">Criar Nova Página</x:String>
|
||||
|
|
|
@ -86,8 +86,11 @@
|
|||
<x:String x:Key="Text.Checkout.LocalChanges.DoNothing" xml:space="preserve">Ничего не делать</x:String>
|
||||
<x:String x:Key="Text.Checkout.LocalChanges.StashAndReply" xml:space="preserve">Отложить и примненить повторно</x:String>
|
||||
<x:String x:Key="Text.CherryPick" xml:space="preserve"> Частичный выбор</x:String>
|
||||
<x:String x:Key="Text.CherryPick.AppendSourceToMessage" xml:space="preserve">Добавить источник для фиксации сообщения</x:String>
|
||||
<x:String x:Key="Text.CherryPick.Commit" xml:space="preserve">Фиксация(и):</x:String>
|
||||
<x:String x:Key="Text.CherryPick.CommitChanges" xml:space="preserve">Фиксировать все изменения.</x:String>
|
||||
<x:String x:Key="Text.CherryPick.Mainline" xml:space="preserve">Основной:</x:String>
|
||||
<x:String x:Key="Text.CherryPick.Mainline.Tips" xml:space="preserve">Обычно вы не можете выделить слияние, потому что не знаете, какую сторону слияния следует считать основной. Эта опция позволяет отобразить изменение относительно указанного родительского элемента.</x:String>
|
||||
<x:String x:Key="Text.ClearStashes" xml:space="preserve">Очистить отложенные</x:String>
|
||||
<x:String x:Key="Text.ClearStashes.Message" xml:space="preserve">Вы пытаетесь очистить все отложенные. Вы уверены, что будете продолжать?</x:String>
|
||||
<x:String x:Key="Text.Clone" xml:space="preserve">Клонировать внешнее хранилище</x:String>
|
||||
|
@ -182,7 +185,7 @@
|
|||
<x:String x:Key="Text.CreateTag.Name.Placeholder" xml:space="preserve">Рекомендуемый формат: v1.0.0-alpha</x:String>
|
||||
<x:String x:Key="Text.CreateTag.PushToAllRemotes" xml:space="preserve">Выложить на все внешние хранилища после создания</x:String>
|
||||
<x:String x:Key="Text.CreateTag.Title" xml:space="preserve">Создать новую метку</x:String>
|
||||
<x:String x:Key="Text.CreateTag.Type" xml:space="preserve">Добрый:</x:String>
|
||||
<x:String x:Key="Text.CreateTag.Type" xml:space="preserve">Вид:</x:String>
|
||||
<x:String x:Key="Text.CreateTag.Type.Annotated" xml:space="preserve">Аннотированный</x:String>
|
||||
<x:String x:Key="Text.CreateTag.Type.Lightweight" xml:space="preserve">Лёгкий</x:String>
|
||||
<x:String x:Key="Text.CtrlClickTip" xml:space="preserve">Удерживайте Ctrl, чтобы начать непосредственно</x:String>
|
||||
|
@ -293,7 +296,7 @@
|
|||
<x:String x:Key="Text.GitLFS.AddTrackPattern.Title" xml:space="preserve">Добавить шаблон отслеживания в ХБФ Git</x:String>
|
||||
<x:String x:Key="Text.GitLFS.Fetch" xml:space="preserve">Извлечь</x:String>
|
||||
<x:String x:Key="Text.GitLFS.Fetch.Title" xml:space="preserve">Извлечь объекты ХБФ</x:String>
|
||||
<x:String x:Key="Text.GitLFS.Fetch.Tips" xml:space="preserve">Запустите `git lfs fetch", чтобы загрузить объекты ХБФ Git. При этом рабочая копия не обновляется.</x:String>
|
||||
<x:String x:Key="Text.GitLFS.Fetch.Tips" xml:space="preserve">Запустить `git lfs fetch", чтобы загрузить объекты ХБФ Git. При этом рабочая копия не обновляется.</x:String>
|
||||
<x:String x:Key="Text.GitLFS.Install" xml:space="preserve">Установить перехват ХБФ Git</x:String>
|
||||
<x:String x:Key="Text.GitLFS.Locks" xml:space="preserve">Показать блокировки</x:String>
|
||||
<x:String x:Key="Text.GitLFS.Locks.Empty" xml:space="preserve">Нет заблокированных файлов</x:String>
|
||||
|
@ -321,6 +324,9 @@
|
|||
<x:String x:Key="Text.Histories.Header.SHA" xml:space="preserve">SHA</x:String>
|
||||
<x:String x:Key="Text.Histories.Header.Time" xml:space="preserve">ВРЕМЯ ФИКСАЦИИ</x:String>
|
||||
<x:String x:Key="Text.Histories.Selected" xml:space="preserve">ВЫБРАННЫЕ {0} ФИКСАЦИИ</x:String>
|
||||
<x:String x:Key="Text.Histories.Tips" xml:space="preserve">Удерживайте 'Ctrl' или 'Shift', чтобы выбрать несколько фиксаций.</x:String>
|
||||
<x:String x:Key="Text.Histories.Tips.MacOS" xml:space="preserve">Удерживайте ⌘ или ⇧, чтобы выбрать несколько фиксаций.</x:String>
|
||||
<x:String x:Key="Text.Histories.Tips.Prefix" xml:space="preserve">ПОДСКАЗКИ:</x:String>
|
||||
<x:String x:Key="Text.Hotkeys" xml:space="preserve">Ссылка на сочетания клавиш</x:String>
|
||||
<x:String x:Key="Text.Hotkeys.Global" xml:space="preserve">ОБЩЕЕ</x:String>
|
||||
<x:String x:Key="Text.Hotkeys.Global.CancelPopup" xml:space="preserve">Отменить текущее всплывающее окно</x:String>
|
||||
|
@ -358,10 +364,8 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">Интерактивное перемещение</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">Целевая ветка:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">На:</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">ОШИБКА</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">УВЕДОМЛЕНИЕ</x:String>
|
||||
<x:String x:Key="Text.Launcher.Menu" xml:space="preserve">Открыть главное меню</x:String>
|
||||
<x:String x:Key="Text.Merge" xml:space="preserve">Слить ветку</x:String>
|
||||
<x:String x:Key="Text.Merge.Into" xml:space="preserve">В:</x:String>
|
||||
<x:String x:Key="Text.Merge.Mode" xml:space="preserve">Опции слияния:</x:String>
|
||||
|
@ -370,9 +374,7 @@
|
|||
<x:String x:Key="Text.MoveRepositoryNode.Target" xml:space="preserve">Выбрать родительский узел для:</x:String>
|
||||
<x:String x:Key="Text.Name" xml:space="preserve">Имя:</x:String>
|
||||
<x:String x:Key="Text.NotConfigured" xml:space="preserve">Git НЕ был настроен. Пожалуйста, перейдите в [Настройки] и сначала настройте его.</x:String>
|
||||
<x:String x:Key="Text.Notice" xml:space="preserve">УВЕДОМЛЕНИЕ</x:String>
|
||||
<x:String x:Key="Text.OpenAppDataDir" xml:space="preserve">Открыть приложение каталогов данных</x:String>
|
||||
<x:String x:Key="Text.OpenFolder" xml:space="preserve">ВЫБОР КАТАЛОГА</x:String>
|
||||
<x:String x:Key="Text.OpenWith" xml:space="preserve">Окрыть с...</x:String>
|
||||
<x:String x:Key="Text.Optional" xml:space="preserve">Необязательно.</x:String>
|
||||
<x:String x:Key="Text.PageTabBar.New" xml:space="preserve">Создать новую страницу</x:String>
|
||||
|
@ -592,6 +594,7 @@
|
|||
<x:String x:Key="Text.Submodule.Remove" xml:space="preserve">Удалить подмодуль</x:String>
|
||||
<x:String x:Key="Text.Sure" xml:space="preserve">ОК</x:String>
|
||||
<x:String x:Key="Text.TagCM.Copy" xml:space="preserve">Копировать имя метки</x:String>
|
||||
<x:String x:Key="Text.TagCM.CopyMessage" xml:space="preserve">Копировать сообщение с метки</x:String>
|
||||
<x:String x:Key="Text.TagCM.Delete" xml:space="preserve">Удалить ${0}$...</x:String>
|
||||
<x:String x:Key="Text.TagCM.Push" xml:space="preserve">Выложить ${0}$...</x:String>
|
||||
<x:String x:Key="Text.URL" xml:space="preserve">Сетевой адрес:</x:String>
|
||||
|
|
|
@ -161,6 +161,13 @@
|
|||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">工作区</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">颜色</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">启动时恢复打开的仓库</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">规范化提交信息生成</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">破坏性更新:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">关闭的ISSUE:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.Detail" xml:space="preserve">详细说明:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.Scope" xml:space="preserve">模块:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ShortDescription" xml:space="preserve">简述:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.Type" xml:space="preserve">类型:</x:String>
|
||||
<x:String x:Key="Text.Copy" xml:space="preserve">复制</x:String>
|
||||
<x:String x:Key="Text.CopyAllText" xml:space="preserve">复制全部文本</x:String>
|
||||
<x:String x:Key="Text.CopyMessage" xml:space="preserve">复制内容</x:String>
|
||||
|
@ -364,10 +371,8 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">交互式变基</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">目标分支 :</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">起始提交 :</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">出错了</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">系统提示</x:String>
|
||||
<x:String x:Key="Text.Launcher.Menu" xml:space="preserve">主菜单</x:String>
|
||||
<x:String x:Key="Text.Merge" xml:space="preserve">合并分支</x:String>
|
||||
<x:String x:Key="Text.Merge.Into" xml:space="preserve">目标分支 :</x:String>
|
||||
<x:String x:Key="Text.Merge.Mode" xml:space="preserve">合并方式 :</x:String>
|
||||
|
@ -376,9 +381,7 @@
|
|||
<x:String x:Key="Text.MoveRepositoryNode.Target" xml:space="preserve">请选择目标分组:</x:String>
|
||||
<x:String x:Key="Text.Name" xml:space="preserve">名称 :</x:String>
|
||||
<x:String x:Key="Text.NotConfigured" xml:space="preserve">GIT尚未配置。请打开【偏好设置】配置GIT路径。</x:String>
|
||||
<x:String x:Key="Text.Notice" xml:space="preserve">系统提示</x:String>
|
||||
<x:String x:Key="Text.OpenAppDataDir" xml:space="preserve">浏览应用数据目录</x:String>
|
||||
<x:String x:Key="Text.OpenFolder" xml:space="preserve">选择文件夹</x:String>
|
||||
<x:String x:Key="Text.OpenWith" xml:space="preserve">打开文件...</x:String>
|
||||
<x:String x:Key="Text.Optional" xml:space="preserve">选填。</x:String>
|
||||
<x:String x:Key="Text.PageTabBar.New" xml:space="preserve">新建空白页</x:String>
|
||||
|
@ -501,6 +504,7 @@
|
|||
<x:String x:Key="Text.Repository.ClearAllCommitsFilter" xml:space="preserve">清空过滤规则</x:String>
|
||||
<x:String x:Key="Text.Repository.Configure" xml:space="preserve">配置本仓库</x:String>
|
||||
<x:String x:Key="Text.Repository.Continue" xml:space="preserve">下一步</x:String>
|
||||
<x:String x:Key="Text.Repository.EnableReflog" xml:space="preserve">启用 --reflog 选项</x:String>
|
||||
<x:String x:Key="Text.Repository.Explore" xml:space="preserve">在文件浏览器中打开</x:String>
|
||||
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">快速查找分支/标签/子模块</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommitPrefix" xml:space="preserve">过滤规则 :</x:String>
|
||||
|
|
|
@ -161,6 +161,13 @@
|
|||
<x:String x:Key="Text.ConfigureWorkspace" xml:space="preserve">工作區</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Color" xml:space="preserve">顏色</x:String>
|
||||
<x:String x:Key="Text.ConfigureWorkspace.Restore" xml:space="preserve">啟動時還原上次開啟的存放庫</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit" xml:space="preserve">規範化提交資訊生成</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.BreakingChanges" xml:space="preserve">破壞性變更說明:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ClosedIssue" xml:space="preserve">關閉的ISSUE:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.Detail" xml:space="preserve">詳細資訊:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.Scope" xml:space="preserve">模組:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.ShortDescription" xml:space="preserve">簡述:</x:String>
|
||||
<x:String x:Key="Text.ConventionalCommit.Type" xml:space="preserve">類型:</x:String>
|
||||
<x:String x:Key="Text.Copy" xml:space="preserve">複製</x:String>
|
||||
<x:String x:Key="Text.CopyAllText" xml:space="preserve">複製全部內容</x:String>
|
||||
<x:String x:Key="Text.CopyMessage" xml:space="preserve">複製內容</x:String>
|
||||
|
@ -364,10 +371,8 @@
|
|||
<x:String x:Key="Text.InteractiveRebase" xml:space="preserve">互動式重定基底</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.Target" xml:space="preserve">目標分支:</x:String>
|
||||
<x:String x:Key="Text.InteractiveRebase.On" xml:space="preserve">起始提交:</x:String>
|
||||
<x:String x:Key="Text.Launcher" xml:space="preserve">Source Git</x:String>
|
||||
<x:String x:Key="Text.Launcher.Error" xml:space="preserve">發生錯誤</x:String>
|
||||
<x:String x:Key="Text.Launcher.Info" xml:space="preserve">系統提示</x:String>
|
||||
<x:String x:Key="Text.Launcher.Menu" xml:space="preserve">主選單</x:String>
|
||||
<x:String x:Key="Text.Merge" xml:space="preserve">合併分支</x:String>
|
||||
<x:String x:Key="Text.Merge.Into" xml:space="preserve">目標分支:</x:String>
|
||||
<x:String x:Key="Text.Merge.Mode" xml:space="preserve">合併方式:</x:String>
|
||||
|
@ -376,9 +381,7 @@
|
|||
<x:String x:Key="Text.MoveRepositoryNode.Target" xml:space="preserve">請選擇目標分組:</x:String>
|
||||
<x:String x:Key="Text.Name" xml:space="preserve">名稱:</x:String>
|
||||
<x:String x:Key="Text.NotConfigured" xml:space="preserve">尚未設定 Git。請開啟 [偏好設定] 以設定 Git 路徑。</x:String>
|
||||
<x:String x:Key="Text.Notice" xml:space="preserve">系統提示</x:String>
|
||||
<x:String x:Key="Text.OpenAppDataDir" xml:space="preserve">瀏覽程式資料目錄</x:String>
|
||||
<x:String x:Key="Text.OpenFolder" xml:space="preserve">選擇資料夾</x:String>
|
||||
<x:String x:Key="Text.OpenWith" xml:space="preserve">開啟檔案...</x:String>
|
||||
<x:String x:Key="Text.Optional" xml:space="preserve">選填。</x:String>
|
||||
<x:String x:Key="Text.PageTabBar.New" xml:space="preserve">新增分頁</x:String>
|
||||
|
@ -506,6 +509,7 @@
|
|||
<x:String x:Key="Text.Repository.ClearAllCommitsFilter" xml:space="preserve">清空篩選規則</x:String>
|
||||
<x:String x:Key="Text.Repository.Configure" xml:space="preserve">設定本存放庫</x:String>
|
||||
<x:String x:Key="Text.Repository.Continue" xml:space="preserve">下一步</x:String>
|
||||
<x:String x:Key="Text.Repository.EnableReflog" xml:space="preserve">啟用 [--reflog] 選項</x:String>
|
||||
<x:String x:Key="Text.Repository.Explore" xml:space="preserve">在檔案瀏覽器中開啟</x:String>
|
||||
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">快速搜尋分支/標籤/子模組</x:String>
|
||||
<x:String x:Key="Text.Repository.FilterCommitPrefix" xml:space="preserve">篩選規則:</x:String>
|
||||
|
|
112
src/ViewModels/ConventionalCommitMessageBuilder.cs
Normal file
112
src/ViewModels/ConventionalCommitMessageBuilder.cs
Normal file
|
@ -0,0 +1,112 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace SourceGit.ViewModels
|
||||
{
|
||||
public class ConventionalCommitMessageBuilder : ObservableValidator
|
||||
{
|
||||
[Required(ErrorMessage = "Type of changes can not be null")]
|
||||
public Models.ConventionalCommitType Type
|
||||
{
|
||||
get => _type;
|
||||
set => SetProperty(ref _type, value, true);
|
||||
}
|
||||
|
||||
public string Scope
|
||||
{
|
||||
get => _scope;
|
||||
set => SetProperty(ref _scope, value);
|
||||
}
|
||||
|
||||
[Required(ErrorMessage = "Short description can not be empty")]
|
||||
public string Description
|
||||
{
|
||||
get => _description;
|
||||
set => SetProperty(ref _description, value, true);
|
||||
}
|
||||
|
||||
public string Detail
|
||||
{
|
||||
get => _detail;
|
||||
set => SetProperty(ref _detail, value);
|
||||
}
|
||||
|
||||
public string BreakingChanges
|
||||
{
|
||||
get => _breakingChanges;
|
||||
set => SetProperty(ref _breakingChanges, value);
|
||||
}
|
||||
|
||||
public string ClosedIssue
|
||||
{
|
||||
get => _closedIssue;
|
||||
set => SetProperty(ref _closedIssue, value);
|
||||
}
|
||||
|
||||
public ConventionalCommitMessageBuilder(WorkingCopy wc)
|
||||
{
|
||||
_wc = wc;
|
||||
}
|
||||
|
||||
[UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode")]
|
||||
public bool Apply()
|
||||
{
|
||||
if (HasErrors)
|
||||
return false;
|
||||
|
||||
ValidateAllProperties();
|
||||
if (HasErrors)
|
||||
return false;
|
||||
|
||||
var builder = new StringBuilder();
|
||||
builder.Append(_type.Type);
|
||||
|
||||
if (!string.IsNullOrEmpty(_scope))
|
||||
{
|
||||
builder.Append("(");
|
||||
builder.Append(_scope);
|
||||
builder.Append("): ");
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.Append(": ");
|
||||
}
|
||||
|
||||
builder.Append(_description);
|
||||
builder.Append("\n\n");
|
||||
|
||||
if (!string.IsNullOrEmpty(_detail))
|
||||
{
|
||||
builder.Append(_detail);
|
||||
builder.Append("\n\n");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(_breakingChanges))
|
||||
{
|
||||
builder.Append("BREAKING CHANGE: ");
|
||||
builder.Append(_breakingChanges);
|
||||
builder.Append("\n\n");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(_closedIssue))
|
||||
{
|
||||
builder.Append("Closed ");
|
||||
builder.Append(_closedIssue);
|
||||
}
|
||||
|
||||
_wc.CommitMessage = builder.ToString();
|
||||
return true;
|
||||
}
|
||||
|
||||
private WorkingCopy _wc = null;
|
||||
private Models.ConventionalCommitType _type = Models.ConventionalCommitType.Supported[0];
|
||||
private string _scope = string.Empty;
|
||||
private string _description = string.Empty;
|
||||
private string _detail = string.Empty;
|
||||
private string _breakingChanges = string.Empty;
|
||||
private string _closedIssue = string.Empty;
|
||||
}
|
||||
}
|
|
@ -74,6 +74,16 @@ namespace SourceGit.ViewModels
|
|||
set => SetProperty(ref _selectedView, value);
|
||||
}
|
||||
|
||||
public bool EnableReflog
|
||||
{
|
||||
get => _enableReflog;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _enableReflog, value))
|
||||
Task.Run(RefreshCommits);
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnableFirstParentInHistories
|
||||
{
|
||||
get => _enableFirstParentInHistories;
|
||||
|
@ -827,6 +837,8 @@ namespace SourceGit.ViewModels
|
|||
Dispatcher.UIThread.Invoke(() => _histories.IsLoading = true);
|
||||
|
||||
var limits = $"-{Preference.Instance.MaxHistoryCommits} ";
|
||||
if (_enableReflog)
|
||||
limits += "--reflog ";
|
||||
if (_enableFirstParentInHistories)
|
||||
limits += "--first-parent ";
|
||||
|
||||
|
@ -2056,7 +2068,31 @@ namespace SourceGit.ViewModels
|
|||
Task.Run(() =>
|
||||
{
|
||||
var files = new Commands.QueryCurrentRevisionFiles(_fullpath).Result();
|
||||
Dispatcher.UIThread.Invoke(() => _revisionFiles.AddRange(files));
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
if (_searchCommitFilterType != 3)
|
||||
return;
|
||||
|
||||
_revisionFiles.AddRange(files);
|
||||
|
||||
if (!string.IsNullOrEmpty(_searchCommitFilter) && _searchCommitFilter.Length > 2 && _revisionFiles.Count > 0)
|
||||
{
|
||||
var suggestion = new List<string>();
|
||||
foreach (var file in _revisionFiles)
|
||||
{
|
||||
if (file.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) && file.Length != _searchCommitFilter.Length)
|
||||
{
|
||||
suggestion.Add(file);
|
||||
if (suggestion.Count > 100)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
SearchCommitFilterSuggestion.Clear();
|
||||
SearchCommitFilterSuggestion.AddRange(suggestion);
|
||||
IsSearchCommitSuggestionOpen = SearchCommitFilterSuggestion.Count > 0;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -2102,6 +2138,7 @@ namespace SourceGit.ViewModels
|
|||
private bool _isSearchCommitSuggestionOpen = false;
|
||||
private int _searchCommitFilterType = 2;
|
||||
private bool _onlySearchCommitsInCurrentBranch = false;
|
||||
private bool _enableReflog = false;
|
||||
private bool _enableFirstParentInHistories = false;
|
||||
private string _searchCommitFilter = string.Empty;
|
||||
private List<Models.Commit> _searchedCommits = new List<Models.Commit>();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
using Avalonia;
|
||||
|
@ -92,8 +93,8 @@ namespace SourceGit.Views
|
|||
if (avatar.User == null)
|
||||
return;
|
||||
|
||||
var placeholder = string.IsNullOrWhiteSpace(avatar.User.Name) ? "?" : avatar.User.Name.Substring(0, 1);
|
||||
var chars = placeholder.ToCharArray();
|
||||
var fallback = GetFallbackString(avatar.User.Name);
|
||||
var chars = fallback.ToCharArray();
|
||||
var sum = 0;
|
||||
foreach (var c in chars)
|
||||
sum += Math.Abs(c);
|
||||
|
@ -105,11 +106,9 @@ namespace SourceGit.Views
|
|||
EndPoint = new RelativePoint(0, 1, RelativeUnit.Relative),
|
||||
};
|
||||
|
||||
var fontFamily = avatar.FindResource("Fonts.Monospace") as FontFamily;
|
||||
var typeface = new Typeface(fontFamily);
|
||||
|
||||
var typeface = new Typeface("fonts:SourceGit#JetBrains Mono");
|
||||
avatar._fallbackLabel = new FormattedText(
|
||||
placeholder,
|
||||
fallback,
|
||||
CultureInfo.CurrentCulture,
|
||||
FlowDirection.LeftToRight,
|
||||
typeface,
|
||||
|
@ -119,6 +118,23 @@ namespace SourceGit.Views
|
|||
avatar.InvalidateVisual();
|
||||
}
|
||||
|
||||
private static string GetFallbackString(string name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
return "?";
|
||||
|
||||
var parts = name.Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
var chars = new List<char>();
|
||||
foreach (var part in parts)
|
||||
chars.Add(part[0]);
|
||||
|
||||
if (chars.Count >= 2)
|
||||
return string.Format("{0}{1}", chars[0], chars[^1]);
|
||||
if (chars.Count == 1)
|
||||
return string.Format("{0}", chars[0]);
|
||||
return name.Substring(0, 1);
|
||||
}
|
||||
|
||||
private FormattedText _fallbackLabel = null;
|
||||
private LinearGradientBrush _fallbackBrush = null;
|
||||
}
|
||||
|
|
146
src/Views/ConventionalCommitMessageBuilder.axaml
Normal file
146
src/Views/ConventionalCommitMessageBuilder.axaml
Normal file
|
@ -0,0 +1,146 @@
|
|||
<v:ChromelessWindow xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:m="using:SourceGit.Models"
|
||||
xmlns:vm="using:SourceGit.ViewModels"
|
||||
xmlns:v="using:SourceGit.Views"
|
||||
xmlns:c="using:SourceGit.Converters"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="SourceGit.Views.ConventionalCommitMessageBuilder"
|
||||
x:DataType="vm:ConventionalCommitMessageBuilder"
|
||||
x:Name="ThisControl"
|
||||
Icon="/App.ico"
|
||||
Title="{DynamicResource Text.ConventionalCommit}"
|
||||
Width="600"
|
||||
SizeToContent="Height"
|
||||
CanResize="False"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto" MinWidth="494">
|
||||
<!-- TitleBar -->
|
||||
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" Height="30" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Background="{DynamicResource Brush.TitleBar}"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}"
|
||||
PointerPressed="BeginMoveWindow"/>
|
||||
|
||||
<Path Grid.Column="0"
|
||||
Width="14" Height="14"
|
||||
Data="{StaticResource Icons.CommitMessageGenerator}"
|
||||
Margin="10,0,0,0"
|
||||
IsVisible="{OnPlatform True, macOS=False}"/>
|
||||
|
||||
<v:CaptionButtonsMacOS Grid.Column="0"
|
||||
Margin="0,2,0,0"
|
||||
IsCloseButtonOnly="True"
|
||||
IsVisible="{OnPlatform False, macOS=True}"/>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Classes="bold"
|
||||
Text="{DynamicResource Text.ConventionalCommit}"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
IsHitTestVisible="False"/>
|
||||
|
||||
<v:CaptionButtons Grid.Column="2"
|
||||
IsCloseButtonOnly="True"
|
||||
IsVisible="{OnPlatform True, macOS=False}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Body -->
|
||||
<Grid Grid.Row="1" Margin="16,8" RowDefinitions="32,32,32,100,100,32" ColumnDefinitions="Auto,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Margin="0,6,8,0"
|
||||
Text="{DynamicResource Text.ConventionalCommit.Type}"/>
|
||||
<ComboBox Grid.Row="0" Grid.Column="1"
|
||||
Height="28" Padding="8,0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
ItemsSource="{Binding Source={x:Static m:ConventionalCommitType.Supported}}"
|
||||
SelectedItem="{Binding Type, Mode=TwoWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="{x:Type m:ConventionalCommitType}">
|
||||
<Grid Height="20" ColumnDefinitions="64,Auto" VerticalAlignment="Center">
|
||||
<TextBlock Grid.Column="0" Text="{Binding Type}"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding Description}" Foreground="{DynamicResource Brush.FG2}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Margin="0,6,8,0"
|
||||
Text="{DynamicResource Text.ConventionalCommit.Scope}"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="1"
|
||||
Height="26"
|
||||
VerticalAlignment="Center"
|
||||
CornerRadius="2"
|
||||
Watermark="{DynamicResource Text.Optional}"
|
||||
Text="{Binding Scope, Mode=TwoWay}"/>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Margin="0,6,8,0"
|
||||
Text="{DynamicResource Text.ConventionalCommit.ShortDescription}"/>
|
||||
<TextBox Grid.Row="2" Grid.Column="1"
|
||||
Height="26"
|
||||
VerticalAlignment="Center"
|
||||
CornerRadius="2"
|
||||
Text="{Binding Description, Mode=TwoWay}"/>
|
||||
|
||||
<TextBlock Grid.Row="3" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Margin="0,6,8,0"
|
||||
Text="{DynamicResource Text.ConventionalCommit.Detail}"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="1"
|
||||
Height="96"
|
||||
AcceptsReturn="True"
|
||||
AcceptsTab="True"
|
||||
TextWrapping="Wrap"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Top"
|
||||
CornerRadius="2"
|
||||
Watermark="{DynamicResource Text.Optional}"
|
||||
Text="{Binding Detail, Mode=TwoWay}"/>
|
||||
|
||||
<TextBlock Grid.Row="4" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Margin="0,6,8,0"
|
||||
Text="{DynamicResource Text.ConventionalCommit.BreakingChanges}"/>
|
||||
<TextBox Grid.Row="4" Grid.Column="1"
|
||||
Height="96"
|
||||
AcceptsReturn="True"
|
||||
AcceptsTab="True"
|
||||
TextWrapping="Wrap"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Top"
|
||||
CornerRadius="2"
|
||||
Watermark="{DynamicResource Text.Optional}"
|
||||
Text="{Binding BreakingChanges, Mode=TwoWay}"/>
|
||||
|
||||
<TextBlock Grid.Row="5" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Margin="0,6,8,0"
|
||||
Text="{DynamicResource Text.ConventionalCommit.ClosedIssue}"/>
|
||||
<TextBox Grid.Row="5" Grid.Column="1"
|
||||
Height="26"
|
||||
VerticalAlignment="Center"
|
||||
CornerRadius="2"
|
||||
Watermark="{DynamicResource Text.Optional}"
|
||||
Text="{Binding ClosedIssue, Mode=TwoWay}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Apply Button -->
|
||||
<Button Grid.Row="2"
|
||||
Classes="flat primary"
|
||||
Height="32" Width="80"
|
||||
Margin="0,8,0,16"
|
||||
HorizontalAlignment="Center"
|
||||
Content="{DynamicResource Text.Sure}"
|
||||
Click="OnApplyClicked"/>
|
||||
</Grid>
|
||||
</v:ChromelessWindow>
|
29
src/Views/ConventionalCommitMessageBuilder.axaml.cs
Normal file
29
src/Views/ConventionalCommitMessageBuilder.axaml.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class ConventionalCommitMessageBuilder : ChromelessWindow
|
||||
{
|
||||
public ConventionalCommitMessageBuilder()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void BeginMoveWindow(object _, PointerPressedEventArgs e)
|
||||
{
|
||||
BeginMoveDrag(e);
|
||||
}
|
||||
|
||||
private void OnApplyClicked(object _, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.ConventionalCommitMessageBuilder builder)
|
||||
{
|
||||
if (builder.Apply())
|
||||
Close();
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -67,17 +67,25 @@
|
|||
</ListBox.ItemsPanel>
|
||||
|
||||
<ListBoxItem>
|
||||
<Grid Classes="view_mode" ColumnDefinitions="32,*,Auto,Auto">
|
||||
<Grid Classes="view_mode" ColumnDefinitions="32,*,Auto,Auto,Auto">
|
||||
<Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.Histories}"/>
|
||||
<TextBlock Grid.Column="1" Classes="primary" Text="{DynamicResource Text.Histories}"/>
|
||||
<ToggleButton Grid.Column="2"
|
||||
Classes="layout_direction"
|
||||
Width="32" Height="26"
|
||||
Width="28" Height="26"
|
||||
IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=UseTwoColumnsLayoutInHistories, Mode=TwoWay}"
|
||||
ToolTip.Tip="{DynamicResource Text.Histories.DisplayMode}"/>
|
||||
<ToggleButton Grid.Column="3"
|
||||
Classes="line_path"
|
||||
Width="32" Height="26"
|
||||
Width="28" Height="26"
|
||||
Background="Transparent"
|
||||
IsChecked="{Binding EnableReflog, Mode=TwoWay}"
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.EnableReflog}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Reference}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Grid.Column="4"
|
||||
Classes="line_path"
|
||||
Width="28" Height="26"
|
||||
Background="Transparent"
|
||||
IsChecked="{Binding EnableFirstParentInHistories, Mode=TwoWay}"
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.FirstParentFilterToggle}">
|
||||
|
|
|
@ -185,7 +185,7 @@
|
|||
<v:CommitMessageTextBox Grid.Row="2" Text="{Binding CommitMessage, Mode=TwoWay}"/>
|
||||
|
||||
<!-- Commit Options -->
|
||||
<Grid Grid.Row="3" Margin="0,6,0,0" ColumnDefinitions="Auto,Auto,Auto,Auto,*,Auto,Auto,Auto,Auto">
|
||||
<Grid Grid.Row="3" Margin="0,6,0,0" ColumnDefinitions="Auto,Auto,Auto,Auto,Auto,*,Auto,Auto,Auto,Auto">
|
||||
<Button Grid.Column="0"
|
||||
Classes="icon_button"
|
||||
Margin="4,0,0,0" Padding="0"
|
||||
|
@ -198,7 +198,6 @@
|
|||
|
||||
<Button Grid.Column="1"
|
||||
Classes="icon_button"
|
||||
Width="32"
|
||||
Margin="4,2,0,0"
|
||||
Click="OnOpenAIAssist"
|
||||
ToolTip.Tip="{DynamicResource Text.AIAssistant.Tip}"
|
||||
|
@ -207,23 +206,33 @@
|
|||
<Path Width="15" Height="15" Data="{StaticResource Icons.AIAssist}"/>
|
||||
</Button>
|
||||
|
||||
<CheckBox Grid.Column="2"
|
||||
<Button Grid.Column="2"
|
||||
Classes="icon_button"
|
||||
Margin="0,2,0,0"
|
||||
Click="OnOpenConventionalCommitHelper"
|
||||
ToolTip.Tip="{DynamicResource Text.ConventionalCommit}"
|
||||
ToolTip.Placement="Top"
|
||||
ToolTip.VerticalOffset="0">
|
||||
<Path Width="15" Height="15" Data="{StaticResource Icons.CommitMessageGenerator}"/>
|
||||
</Button>
|
||||
|
||||
<CheckBox Grid.Column="3"
|
||||
Height="24"
|
||||
Margin="4,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
IsChecked="{Binding AutoStageBeforeCommit, Mode=TwoWay}"
|
||||
Content="{DynamicResource Text.WorkingCopy.AutoStage}"/>
|
||||
|
||||
<CheckBox Grid.Column="3"
|
||||
<CheckBox Grid.Column="4"
|
||||
Height="24"
|
||||
Margin="8,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
IsChecked="{Binding UseAmend, Mode=TwoWay}"
|
||||
Content="{DynamicResource Text.WorkingCopy.Amend}"/>
|
||||
|
||||
<v:LoadingIcon Grid.Column="5" Width="18" Height="18" IsVisible="{Binding IsCommitting}"/>
|
||||
<v:LoadingIcon Grid.Column="6" Width="18" Height="18" IsVisible="{Binding IsCommitting}"/>
|
||||
|
||||
<Button Grid.Column="6"
|
||||
<Button Grid.Column="7"
|
||||
Classes="flat primary"
|
||||
Content="{DynamicResource Text.WorkingCopy.Commit}"
|
||||
Height="28"
|
||||
|
@ -248,13 +257,13 @@
|
|||
</Button>
|
||||
|
||||
<!-- Invisible button just to add another hotkey `Ctrl+Shift+Enter` to commit with auto-stage -->
|
||||
<Button Grid.Column="7"
|
||||
<Button Grid.Column="8"
|
||||
Width="0" Height="0"
|
||||
Background="Transparent"
|
||||
Command="{Binding CommitWithAutoStage}"
|
||||
HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"/>
|
||||
|
||||
<Button Grid.Column="8"
|
||||
<Button Grid.Column="9"
|
||||
Classes="flat"
|
||||
Content="{DynamicResource Text.WorkingCopy.CommitAndPush}"
|
||||
Height="28"
|
||||
|
|
|
@ -144,5 +144,20 @@ namespace SourceGit.Views
|
|||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnOpenConventionalCommitHelper(object _, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.WorkingCopy vm)
|
||||
{
|
||||
var dialog = new ConventionalCommitMessageBuilder()
|
||||
{
|
||||
DataContext = new ViewModels.ConventionalCommitMessageBuilder(vm)
|
||||
};
|
||||
|
||||
App.OpenDialog(dialog);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue