From 67b6a6d9d55b1e0a90cbd2aeb3f557cbf5e88801 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 21 Oct 2024 15:31:13 +0800 Subject: [PATCH 0001/1283] refactor: using custom `PATH` instead of reading it from `zsh` (#581) * run `echo $PATH > ~/Library/Application\ Support/SourceGit/PATH` to generate to custom PATH file for SourceGit --- README.md | 1 + src/Commands/Command.cs | 4 ++++ src/Native/MacOS.cs | 28 +++------------------------- src/Native/OS.cs | 1 + 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index c2dee8c5..b0434ebe 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ For **macOS** users: * Make sure your mac trusts all software from anywhere. For more information, search `spctl --master-disable`. * Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your mac. * You may need to run `sudo xattr -cr /Applications/SourceGit.app` to make sure the software works. +* You man need to run `echo $PATH > ~/Library/Application\ Support/SourceGit/PATH` to introduce `PATH` env to SourceGit. For **Linux** users: diff --git a/src/Commands/Command.cs b/src/Commands/Command.cs index d774fa09..8d304410 100644 --- a/src/Commands/Command.cs +++ b/src/Commands/Command.cs @@ -195,6 +195,10 @@ namespace SourceGit.Commands if (OperatingSystem.IsLinux()) start.Environment.Add("LANG", "en_US.UTF-8"); + // Fix macOS `PATH` env + if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv)) + start.Environment.Add("PATH", Native.OS.CustomPathEnv); + // Force using this app as git editor. switch (Editor) { diff --git a/src/Native/MacOS.cs b/src/Native/MacOS.cs index 316e509c..9660920d 100644 --- a/src/Native/MacOS.cs +++ b/src/Native/MacOS.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Runtime.Versioning; -using System.Text; using Avalonia; @@ -19,30 +18,9 @@ namespace SourceGit.Native DisableDefaultApplicationMenuItems = true, }); - { - var startInfo = new ProcessStartInfo(); - startInfo.FileName = "zsh"; - startInfo.Arguments = "--login -c \"echo $PATH\""; - startInfo.UseShellExecute = false; - startInfo.CreateNoWindow = true; - startInfo.RedirectStandardOutput = true; - startInfo.StandardOutputEncoding = Encoding.UTF8; - - try - { - var proc = new Process() { StartInfo = startInfo }; - proc.Start(); - var pathData = proc.StandardOutput.ReadToEnd(); - proc.WaitForExit(); - if (proc.ExitCode == 0) - Environment.SetEnvironmentVariable("PATH", pathData); - proc.Close(); - } - catch - { - // Ignore error. - } - } + var customPathFile = Path.Combine(OS.DataDir, "PATH"); + if (File.Exists(customPathFile)) + OS.CustomPathEnv = File.ReadAllText(customPathFile).Trim(); } public string FindGitExecutable() diff --git a/src/Native/OS.cs b/src/Native/OS.cs index bc9c5403..b53f81d9 100644 --- a/src/Native/OS.cs +++ b/src/Native/OS.cs @@ -26,6 +26,7 @@ namespace SourceGit.Native public static string GitExecutable { get; set; } = string.Empty; public static string ShellOrTerminal { get; set; } = string.Empty; public static List ExternalTools { get; set; } = []; + public static string CustomPathEnv { get; set; } = string.Empty; static OS() { From bb6ceb03b9c9deb70c98cbc41837030db62acafb Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Mon, 21 Oct 2024 07:38:30 +0000 Subject: [PATCH 0002/1283] fix: Display all parents even if there are more then 2 (#583) --- src/Commands/QueryCommits.cs | 10 +--------- src/Commands/QueryCommitsWithFullMessage.cs | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/Commands/QueryCommits.cs b/src/Commands/QueryCommits.cs index 76894412..5875301e 100644 --- a/src/Commands/QueryCommits.cs +++ b/src/Commands/QueryCommits.cs @@ -112,15 +112,7 @@ namespace SourceGit.Commands if (data.Length < 8) return; - var idx = data.IndexOf(' ', StringComparison.Ordinal); - if (idx == -1) - { - _current.Parents.Add(data); - return; - } - - _current.Parents.Add(data.Substring(0, idx)); - _current.Parents.Add(data.Substring(idx + 1)); + _current.Parents.AddRange(data.Split(separator: ' ', options: StringSplitOptions.RemoveEmptyEntries)); } private void MarkFirstMerged() diff --git a/src/Commands/QueryCommitsWithFullMessage.cs b/src/Commands/QueryCommitsWithFullMessage.cs index 36e22b42..116cb3cd 100644 --- a/src/Commands/QueryCommitsWithFullMessage.cs +++ b/src/Commands/QueryCommitsWithFullMessage.cs @@ -73,15 +73,7 @@ namespace SourceGit.Commands if (data.Length < 8) return; - var idx = data.IndexOf(' ', StringComparison.Ordinal); - if (idx == -1) - { - _current.Commit.Parents.Add(data); - return; - } - - _current.Commit.Parents.Add(data.Substring(0, idx)); - _current.Commit.Parents.Add(data.Substring(idx + 1)); + _current.Commit.Parents.AddRange(data.Split(separator: ' ', options: StringSplitOptions.RemoveEmptyEntries)); } private List _commits = new List(); From 3804b0a828a75d35fa1199ad36f779a1cb612aea Mon Sep 17 00:00:00 2001 From: Antony David Date: Mon, 21 Oct 2024 09:41:31 +0200 Subject: [PATCH 0003/1283] fix(histories): handle commits with breaking changes (#584) --- src/Views/Histories.axaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index 1309206d..f8174c0c 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -308,7 +308,7 @@ namespace SourceGit.Views [GeneratedRegex(@"^\[[\w\s]+\]")] private static partial Regex REG_KEYWORD_FORMAT1(); - [GeneratedRegex(@"^\w+([\<\(][\w\s_\-\*,]+[\>\)])?\s?:\s")] + [GeneratedRegex(@"^\w+([\<\(][\w\s_\-\*,]+[\>\)])?\!?\s?:\s")] private static partial Regex REG_KEYWORD_FORMAT2(); private List _matches = null; From 00a2ec5abeeafbcda7563aa5fef939092a90cec4 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 21 Oct 2024 15:47:54 +0800 Subject: [PATCH 0004/1283] enhance: conventional commit message builder supports breaking changes prefix (#584) --- src/ViewModels/ConventionalCommitMessageBuilder.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ViewModels/ConventionalCommitMessageBuilder.cs b/src/ViewModels/ConventionalCommitMessageBuilder.cs index ab48bc30..731c48ae 100644 --- a/src/ViewModels/ConventionalCommitMessageBuilder.cs +++ b/src/ViewModels/ConventionalCommitMessageBuilder.cs @@ -68,12 +68,13 @@ namespace SourceGit.ViewModels { builder.Append("("); builder.Append(_scope); - builder.Append("): "); + builder.Append(")"); } - else - { + + if (string.IsNullOrEmpty(_breakingChanges)) builder.Append(": "); - } + else + builder.Append("!: "); builder.Append(_description); builder.Append("\n\n"); From 3b1a54dffddc3a72f3a67935ff80e57292f38298 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 21 Oct 2024 16:20:34 +0800 Subject: [PATCH 0005/1283] refactor: use `git update-ref $LOCAL_BRANCH $REMOTE_BRANCH` instead of `git fetch $REMOTE $LOCAL_BRANCH $REMOTE_BRANCH` to fast-forward local branch without checkout it first. --- src/Commands/Fetch.cs | 10 --------- src/Commands/UpdateRef.cs | 23 ++++++++++++++++++++ src/ViewModels/FastForwardWithoutCheckout.cs | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 src/Commands/UpdateRef.cs diff --git a/src/Commands/Fetch.cs b/src/Commands/Fetch.cs index 94b7fde9..17f08609 100644 --- a/src/Commands/Fetch.cs +++ b/src/Commands/Fetch.cs @@ -24,16 +24,6 @@ namespace SourceGit.Commands Args += remote; } - public Fetch(string repo, string remote, string localBranch, string remoteBranch, Action outputHandler) - { - _outputHandler = outputHandler; - WorkingDirectory = repo; - Context = repo; - TraitErrorAsOutput = true; - SSHKey = new Config(repo).Get($"remote.{remote}.sshkey"); - Args = $"fetch --progress --verbose {remote} {remoteBranch}:{localBranch}"; - } - protected override void OnReadline(string line) { _outputHandler?.Invoke(line); diff --git a/src/Commands/UpdateRef.cs b/src/Commands/UpdateRef.cs new file mode 100644 index 00000000..ba1b3d2f --- /dev/null +++ b/src/Commands/UpdateRef.cs @@ -0,0 +1,23 @@ +using System; + +namespace SourceGit.Commands +{ + public class UpdateRef : Command + { + public UpdateRef(string repo, string refName, string toRevision, Action outputHandler) + { + _outputHandler = outputHandler; + + WorkingDirectory = repo; + Context = repo; + Args = $"update-ref {refName} {toRevision}"; + } + + protected override void OnReadline(string line) + { + _outputHandler?.Invoke(line); + } + + private Action _outputHandler; + } +} diff --git a/src/ViewModels/FastForwardWithoutCheckout.cs b/src/ViewModels/FastForwardWithoutCheckout.cs index 3861046d..df4b4d73 100644 --- a/src/ViewModels/FastForwardWithoutCheckout.cs +++ b/src/ViewModels/FastForwardWithoutCheckout.cs @@ -31,7 +31,7 @@ namespace SourceGit.ViewModels return Task.Run(() => { - new Commands.Fetch(_repo.FullPath, To.Remote, Local.Name, To.Name, SetProgressDescription).Exec(); + new Commands.UpdateRef(_repo.FullPath, Local.FullName, To.FullName, SetProgressDescription).Exec(); CallUIThread(() => _repo.SetWatcherEnabled(true)); return true; }); From a5e783da086b09246d1cde8728025039525ce1a5 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 21 Oct 2024 16:39:57 +0800 Subject: [PATCH 0006/1283] enhance: disable `Fast-Forward` for worktree which is not current branch --- src/ViewModels/Repository.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index dcc40154..8fc56a38 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -1355,8 +1355,9 @@ namespace SourceGit.ViewModels }; menu.Items.Add(checkout); + var worktree = _worktrees.Find(x => x.Branch == branch.FullName); var upstream = _branches.Find(x => x.FullName == branch.Upstream); - if (upstream != null) + if (upstream != null && worktree == null) { var fastForward = new MenuItem(); fastForward.Header = new Views.NameHighlightedTextBlock("BranchCM.FastForward", upstream.FriendlyName); From 3296f90feb0b8819a56d17907757ec1d9c4450f0 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 21 Oct 2024 16:58:15 +0800 Subject: [PATCH 0007/1283] enhance: only show two chars when they are all ascii letters or digits (#585) --- src/Views/Avatar.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Views/Avatar.cs b/src/Views/Avatar.cs index 71ed204d..c959fa43 100644 --- a/src/Views/Avatar.cs +++ b/src/Views/Avatar.cs @@ -128,10 +128,9 @@ namespace SourceGit.Views foreach (var part in parts) chars.Add(part[0]); - if (chars.Count >= 2) + if (chars.Count >= 2 && char.IsAsciiLetterOrDigit(chars[0]) && char.IsAsciiLetterOrDigit(chars[^1])) return string.Format("{0}{1}", chars[0], chars[^1]); - if (chars.Count == 1) - return string.Format("{0}", chars[0]); + return name.Substring(0, 1); } From bb45a5af8ea68b2e3981e0a67fa9b7ce4356d0ca Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 21 Oct 2024 17:07:56 +0800 Subject: [PATCH 0008/1283] enhance: use `\S` instead of `\w` to supports emoji character --- src/Views/Histories.axaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index f8174c0c..137fd298 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -308,7 +308,7 @@ namespace SourceGit.Views [GeneratedRegex(@"^\[[\w\s]+\]")] private static partial Regex REG_KEYWORD_FORMAT1(); - [GeneratedRegex(@"^\w+([\<\(][\w\s_\-\*,]+[\>\)])?\!?\s?:\s")] + [GeneratedRegex(@"^\S+([\<\(][\w\s_\-\*,]+[\>\)])?\!?\s?:\s")] private static partial Regex REG_KEYWORD_FORMAT2(); private List _matches = null; From 31e7bef01dc4fecfe5a699fef6624e2d6203a5ab Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 21 Oct 2024 20:28:39 +0800 Subject: [PATCH 0009/1283] docs: typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0434ebe..02881ce5 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ For **macOS** users: * Make sure your mac trusts all software from anywhere. For more information, search `spctl --master-disable`. * Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your mac. * You may need to run `sudo xattr -cr /Applications/SourceGit.app` to make sure the software works. -* You man need to run `echo $PATH > ~/Library/Application\ Support/SourceGit/PATH` to introduce `PATH` env to SourceGit. +* You can run `echo $PATH > ~/Library/Application\ Support/SourceGit/PATH` to generate a custom PATH env file to introduce `PATH` env to SourceGit. For **Linux** users: From 6dac26d52555597b854bb53529b4296ff9e12c96 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 22 Oct 2024 09:29:49 +0800 Subject: [PATCH 0010/1283] refactor: since there is a hotkey to stage and commit, remove the unsafe auto-stage configure --- src/Models/RepositorySettings.cs | 6 ------ src/Resources/Locales/de_DE.axaml | 1 - src/Resources/Locales/en_US.axaml | 1 - src/Resources/Locales/fr_FR.axaml | 1 - src/Resources/Locales/pt_BR.axaml | 1 - src/Resources/Locales/ru_RU.axaml | 1 - src/Resources/Locales/zh_CN.axaml | 1 - src/Resources/Locales/zh_TW.axaml | 1 - src/ViewModels/WorkingCopy.cs | 10 ++-------- src/Views/WorkingCopy.axaml | 17 +++++------------ 10 files changed, 7 insertions(+), 33 deletions(-) diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs index f2fd1bc6..c48e3c0c 100644 --- a/src/Models/RepositorySettings.cs +++ b/src/Models/RepositorySettings.cs @@ -70,12 +70,6 @@ namespace SourceGit.Models set; } = true; - public bool AutoStageBeforeCommit - { - get; - set; - } = false; - public AvaloniaList Filters { get; diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 7cc9fd63..f5a6c91c 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -622,7 +622,6 @@ Ignoriere Dateien im selben Ordner Ignoriere nur diese Datei Amend - Auto-Stage Du kannst diese Datei jetzt stagen. COMMIT COMMIT & PUSH diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index bfb0ace4..2a475acd 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -631,7 +631,6 @@ Ignore files in the same folder Ignore this file only Amend - Auto-Stage You can stage this file now. COMMIT COMMIT & PUSH diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 8e56248d..631750dd 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -582,7 +582,6 @@ Ignorer les fichiers dans le même dossier N'ignorer que ce fichier Amender - Auto-Index Vous pouvez indexer ce fichier. COMMIT COMMIT & PUSH diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index 8a970730..362e81f1 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -575,7 +575,6 @@ Ignorar arquivos na mesma pasta Ignorar apenas este arquivo Corrigir - Auto-Stage Você pode stagear este arquivo agora. COMMIT COMMIT & PUSH diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 23ec125f..e331ac31 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -634,7 +634,6 @@ Игнорировать файлы в том же каталоге Игнорировать только эти файлы Изменить - Автоподготовка Теперь вы можете подготовитть этот файл. ЗАФИКСИРОВАТЬ ЗАФИКСИРОВАТЬ и ОТПРАВИТЬ diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 919e4093..e8346fa3 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -629,7 +629,6 @@ 忽略同目录下所有文件 忽略本文件 修补(--amend) - 自动暂存 现在您已可将其加入暂存区中 提交 提交并推送 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index bccf4aab..fb6489cf 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -634,7 +634,6 @@ 忽略同路徑下所有檔案 忽略本檔案 修補 (--amend) - 自動暫存 現在您已可將其加入暫存區中 提 交 提交並推送 diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index 70b4f11f..209da812 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -79,12 +79,6 @@ namespace SourceGit.ViewModels private set => SetProperty(ref _isCommitting, value); } - public bool AutoStageBeforeCommit - { - get => _repo.Settings.AutoStageBeforeCommit; - set => _repo.Settings.AutoStageBeforeCommit = value; - } - public bool UseAmend { get => _useAmend; @@ -416,7 +410,7 @@ namespace SourceGit.ViewModels public void Commit() { - DoCommit(AutoStageBeforeCommit, false); + DoCommit(false, false); } public void CommitWithAutoStage() @@ -426,7 +420,7 @@ namespace SourceGit.ViewModels public void CommitWithPush() { - DoCommit(AutoStageBeforeCommit, true); + DoCommit(false, true); } public ContextMenu CreateContextMenuForUnstagedChanges() diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index 1b289e9e..3333cda1 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -185,7 +185,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Views/Preference.axaml.cs b/src/Views/Preference.axaml.cs index 2f08e0db..f7cabec1 100644 --- a/src/Views/Preference.axaml.cs +++ b/src/Views/Preference.axaml.cs @@ -74,6 +74,15 @@ namespace SourceGit.Views set; } + public static readonly StyledProperty SelectedOpenAIServiceProperty = + AvaloniaProperty.Register(nameof(SelectedOpenAIService)); + + public Models.OpenAIService SelectedOpenAIService + { + get => GetValue(SelectedOpenAIServiceProperty); + set => SetValue(SelectedOpenAIServiceProperty, value); + } + public Preference() { var pref = ViewModels.Preference.Instance; @@ -312,5 +321,24 @@ namespace SourceGit.Views e.Handled = true; } + + private void OnAddOpenAIService(object sender, RoutedEventArgs e) + { + var service = new Models.OpenAIService() { Name = "Unnamed Service" }; + ViewModels.Preference.Instance.OpenAIServices.Add(service); + SelectedOpenAIService = service; + + e.Handled = true; + } + + private void OnRemoveSelectedOpenAIService(object sender, RoutedEventArgs e) + { + if (SelectedOpenAIService == null) + return; + + ViewModels.Preference.Instance.OpenAIServices.Remove(SelectedOpenAIService); + SelectedOpenAIService = null; + e.Handled = true; + } } } diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index 3d080fc6..9fab9927 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -199,7 +199,7 @@ @@ -105,7 +121,7 @@ VerticalAlignment="Center" UseGraphColor="False"/> - + SetValue(MessageProperty, value); } + public static readonly StyledProperty SignInfoProperty = + AvaloniaProperty.Register(nameof(SignInfo)); + + public Models.CommitSignInfo SignInfo + { + get => GetValue(SignInfoProperty); + set => SetValue(SignInfoProperty, value); + } + public static readonly StyledProperty SupportsContainsInProperty = AvaloniaProperty.Register(nameof(SupportsContainsIn)); diff --git a/src/Views/CommitDetail.axaml b/src/Views/CommitDetail.axaml index 8307d650..cb99b3d9 100644 --- a/src/Views/CommitDetail.axaml +++ b/src/Views/CommitDetail.axaml @@ -21,6 +21,7 @@ From 8f68e966070253adf3ad79d93bd99a265180b99c Mon Sep 17 00:00:00 2001 From: AquariusStar <48148723+AquariusStar@users.noreply.github.com> Date: Wed, 30 Oct 2024 04:33:10 +0300 Subject: [PATCH 0068/1283] loacaliztion: update translate (#624) --- src/Resources/Locales/ru_RU.axaml | 58 +++++++++++++++++-------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 1a63ae61..33237603 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -16,7 +16,7 @@ Существующую ветку Создать новую ветку Расположение: - Путь к этому рабочему дереву. Поддерживается относительный путью + Путь к этому рабочему дереву. Поддерживается относительный путь. Имя ветки: Необязательно. По умолчанию используется имя целевой папки. Отслеживание ветки: @@ -27,7 +27,7 @@ Ошибка Выдает ошибки и отказывается применять исправление Все ошибки - Аналогично "ошибке", но показывает больше + Аналогично «ошибке», но показывает больше Файл исправлений: Выберите файл .patch для применения Игнорировать изменения пробелов @@ -58,6 +58,7 @@ Удалить выбранные {0} ветки Отклонить все изменения. Перемотать вперёд к ${0}$ + Извлечь ${0}$ в ${1}$... Поток Git - Завершение ${0}$ Слить ${0}$ в ${1}$... Забрать ${0}$ @@ -72,6 +73,7 @@ ОТМЕНА Сбросить эту ревизию Сбросить родительскую ревизию + Произвести сообщение о фиксации ИЗМЕНИТЬ РЕЖИМ ОТОБРАЖЕНИЯ Показывать в виде списка файлов и каталогов Показывать в виде списка путей @@ -115,8 +117,8 @@ Вернуть фиксацию Переформулировать Сохранить как исправление... - Уплотнить в родительскую - Уплотнить дочерную фиксацию сюда + Втиснуть в родительскую + Втиснуть дочерную фиксацию сюда ИЗМЕНЕНИЯ Найти изменения.... ФАЙЛЫ @@ -157,6 +159,9 @@ Имя правила: Адрес результата: Пожалуйста, используйте $1, $2 для доступа к значениям групп регулярных выражений. + ОТКРЫТЬ ИИ + Предпочитаемый сервис: + Если «Предпочитаемый сервис» установлен, SourceGit будет использовать только этот хранилище. В противном случае, если доступно более одной услуги, будет отображено контекстное меню для выбора одной из них. HTTP-прокси HTTP-прокси, используемый этим хранилищем Имя пользовтаеля @@ -306,7 +311,7 @@ Добавить шаблон отслеживания в ХБФ Git Извлечь Извлечь объекты ХБФ - Запустить `git lfs fetch", чтобы загрузить объекты ХБФ Git. При этом рабочая копия не обновляется. + Запустить «git lfs fetch», чтобы загрузить объекты ХБФ Git. При этом рабочая копия не обновляется. Установить перехват ХБФ Git Показывать блокировки Нет заблокированных файлов @@ -316,15 +321,15 @@ Разблокировать Принудительно разблокировать Обрезать - Запустите `git lfs prune", чтобы удалить старые файлы ХБФ из локального хранилища + Запустить «git lfs prune», чтобы удалить старые файлы ХБФ из локального хранилища Забрать Забрать объекты ХБФ - Запустите `git lfs pull", чтобы загрузить все файлы ХБФ Git для текущей ссылки и проверить + Запустить «git lfs pull», чтобы загрузить все файлы ХБФ Git для текущей ссылки и проверить Выложить Выложить объекты ХБФ Отправляйте большие файлы, помещенные в очередь, в конечную точку ХБФ Git Внешнее хранилище: - Отслеживать файлы с именем '{0}' + Отслеживать файлы с именем «{0}» Отслеживать все *{0} файлов Истории Переключение горизонтального/вертикального расположения @@ -334,7 +339,7 @@ SHA ВРЕМЯ ФИКСАЦИИ ВЫБРАННЫЕ {0} ФИКСАЦИИ - Удерживайте 'Ctrl' или 'Shift', чтобы выбрать несколько фиксаций. + Удерживайте Ctrl или Shift, чтобы выбрать несколько фиксаций. Удерживайте ⌘ или ⇧, чтобы выбрать несколько фиксаций. ПОДСКАЗКИ: Ссылка на сочетания клавиш @@ -354,9 +359,9 @@ Принудительно перезагрузить этот хранилище Подготовленные/Неподготовленные выбранные изменения Режим поиска фиксаций - Переключить на 'Изменения' - Переключить на 'Истории' - Переключить на 'Отложенные' + Переключить на «Изменения» + Переключить на «Истории» + Переключить на «Отложенные» ТЕКСТОВЫЙ РЕДАКТОР Закрыть панель поиска Найти следующее совпадение @@ -367,10 +372,10 @@ Отклонить Инициализировать хранилище Путь: - Выполняется частичный забор. Нажмите 'Отказ' для восстановления заголовка. - Выполняет запрос слияния. Нажмите 'Отказ' для восстановления заголовка. - Выполняется перенос. Нажмите 'Отказ' для восстановления заголовка. - Выполняется возврат. Нажмите 'Отказ' для восстановления заголовка. + Выполняется частичный забор. Нажмите «Отказ» для восстановления заголовка. + Выполняет запрос слияния. Нажмите «Отказ» для восстановления заголовка. + Выполняется перенос. Нажмите «Отказ» для восстановления заголовка. + Выполняется возврат. Нажмите «Отказ» для восстановления заголовка. Интерактивное перемещение Целевая ветка: На: @@ -408,7 +413,7 @@ ОТКРЫТЬ ИИ Ключ API Запрос на анализ различий - Сгенерировать запрос на тему + Произвести запрос на тему Модель Имя: Сервер @@ -456,7 +461,7 @@ Удалить внешнее хранилище Цель: Удалить рабочее дерево - Информация об обрезке рабочего дерева в `$GIT_DIR/worktrees` + Информация об обрезке рабочего дерева в «$GIT_DIR/worktrees» Забрать Ветка: Извлечь все ветки @@ -501,7 +506,7 @@ Открыть в браузере Удалить Подтвердить удаление рабочего дерева - Включить опцию `--force` + Включить опцию --force Цель: Переименовать ветку Новое имя: @@ -510,17 +515,17 @@ Отказ Автоматическое извлечение изменений с внешних хранилищ... Очистить (Сбор мусора и удаление) - Запустить команду `git gc` для данного хранилища. + Запустить команду «git gc» для данного хранилища. Очистить всё Настройка этого хранилища ПРОДОЛЖИТЬ - Разрешить опцию '--reflog' + Разрешить опцию --reflog Открыть в файловом менеджере Поиск веток, меток и подмодулей - ОТФИЛЬТРОВАНО ОТ: + ОТФИЛЬТРОВАНО: ЛОКАЛЬНЫЕ ВЕТКИ Навигация по заголовку - Включить опцию '--first-parent' + Включить опцию --first-parent Создать ветку Открыть в {0} Открыть в расширенном инструменте @@ -550,12 +555,12 @@ Режим сброса: Переместить в: Текущая ветка: - Раскрыть в файловом менеджере + Открыть в файловом менеджере Отменить фиксацию Фиксация: Отмена изменений фиксации Переформулировать сообщение фиксации - Использовать "Shift+Enter" для ввода новой строки. "Enter" - это горячая клавиша кнопки OK + Использовать «Shift+Enter» для ввода новой строки. «Enter» - это горячая клавиша кнопки OK Запуск. Подождите пожалуйста... СОХРАНИТЬ Сохранить как... @@ -569,7 +574,7 @@ Пропустить эту версию Обновление ПО В настоящее время обновления недоступны. - Уплотнить фиксации + Втиснуть фиксации В: Частный ключ SSH: Путь хранения частного ключа SSH @@ -578,6 +583,7 @@ ЗАПУСК Отложить Включить неотслеживаемые файлы + Хранить отложенные файлы Сообщение: Необязательно. Имя этого тайника Отложить локальные изменения From 30e0e84b63951d9d86f4e333a78dd3805a41bd77 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 30 Oct 2024 01:33:23 +0000 Subject: [PATCH 0069/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a87f4732..3caa8dac 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.06%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-89.55%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-92.69%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.10%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.06%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-89.55%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-92.69%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index ff5c8801..e5c43b3e 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -157,18 +157,13 @@ -### ru_RU.axaml: 99.10% +### ru_RU.axaml: 100.00%
Missing Keys -- Text.BranchCM.FetchInto -- Text.ChangeCM.GenerateCommitMessage -- Text.Configure.OpenAI -- Text.Configure.OpenAI.Prefered -- Text.Configure.OpenAI.Prefered.Tip -- Text.Stash.KeepIndex +
From ca5f2f92ba2b0cf4f0f5aa1864d3664b6d91856f Mon Sep 17 00:00:00 2001 From: jmmanzano Date: Wed, 30 Oct 2024 02:43:10 +0100 Subject: [PATCH 0070/1283] localization: added es_ES.axaml (#623) localization: added es_ES.axaml --- src/App.axaml | 1 + src/Models/Locales.cs | 1 + src/Resources/Locales/es_ES.axaml | 667 ++++++++++++++++++++++++++++++ 3 files changed, 669 insertions(+) create mode 100644 src/Resources/Locales/es_ES.axaml diff --git a/src/App.axaml b/src/App.axaml index b1fe303b..fc55776e 100644 --- a/src/App.axaml +++ b/src/App.axaml @@ -18,6 +18,7 @@ + diff --git a/src/Models/Locales.cs b/src/Models/Locales.cs index 0d9e5f69..3fa9ab7c 100644 --- a/src/Models/Locales.cs +++ b/src/Models/Locales.cs @@ -15,6 +15,7 @@ namespace SourceGit.Models new Locale("Русский", "ru_RU"), new Locale("简体中文", "zh_CN"), new Locale("繁體中文", "zh_TW"), + new Locale("Español", "es_ES"), }; public Locale(string name, string key) diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml new file mode 100644 index 00000000..e9c7733d --- /dev/null +++ b/src/Resources/Locales/es_ES.axaml @@ -0,0 +1,667 @@ + + Acerca de + Acerca de SourceGit + • Construido con + • El gráfico es renderizado por + © 2024 sourcegit-scm + • Editor de texto de + • Las fuentes monoespaciadas provienen de + • El código fuente se puede encontrar en + Cliente Git GUI de código abierto y gratuito + Agregar Worktree + Qué Checkout: + Rama Existente + Crear Nueva Rama + Ubicación: + Ruta para este worktree. Se admite ruta relativa. + Nombre de la Rama: + Opcional. Por defecto es el nombre de la carpeta de destino. + Rama de Seguimiento: + Seguimiento de rama remota + Asistente OpenAI + Usar OpenAI para generar mensaje de commit + Aplicar Patch + Error + Genera errores y se niega a aplicar el patch + Error Todo + Similar a 'error', pero muestra más + Archivo Patch: + Seleccionar archivo .patch para aplicar + Ignorar cambios de espacios en blanco + Sin Advertencia + Desactiva la advertencia de espacios en blanco al final + Aplicar Patch + Advertencia + Genera advertencias para algunos de estos errores, pero aplica + Espacios en Blanco: + Archivar... + Guardar Archivo en: + Seleccionar ruta del archivo + Revisión: + Archivar + SourceGit Askpass + ARCHIVOS ASUMIDOS COMO SIN CAMBIOS + NO HAY ARCHIVOS ASUMIDOS COMO SIN CAMBIOS + REMOVER + ¡ARCHIVO BINARIO NO SOPORTADO! + Blame + ¡BLAME EN ESTE ARCHIVO NO SOPORTADO! + Checkout ${0}$... + Comparar con Rama + Comparar con HEAD + Comparar con Worktree + Copiar Nombre de Rama + Eliminar ${0}$... + Eliminar {0} ramas seleccionadas + Descartar todos los cambios + Fast-Forward a ${0}$ + Fetch ${0}$ en ${1}$... + Git Flow - Finalizar ${0}$ + Merge ${0}$ en ${1}$... + Pull ${0}$ + Pull ${0}$ en ${1}$... + Push ${0}$ + Rebase ${0}$ en ${1}$... + Renombrar ${0}$... + Establecer Rama de Seguimiento + Desestablecer Upstream + Comparar Ramas + Bytes + CANCELAR + Resetear a Esta Revisión + Resetear a Revisión Padre + CAMBIAR MODO DE VISUALIZACIÓN + Mostrar como Lista de Archivos y Directorios + Mostrar como Lista de Rutas + Mostrar como Árbol de Sistema de Archivos + Checkout Rama + Checkout Commit + Advertencia: Al hacer un checkout de commit, tu Head se separará + Commit: + Rama: + Cambios Locales: + Descartar + No Hacer Nada + Stash & Reaplicar + Cherry Pick + Añadir fuente al mensaje de commit + Commit(s): + Commit todos los cambios + Mainline: + Normalmente no puedes cherry-pick un merge porque no sabes qué lado del merge debe considerarse la línea principal. Esta opción permite que cherry-pick reproduzca el cambio en relación con el padre especificado. + Limpiar Stashes + Estás intentando limpiar todos los stashes. ¿Estás seguro de continuar? + Clonar Repositorio Remoto + Parámetros Adicionales: + Argumentos adicionales para clonar el repositorio. Opcional. + Nombre Local: + Nombre del repositorio. Opcional. + Carpeta Padre: + URL del Repositorio: + CERRAR + Editor + Cherry-Pick Este Commit + Cherry-Pick ... + Checkout Commit + Comparar con HEAD + Comparar con Worktree + Copiar Información + Copiar SHA + Rebase Interactivo ${0}$ hasta Aquí + Rebase ${0}$ hasta Aquí + Reset ${0}$ hasta Aquí + Revertir Commit + Reescribir + Guardar como Patch... + Squash en Parent + Squash Commits Hijos hasta Aquí + CAMBIOS + Buscar Cambios... + ARCHIVOS + Archivo LFS + Submódulo + INFORMACIÓN + AUTOR + CAMBIADO + COMMITTER + Ver refs que contienen este commit + COMMIT ESTÁ CONTENIDO EN + Muestra solo los primeros 100 cambios. Ver todos los cambios en la pestaña CAMBIOS. + MENSAJE + PADRES + REFS + SHA + Abrir en Navegador + Introducir asunto del commit + Descripción + Configurar Repositorio + PLANTILLA DE COMMIT + Nombre de la Plantilla: + Contenido de la Plantilla: + Dirección de Email + Dirección de email + GIT + Fetch remotos automáticamente + Minuto(s) + Remoto por Defecto + Habilitar --signoff para commit + SEGUIMIENTO DE INCIDENCIAS + Añadir Regla de Ejemplo para Github + Añadir Regla de Ejemplo para Jira + Añadir Regla de Ejemplo para Incidencias de GitLab + Añadir Regla de Ejemplo para Merge Requests de GitLab + Nueva Regla + Expresión Regex para Incidencias: + Nombre de la Regla: + URL Resultante: + Por favor, use $1, $2 para acceder a los valores de los grupos regex. + Proxy HTTP + Proxy HTTP utilizado por este repositorio + Nombre de Usuario + Nombre de usuario para este repositorio + Espacios de Trabajo + Color + Restaurar pestañas al iniciar + Asistente de Commit Convencional + Cambio Importante: + Incidencia Cerrada: + Detalles del Cambio: + Alcance: + Descripción Corta: + Tipo de Cambio: + Copiar + Copiar Todo el Texto + COPIAR MENSAJE + Copiar Ruta + Copiar Nombre del Archivo + Crear Rama... + Basado En: + Checkout de la rama creada + Cambios Locales: + Descartar + No Hacer Nada + Stash & Reaplicar + Nombre de la Nueva Rama: + Introduzca el nombre de la rama. + Crear Rama Local + Crear Etiqueta... + Nueva Etiqueta En: + Firma GPG + Mensaje de la Etiqueta: + Opcional. + Nombre de la Etiqueta: + Formato recomendado: v1.0.0-alpha + Push a todos los remotos después de crear + Crear Nueva Etiqueta + Tipo: + anotada + ligera + Mantenga Ctrl para iniciar directamente + Cortar + Eliminar Rama + Rama: + ¡Estás a punto de eliminar una rama remota! + También eliminar la rama remota ${0}$ + Eliminar Múltiples Ramas + Estás intentando eliminar múltiples ramas a la vez. ¡Asegúrate de revisar antes de tomar acción! + Eliminar Remoto + Remoto: + Destino: + Confirmar Eliminación de Grupo + Confirmar Eliminación de Repositorio + Eliminar Submódulo + Ruta del Submódulo: + Eliminar Etiqueta + Etiqueta: + Eliminar de los repositorios remotos + DIFERENCIA BINARIA + NUEVO + ANTIGUO + Copiar + Modo de Archivo Cambiado + Ignorar Cambio de Espacios en Blanco + CAMBIO DE OBJETO LFS + Siguiente Diferencia + SIN CAMBIOS O SOLO CAMBIOS DE EOL + Diferencia Anterior + Mostrar símbolos ocultos + Diferencia Lado a Lado + SUBMÓDULO + NUEVO + Intercambiar + Resaltado de Sintaxis + Ajuste de Línea + Abrir en Herramienta de Merge + Disminuir Número de Líneas Visibles + Aumentar Número de Líneas Visibles + SELECCIONA ARCHIVO PARA VER CAMBIOS + Abrir en Herramienta de Merge + Descartar Cambios + Todos los cambios locales en la copia de trabajo. + Cambios: + Incluir archivos ignorados + Total {0} cambios serán descartados + ¡No puedes deshacer esta acción! + Marcador: + Nuevo Nombre: + Destino: + Editar Grupo Seleccionado + Editar Repositorio Seleccionado + Fast-Forward (sin checkout) + Fetch + Fetch todos los remotos + Fetch sin etiquetas + Remoto: + Fetch Cambios Remotos + Asumir sin cambios + Descartar... + Descartar {0} archivos... + Descartar Cambios en Línea(s) Seleccionada(s) + Abrir Herramienta de Merge Externa + Guardar Como Patch... + Stage + Stage {0} archivos + Stage Cambios en Línea(s) Seleccionada(s) + Stash... + Stash {0} archivos... + Unstage + Unstage {0} archivos + Unstage Cambios en Línea(s) Seleccionada(s) + Usar Suyos (checkout --theirs) + Usar Míos (checkout --ours) + Historial de Archivos + CONTENIDO + CAMBIO + FILTRO + Git-Flow + Rama de Desarrollo: + Feature: + Prefijo de Feature: + FLOW - Finalizar Feature + FLOW - Finalizar Hotfix + FLOW - Finalizar Release + Destino: + Hotfix: + Prefijo de Hotfix: + Inicializar Git-Flow + Mantener rama + Rama de Producción: + Release: + Prefijo de Release: + Iniciar Feature... + FLOW - Iniciar Feature + Iniciar Hotfix... + FLOW - Iniciar Hotfix + Introducir nombre + Iniciar Release... + FLOW - Iniciar Release + Prefijo de Etiqueta de Versión: + Git LFS + Añadir Patrón de Seguimiento... + El patrón es el nombre del archivo + Patrón Personalizado: + Añadir Patrón de Seguimiento a Git LFS + Fetch + Fetch Objetos LFS + Ejecuta `git lfs fetch` para descargar objetos Git LFS. Esto no actualiza la copia de trabajo. + Instalar hooks de Git LFS + Mostrar Bloqueos + No hay archivos bloqueados + Bloquear + Mostrar solo mis bloqueos + Bloqueos LFS + Desbloquear + Forzar Desbloqueo + Prune + Ejecuta `git lfs prune` para eliminar archivos LFS antiguos del almacenamiento local + Pull + Pull Objetos LFS + Ejecuta `git lfs pull` para descargar todos los archivos Git LFS para la referencia actual y hacer checkout + Push + Push Objetos LFS + Push archivos grandes en cola al endpoint de Git LFS + Remoto: + Seguir archivos llamados '{0}' + Seguir todos los archivos *{0} + Historias + Cambiar a Disposición Horizontal/Vertical + AUTOR + HORA DEL AUTOR + GRÁFICO & ASUNTO + SHA + FECHA DE COMMIT + {0} COMMITS SELECCIONADOS + Mantén 'Ctrl' o 'Shift' para seleccionar múltiples commits. + Mantén ⌘ o ⇧ para seleccionar múltiples commits. + CONSEJOS: + Referencia de Atajos de Teclado + GLOBAL + Cancelar popup actual + Cerrar página actual + Ir a la página anterior + Ir a la siguiente página + Crear nueva página + Abrir diálogo de preferencias + REPOSITORIO + Commit cambios staged + Commit y push cambios staged + Stage todos los cambios y commit + Descartar cambios seleccionados + Modo Dashboard (Por Defecto) + Forzar a recargar este repositorio + Stage/Unstage cambios seleccionados + Modo de búsqueda de commits + Cambiar a 'Cambios' + Cambiar a 'Historias' + Cambiar a 'Stashes' + EDITOR DE TEXTO + Cerrar panel de búsqueda + Buscar siguiente coincidencia + Buscar coincidencia anterior + Abrir panel de búsqueda + Stage + Unstage + Descartar + Inicializar Repositorio + Ruta: + Cherry-Pick en progreso. Presiona 'Abort' para restaurar el HEAD original. + Merge en progreso. Presiona 'Abort' para restaurar el HEAD original. + Rebase en progreso. Presiona 'Abort' para restaurar el HEAD original. + Revert en progreso. Presiona 'Abort' para restaurar el HEAD original. + Rebase Interactivo + Rama Objetivo: + En: + ERROR + AVISO + Merge Rama + En: + Opción de Merge: + Rama Fuente: + Mover Nodo del Repositorio + Seleccionar nodo padre para: + Nombre: + Git NO ha sido configurado. Por favor, ve a [Preferencias] y configúralo primero. + Abrir Directorio de Datos de la App + Abrir Con... + Opcional. + Crear Nueva Página + Marcador + Cerrar Pestaña + Cerrar Otras Pestañas + Cerrar Pestañas a la Derecha + Copiar Ruta del Repositorio + Repositorios + Pegar + Justo ahora + Hace {0} minutos + Hace {0} horas + Ayer + Hace {0} días + Último mes + Hace {0} meses + Último año + Hace {0} años + Preferencias + Opciones Avanzadas + OPEN AI + Analizar Diff Prompt + Clave API + Generar Subject Prompt + Modelo + Servidor + APARIENCIA + Fuente por defecto + Tamaño de fuente por defecto + Fuente Monospace + Usar solo fuente monospace en el editor de texto + Tema + Sobreescritura de temas + Usar ancho de pestaña fijo en la barra de título + Usar marco de ventana nativo + HERRAMIENTA DIFF/MERGE + Ruta de instalación + Introducir ruta para la herramienta diff/merge + Herramienta + GENERAL + Buscar actualizaciones al iniciar + Idioma + Commits en el historial + Mostrar hora del autor en lugar de la hora del commit en el gráfico + Longitud de la guía del asunto + GIT + Habilitar Auto CRLF + Directorio de clonado por defecto + Email de usuario + Email global del usuario git + Ruta de instalación + Nombre de usuario + Nombre global del usuario git + Versión de Git + Se requiere Git (>= 2.23.0) para esta aplicación + FIRMA GPG + Firma GPG en commit + Firma GPG en etiqueta + Formato GPG + Ruta de instalación del programa + Introducir ruta para el programa gpg instalado + Clave de firma del usuario + Clave de firma gpg del usuario + INTEGRACIÓN + SHELL/TERMINAL + Shell/Terminal + Ruta + Podar Remoto + Destino: + Podar Worktrees + Podar información de worktree en `$GIT_DIR/worktrees` + Pull + Rama: + Fetch todas las ramas + En: + Cambios Locales: + Descartar + No Hacer Nada + Stash & Reaplicar + Fetch sin etiquetas + Remoto: + Pull (Fetch & Merge) + Usar rebase en lugar de merge + Push + Asegurarse de que los submódulos se hayan hecho push + Forzar push + Rama Local: + Remoto: + Push Cambios al Remoto + Rama Remota: + Establecer como rama de seguimiento + Push todas las etiquetas + Push Etiqueta al Remoto + Push a todos los remotos + Remoto: + Etiqueta: + Salir + Rebase Rama Actual + Stash & reaplicar cambios locales + En: + Rebase: + Refrescar + Añadir Remoto + Editar Remoto + Nombre: + Nombre remoto + URL del Repositorio: + URL del repositorio git remoto + Copiar URL + Borrar... + Editar... + Fetch + Abrir En Navegador + Podar (Prune) + Confirmar para Eliminar Worktree + Utilizar Opción `--force` + Destino: + Renombrar Rama + Nuevo Nombre: + Nombre único para esta rama + Rama: + ABORTAR + Auto fetching cambios desde remotos... + Limpiar (GC & Prune) + Ejecutar comando `git gc` para este repositorio. + Limpiar todo + Configurar este repositorio + CONTINUAR + Habilitar Opción '--reflog' + Abrir en el Explorador + Buscar Ramas/Etiquetas/Submódulos + FILTRAR POR: + RAMAS LOCALES + Navegar a HEAD + Habilitar Opción '--first-parent' + Crear Rama + Abrir en {0} + Abrir en Herramientas Externas + Refrescar + REMOTOS + AÑADIR REMOTO + RESOLVER + Buscar Commit + Archivo + Mensaje + SHA + Autor & Committer + Rama Actual + Mostrar Etiquetas como Árbol + Estadísticas + SUBMÓDULOS + AÑADIR SUBMÓDULO + ACTUALIZAR SUBMÓDULO + ETIQUETAS + NUEVA ETIQUETA + Abrir en Terminal + WORKTREES + AÑADIR WORKTREE + PRUNE + URL del Repositorio Git + Resetear Rama Actual a Revisión + Modo de Reset: + Mover a: + Rama Actual: + Revelar en el Explorador de Archivos + Revertir Commit + Commit: + Commit revertir cambios + Reescribir Mensaje de Commit + Usa 'Shift+Enter' para introducir una nueva línea. 'Enter' es el atajo del botón OK + Ejecutando. Por favor espera... + GUARDAR + Guardar Como... + ¡El patch se ha guardado exitosamente! + Escanear Repositorios + Directorio Raíz: + Buscar Actualizaciones... + Nueva versión de este software disponible: + ¡Error al buscar actualizaciones! + Descargar + Omitir Esta Versión + Actualización de Software + Actualmente no hay actualizaciones disponibles. + Squash Commits + En: + Clave Privada SSH: + Ruta de almacenamiento de la clave privada SSH + INICIAR + Stash + Incluir archivos no rastreados + Mensaje: + Opcional. Nombre de este stash + Solo cambios staged + ¡Tanto los cambios staged como los no staged de los archivos seleccionados serán stashed! + Stash Cambios Locales + Aplicar + Eliminar + Pop + Eliminar Stash + Eliminar: + Stashes + CAMBIOS + STASHES + Estadísticas + COMMITS + COMMITTER + MES + SEMANA + COMMITS: + AUTORES: + GENERAL + SUBMÓDULOS + Añadir Submódulo + Copiar Ruta Relativa + Fetch submódulos anidados + Abrir Repositorio del Submódulo + Ruta Relativa: + Carpeta relativa para almacenar este módulo. + Eliminar Submódulo + OK + Copiar Nombre de la Etiqueta + Copiar Mensaje de la Etiqueta + Eliminar ${0}$... + Push ${0}$... + URL: + Actualizar Submódulos + Todos los submódulos + Inicializar según sea necesario + Recursivamente + Submódulo: + Usar opción --remote + Advertencia + Página de Bienvenida + Crear Grupo + Crear Sub-Grupo + Clonar Repositorio + Eliminar + SOPORTA ARRASTRAR Y SOLTAR CARPETAS. SOPORTA AGRUPACIÓN PERSONALIZADA. + Editar + Mover a Otro Grupo + Abrir Todos Los Repositorios + Abrir Repositorio + Abrir Terminal + Reescanear Repositorios en el Directorio de Clonado por Defecto + Buscar Repositorios... + Ordenar + Cambios + Git Ignore + Ignorar todos los archivos *{0} + Ignorar archivos *{0} en la misma carpeta + Ignorar archivos en la misma carpeta + Ignorar solo este archivo + Enmendar (Amend) + Puedes stagear este archivo ahora. + COMMIT + COMMIT & PUSH + Plantilla/Historias + Activar evento de clic + Stagear todos los cambios y commit + ¡Commit vacío detectado! ¿Quieres continuar (--allow-empty)? + CONFLICTOS DETECTADOS + LOS CONFLICTOS DE ARCHIVOS ESTÁN RESUELTOS + INCLUIR ARCHIVOS NO RASTREADOS + NO HAY MENSAJES DE ENTRADA RECIENTES + NO HAY PLANTILLAS DE COMMIT + STAGED + UNSTAGE + UNSTAGE TODO + UNSTAGED + STAGE + STAGE TODO + VER ASSUME UNCHANGED + Plantilla: ${0}$ + Haz clic derecho en el(los) archivo(s) seleccionado(s) y elige tu opción para resolver conflictos. + ESPACIO DE TRABAJO: + Configura Espacios de Trabajo... + WORKTREE + Copiar Ruta + Bloquear + Eliminar + Desbloquear + From 047444124052a3704231930695fbcec4c6a92f3f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 30 Oct 2024 01:43:21 +0000 Subject: [PATCH 0071/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3caa8dac..d2832347 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.06%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-89.55%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-92.69%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.06%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.10%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-89.55%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-92.69%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index e5c43b3e..9aa14567 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -20,6 +20,21 @@ +### es_ES.axaml: 99.10% + + +
+Missing Keys + +- Text.ChangeCM.GenerateCommitMessage +- Text.Configure.OpenAI +- Text.Configure.OpenAI.Prefered +- Text.Configure.OpenAI.Prefered.Tip +- Text.Preference.AI.Name +- Text.Stash.KeepIndex + +
+ ### fr_FR.axaml: 89.55% From 28fad000ab9ba4088a2486f5fbf0dde66a5db251 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 09:44:05 +0800 Subject: [PATCH 0072/1283] project: add missing scripts to solution file Signed-off-by: leo --- SourceGit.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/SourceGit.sln b/SourceGit.sln index abd42aee..9799a09e 100644 --- a/SourceGit.sln +++ b/SourceGit.sln @@ -76,6 +76,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "appimage", "appimage", "{5D EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{C54D4001-9940-477C-A0B6-E795ED0A3209}" ProjectSection(SolutionItems) = preProject + build\scripts\localization-check.js = build\scripts\localization-check.js build\scripts\package.linux.sh = build\scripts\package.linux.sh build\scripts\package.osx-app.sh = build\scripts\package.osx-app.sh build\scripts\package.windows-portable.sh = build\scripts\package.windows-portable.sh From 81f76f0771504d9f244ebdc11fb12a3941a8c78c Mon Sep 17 00:00:00 2001 From: Masgalor Date: Wed, 30 Oct 2024 02:45:41 +0100 Subject: [PATCH 0073/1283] fix: Make RPM builds compatible with OpenSUSE (#622) --- build/resources/rpm/SPECS/build.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/resources/rpm/SPECS/build.spec b/build/resources/rpm/SPECS/build.spec index 289cbe39..0f80aac3 100644 --- a/build/resources/rpm/SPECS/build.spec +++ b/build/resources/rpm/SPECS/build.spec @@ -6,7 +6,7 @@ License: MIT URL: https://sourcegit-scm.github.io/ Source: https://github.com/sourcegit-scm/sourcegit/archive/refs/tags/v%_version.tar.gz Requires: libX11 -Requires: libSM +Requires: (libSM or libSM6) %define _build_id_links none From b175ab3a3e57a1de73335d90d5e102c25650c9b2 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 09:47:33 +0800 Subject: [PATCH 0074/1283] code_review: PR #623 * keep locales in order * update README.md Signed-off-by: leo --- README.md | 2 +- src/Models/Locales.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d2832347..af799116 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * Supports Windows/macOS/Linux * Opensource/Free * Fast -* English/Français/Deutsch/Português/Русский/简体中文/繁體中文 +* English/Español/Français/Deutsch/Português/Русский/简体中文/繁體中文 * Built-in light/dark themes * Customize theme * Visual commit graph diff --git a/src/Models/Locales.cs b/src/Models/Locales.cs index 3fa9ab7c..28d55459 100644 --- a/src/Models/Locales.cs +++ b/src/Models/Locales.cs @@ -9,13 +9,13 @@ namespace SourceGit.Models public static readonly List Supported = new List() { new Locale("English", "en_US"), + new Locale("Español", "es_ES"), new Locale("Deutsch", "de_DE"), new Locale("Français", "fr_FR"), new Locale("Português (Brasil)", "pt_BR"), new Locale("Русский", "ru_RU"), new Locale("简体中文", "zh_CN"), new Locale("繁體中文", "zh_TW"), - new Locale("Español", "es_ES"), }; public Locale(string name, string key) From 4a6cbddeac9dfcd3ed673d2d7aabd28f6b8182ef Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 09:53:58 +0800 Subject: [PATCH 0075/1283] refactor: select the previous tab while closing the actived one (#621) Signed-off-by: leo --- src/ViewModels/Launcher.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ViewModels/Launcher.cs b/src/ViewModels/Launcher.cs index dd618e41..8e4f7775 100644 --- a/src/ViewModels/Launcher.cs +++ b/src/ViewModels/Launcher.cs @@ -204,12 +204,7 @@ namespace SourceGit.ViewModels var activeIdx = Pages.IndexOf(_activePage); if (removeIdx == activeIdx) { - ActivePage = Pages[removeIdx == Pages.Count - 1 ? removeIdx - 1 : removeIdx + 1]; - CloseRepositoryInTab(page); - Pages.RemoveAt(removeIdx); - } - else if (removeIdx + 1 == activeIdx) - { + ActivePage = Pages[removeIdx > 0 ? removeIdx - 1 : removeIdx + 1]; CloseRepositoryInTab(page); Pages.RemoveAt(removeIdx); } From c2e83778cc94046727284c909e3453c13d6d7f40 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 09:56:57 +0800 Subject: [PATCH 0076/1283] readme: keep the same order for locales Signed-off-by: leo --- README.md | 2 +- src/Models/Locales.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index af799116..4242056b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * Supports Windows/macOS/Linux * Opensource/Free * Fast -* English/Español/Français/Deutsch/Português/Русский/简体中文/繁體中文 +* English/Deutsch/Español/Français/Português/Русский/简体中文/繁體中文 * Built-in light/dark themes * Customize theme * Visual commit graph diff --git a/src/Models/Locales.cs b/src/Models/Locales.cs index 28d55459..203eb2dd 100644 --- a/src/Models/Locales.cs +++ b/src/Models/Locales.cs @@ -9,8 +9,8 @@ namespace SourceGit.Models public static readonly List Supported = new List() { new Locale("English", "en_US"), - new Locale("Español", "es_ES"), new Locale("Deutsch", "de_DE"), + new Locale("Español", "es_ES"), new Locale("Français", "fr_FR"), new Locale("Português (Brasil)", "pt_BR"), new Locale("Русский", "ru_RU"), From 1adcf4dd80c4342701978614e4b4280ab43c46ff Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 10:10:17 +0800 Subject: [PATCH 0077/1283] enhance: do NOT query `gpg.ssh.allowedSignersFile` every time while getting commit's signing status Signed-off-by: leo --- src/Commands/QueryCommitSignInfo.cs | 5 ++--- src/ViewModels/CommitDetail.cs | 2 +- src/ViewModels/Repository.cs | 12 ++++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Commands/QueryCommitSignInfo.cs b/src/Commands/QueryCommitSignInfo.cs index 5ce18319..95f6d4d6 100644 --- a/src/Commands/QueryCommitSignInfo.cs +++ b/src/Commands/QueryCommitSignInfo.cs @@ -2,13 +2,12 @@ { public class QueryCommitSignInfo : Command { - public QueryCommitSignInfo(string repo, string sha) + public QueryCommitSignInfo(string repo, string sha, bool useFakeSignersFile) { WorkingDirectory = repo; Context = repo; - var allowedSignersFile = new Config(repo).Get("gpg.ssh.allowedSignersFile"); - if (string.IsNullOrEmpty(allowedSignersFile)) + if (useFakeSignersFile) Args = $"-c gpg.ssh.allowedSignersFile=/dev/null show --no-show-signature --pretty=format:\"%G? %GK\" -s {sha}"; else Args = $"show --no-show-signature --pretty=format:\"%G? %GK\" -s {sha}"; diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index b533b24a..1600c4cd 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -498,7 +498,7 @@ namespace SourceGit.ViewModels Task.Run(() => { - var signInfo = new Commands.QueryCommitSignInfo(_repo.FullPath, _commit.SHA).Result(); + var signInfo = new Commands.QueryCommitSignInfo(_repo.FullPath, _commit.SHA, !_repo.HasAllowedSignersFile).Result(); Dispatcher.UIThread.Invoke(() => SignInfo = signInfo); }); diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 9708f1e2..917833db 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -45,6 +45,11 @@ namespace SourceGit.ViewModels get => _settings; } + public bool HasAllowedSignersFile + { + get => _hasAllowedSignersFile; + } + public int SelectedViewIndex { get => _selectedViewIndex; @@ -444,6 +449,12 @@ namespace SourceGit.ViewModels public void RefreshAll() { + Task.Run(() => + { + var allowedSignersFile = new Commands.Config(_fullpath).Get("gpg.ssh.allowedSignersFile"); + _hasAllowedSignersFile = !string.IsNullOrEmpty(allowedSignersFile); + }); + Task.Run(() => { RefreshBranches(); @@ -2135,6 +2146,7 @@ namespace SourceGit.ViewModels private string _fullpath = string.Empty; private string _gitDir = string.Empty; private Models.RepositorySettings _settings = null; + private bool _hasAllowedSignersFile = false; private Models.Watcher _watcher = null; private Histories _histories = null; From df3b4e424adca8623ba0979dc81c8b4e224a2404 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 10:13:33 +0800 Subject: [PATCH 0078/1283] localization: add fallback locale for `es_ES` (#623) Signed-off-by: leo --- src/Resources/Locales/es_ES.axaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index e9c7733d..f8a2fa68 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -1,4 +1,7 @@ + + + Acerca de Acerca de SourceGit • Construido con From 81fc859a37319621349319382f0e8113ce4026ad Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 10:17:44 +0800 Subject: [PATCH 0079/1283] readme: keep the same order for locales Signed-off-by: leo --- README.md | 2 +- src/Models/Locales.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4242056b..f0ce7b41 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * Supports Windows/macOS/Linux * Opensource/Free * Fast -* English/Deutsch/Español/Français/Português/Русский/简体中文/繁體中文 +* Deutsch/English/Español/Français/Português/Русский/简体中文/繁體中文 * Built-in light/dark themes * Customize theme * Visual commit graph diff --git a/src/Models/Locales.cs b/src/Models/Locales.cs index 203eb2dd..9d24f491 100644 --- a/src/Models/Locales.cs +++ b/src/Models/Locales.cs @@ -8,8 +8,8 @@ namespace SourceGit.Models public string Key { get; set; } public static readonly List Supported = new List() { - new Locale("English", "en_US"), new Locale("Deutsch", "de_DE"), + new Locale("English", "en_US"), new Locale("Español", "es_ES"), new Locale("Français", "fr_FR"), new Locale("Português (Brasil)", "pt_BR"), From 9abda2c6abd2673a6df9f9b18f93f528d51d7911 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 10:27:14 +0800 Subject: [PATCH 0080/1283] ux: move the commit signing status icon to the last Signed-off-by: leo --- src/Views/CommitBaseInfo.axaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index d45b5a86..806abe65 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -60,22 +60,6 @@ Margin="12,0,4,0" VerticalAlignment="Center"/> - - - - - - - - - - - - - - @@ -87,6 +71,22 @@ + + + + + + + + + + + + + + From f8f169d23a76db0eef20fd99eea988582bfe7fc2 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 12:58:46 +0800 Subject: [PATCH 0081/1283] fix: typo in commit signing status info Signed-off-by: leo --- src/Models/CommitSignInfo.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Models/CommitSignInfo.cs b/src/Models/CommitSignInfo.cs index 143cb347..2428b2af 100644 --- a/src/Models/CommitSignInfo.cs +++ b/src/Models/CommitSignInfo.cs @@ -36,15 +36,15 @@ namespace SourceGit.Models switch (VerifyResult) { case 'G': - return $"Good Signature.\n\nKey: {Key}"; + return $"Good signature.\n\nKey: {Key}"; case 'B': - return $"Bad Signature.\n\nKey: {Key}"; + return $"Bad signature.\n\nKey: {Key}"; case 'U': - return $"Good Signature with unknown validity.\n\nKey: {Key}"; + return $"Good signature with unknown validity.\n\nKey: {Key}"; case 'X': - return $"Good Signature but has expired.\n\nKey: {Key}"; + return $"Good signature but has expired.\n\nKey: {Key}"; case 'Y': - return $"Good Signature made by expired key.\n\nKey: {Key}"; + return $"Good signature made by expired key.\n\nKey: {Key}"; case 'R': return $"Good signature made by a revoked key.\n\nKey: {Key}"; case 'E': From e680f8477e1204873ac5de8c6208ccaf2ed933f1 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 13:07:30 +0800 Subject: [PATCH 0082/1283] readme: contributor image Signed-off-by: leo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0ce7b41..7e675368 100644 --- a/README.md +++ b/README.md @@ -162,4 +162,4 @@ Everyone is welcome to submit a PR. Please make sure your PR is based on the lat Thanks to all the people who contribute. -[![Contributors](https://contrib.rocks/image?repo=sourcegit-scm/sourcegit&columns=10)](https://github.com/sourcegit-scm/sourcegit/graphs/contributors) +[![Contributors](https://contrib.rocks/image?repo=sourcegit-scm/sourcegit&columns=20)](https://github.com/sourcegit-scm/sourcegit/graphs/contributors) From 4e87b25765801e001f7f0016dccec15802de9d1d Mon Sep 17 00:00:00 2001 From: GadflyFang Date: Wed, 30 Oct 2024 14:48:37 +0800 Subject: [PATCH 0083/1283] enhance: show commit signer (#626) Signed-off-by: Gadfly --- src/Commands/QueryCommitSignInfo.cs | 20 +++++++++++++------- src/Models/CommitSignInfo.cs | 19 ++++++++++--------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/Commands/QueryCommitSignInfo.cs b/src/Commands/QueryCommitSignInfo.cs index 95f6d4d6..18517d8d 100644 --- a/src/Commands/QueryCommitSignInfo.cs +++ b/src/Commands/QueryCommitSignInfo.cs @@ -7,10 +7,9 @@ WorkingDirectory = repo; Context = repo; - if (useFakeSignersFile) - Args = $"-c gpg.ssh.allowedSignersFile=/dev/null show --no-show-signature --pretty=format:\"%G? %GK\" -s {sha}"; - else - Args = $"show --no-show-signature --pretty=format:\"%G? %GK\" -s {sha}"; + const string baseArgs = "show --no-show-signature --pretty=format:\"%G?%n%GS%n%GK\" -s"; + const string fakeSignersFileArg = "-c gpg.ssh.allowedSignersFile=/dev/null"; + Args = $"{(useFakeSignersFile ? fakeSignersFileArg : string.Empty)} {baseArgs} {sha}"; } public Models.CommitSignInfo Result() @@ -20,10 +19,17 @@ return null; var raw = rs.StdOut.Trim(); - if (raw.Length > 1) - return new Models.CommitSignInfo() { VerifyResult = raw[0], Key = raw.Substring(2) }; + if (raw.Length <= 1) + return null; + + var lines = raw.Split('\n'); + return new Models.CommitSignInfo() + { + VerifyResult = lines[0][0], + Signer = string.IsNullOrEmpty(lines[1]) ? "" : lines[1], + Key = lines[2] + }; - return null; } } } diff --git a/src/Models/CommitSignInfo.cs b/src/Models/CommitSignInfo.cs index 2428b2af..ab2bfbf4 100644 --- a/src/Models/CommitSignInfo.cs +++ b/src/Models/CommitSignInfo.cs @@ -4,8 +4,9 @@ namespace SourceGit.Models { public class CommitSignInfo { - public string Key { get; set; } = string.Empty; - public char VerifyResult { get; set; } = 'N'; + public char VerifyResult { get; init; } = 'N'; + public string Signer { get; init; } = string.Empty; + public string Key { get; init; } = string.Empty; public IBrush Brush { @@ -36,19 +37,19 @@ namespace SourceGit.Models switch (VerifyResult) { case 'G': - return $"Good signature.\n\nKey: {Key}"; + return $"Good signature.\n\nSigner: {Signer}\n\nKey: {Key}"; case 'B': - return $"Bad signature.\n\nKey: {Key}"; + return $"Bad signature.\n\nSigner: {Signer}\n\nKey: {Key}"; case 'U': - return $"Good signature with unknown validity.\n\nKey: {Key}"; + return $"Good signature with unknown validity.\n\nSigner: {Signer}\n\nKey: {Key}"; case 'X': - return $"Good signature but has expired.\n\nKey: {Key}"; + return $"Good signature but has expired.\n\nSigner: {Signer}\n\nKey: {Key}"; case 'Y': - return $"Good signature made by expired key.\n\nKey: {Key}"; + return $"Good signature made by expired key.\n\nSigner: {Signer}\n\nKey: {Key}"; case 'R': - return $"Good signature made by a revoked key.\n\nKey: {Key}"; + return $"Good signature made by a revoked key.\n\nSigner: {Signer}\n\nKey: {Key}"; case 'E': - return $"Signature cannot be checked.\n\nKey: {Key}"; + return $"Signature cannot be checked.\n\nSigner: {Signer}\n\nKey: {Key}"; default: return "No signature."; } From 195325187ded55e9b7116ebe5daa0eaaf6207919 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 15:01:08 +0800 Subject: [PATCH 0084/1283] ux: tooltip of commit signing status icon * do NOT show signer if it is not available * new tooltip style Signed-off-by: leo --- src/Commands/QueryCommitSignInfo.cs | 2 +- src/Models/CommitSignInfo.cs | 16 ++++++++-------- src/Views/CommitBaseInfo.axaml | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/Commands/QueryCommitSignInfo.cs b/src/Commands/QueryCommitSignInfo.cs index 18517d8d..5c81cf57 100644 --- a/src/Commands/QueryCommitSignInfo.cs +++ b/src/Commands/QueryCommitSignInfo.cs @@ -26,7 +26,7 @@ return new Models.CommitSignInfo() { VerifyResult = lines[0][0], - Signer = string.IsNullOrEmpty(lines[1]) ? "" : lines[1], + Signer = lines[1], Key = lines[2] }; diff --git a/src/Models/CommitSignInfo.cs b/src/Models/CommitSignInfo.cs index ab2bfbf4..c6c30797 100644 --- a/src/Models/CommitSignInfo.cs +++ b/src/Models/CommitSignInfo.cs @@ -37,19 +37,19 @@ namespace SourceGit.Models switch (VerifyResult) { case 'G': - return $"Good signature.\n\nSigner: {Signer}\n\nKey: {Key}"; - case 'B': - return $"Bad signature.\n\nSigner: {Signer}\n\nKey: {Key}"; + return "Good signature."; case 'U': - return $"Good signature with unknown validity.\n\nSigner: {Signer}\n\nKey: {Key}"; + return "Good signature with unknown validity."; case 'X': - return $"Good signature but has expired.\n\nSigner: {Signer}\n\nKey: {Key}"; + return "Good signature but has expired."; case 'Y': - return $"Good signature made by expired key.\n\nSigner: {Signer}\n\nKey: {Key}"; + return "Good signature made by expired key."; case 'R': - return $"Good signature made by a revoked key.\n\nSigner: {Signer}\n\nKey: {Key}"; + return "Good signature made by a revoked key."; + case 'B': + return "Bad signature."; case 'E': - return $"Signature cannot be checked.\n\nSigner: {Signer}\n\nKey: {Key}"; + return "Signature cannot be checked."; default: return "No signature."; } diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index 806abe65..fd9969ac 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -81,7 +81,20 @@ - + + + + + + + + + + + + + + From fe03512c5c8510fe3e44253be8ec4a709ffb54c4 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 15:10:26 +0800 Subject: [PATCH 0085/1283] ux: tooltip of commit signing status icon Signed-off-by: leo --- src/Models/CommitSignInfo.cs | 1 + src/Views/CommitBaseInfo.axaml | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Models/CommitSignInfo.cs b/src/Models/CommitSignInfo.cs index c6c30797..44b95e61 100644 --- a/src/Models/CommitSignInfo.cs +++ b/src/Models/CommitSignInfo.cs @@ -7,6 +7,7 @@ namespace SourceGit.Models public char VerifyResult { get; init; } = 'N'; public string Signer { get; init; } = string.Empty; public string Key { get; init; } = string.Empty; + public bool HasSigner => !string.IsNullOrEmpty(Signer); public IBrush Brush { diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index fd9969ac..62117480 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -85,14 +85,12 @@ - - - - - - - - + + + + + + From 2d7ea561e2662efa0928cf338f7316d880c946da Mon Sep 17 00:00:00 2001 From: yindf <112849074+yindf@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:59:14 +0800 Subject: [PATCH 0086/1283] fix bug that stuck auto fetch when pull failed & make stage area resizeable (#627) * fix watcher stuck by pull * make stage area resizeable --------- Co-authored-by: yindf (cherry picked from commit a842aca042a73cb5fa3995794aae2a2e3540b37f) --- src/ViewModels/Pull.cs | 3 +++ src/Views/WorkingCopy.axaml | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/ViewModels/Pull.cs b/src/ViewModels/Pull.cs index fdaad920..b5c038ae 100644 --- a/src/ViewModels/Pull.cs +++ b/src/ViewModels/Pull.cs @@ -149,7 +149,10 @@ namespace SourceGit.ViewModels SetProgressDescription($"Fetching remote: {_selectedRemote.Name}..."); rs = new Commands.Fetch(_repo.FullPath, _selectedRemote.Name, NoTags, SetProgressDescription).Exec(); if (!rs) + { + CallUIThread(() => _repo.SetWatcherEnabled(true)); return false; + } _repo.MarkFetched(); diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index dae1f886..2e07d970 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -80,6 +80,15 @@ ChangeDoubleTapped="OnUnstagedChangeDoubleTapped" KeyDown="OnUnstagedKeyDown"/> + + + + From a4befd010ad8635d4ad027f0c5c11bafa4c928c9 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 30 Oct 2024 18:10:53 +0800 Subject: [PATCH 0087/1283] code_review: PR #627 * add minimal height for both unstaged and staged changes view Signed-off-by: leo --- src/Views/WorkingCopy.axaml | 219 +++++++++++++++++++----------------- 1 file changed, 114 insertions(+), 105 deletions(-) diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index 2e07d970..4550e46a 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -16,117 +16,126 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Background="{DynamicResource Brush.Border0}"/> - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + + Date: Wed, 30 Oct 2024 18:39:38 +0800 Subject: [PATCH 0088/1283] feature: add an option in repository configuration to enable `--prune` on fetch (#590) Signed-off-by: leo --- src/Commands/Fetch.cs | 5 ++++- src/Commands/Pull.cs | 4 +++- src/Models/RepositorySettings.cs | 6 ++++++ src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/ViewModels/AddRemote.cs | 2 +- src/ViewModels/Fetch.cs | 6 ++++-- src/ViewModels/Pull.cs | 17 +++++++++++++++-- src/ViewModels/Repository.cs | 2 +- src/ViewModels/RepositoryConfigure.cs | 8 +++++++- src/Views/RepositoryConfigure.axaml | 8 ++++++-- 12 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src/Commands/Fetch.cs b/src/Commands/Fetch.cs index 25c499fd..08d2d1c6 100644 --- a/src/Commands/Fetch.cs +++ b/src/Commands/Fetch.cs @@ -4,7 +4,7 @@ namespace SourceGit.Commands { public class Fetch : Command { - public Fetch(string repo, string remote, bool noTags, Action outputHandler) + public Fetch(string repo, string remote, bool noTags, bool prune, Action outputHandler) { _outputHandler = outputHandler; WorkingDirectory = repo; @@ -18,6 +18,9 @@ namespace SourceGit.Commands else Args += "--force "; + if (prune) + Args += "--prune "; + Args += remote; } diff --git a/src/Commands/Pull.cs b/src/Commands/Pull.cs index a4efa4b6..732530f5 100644 --- a/src/Commands/Pull.cs +++ b/src/Commands/Pull.cs @@ -4,7 +4,7 @@ namespace SourceGit.Commands { public class Pull : Command { - public Pull(string repo, string remote, string branch, bool useRebase, bool noTags, Action outputHandler) + public Pull(string repo, string remote, string branch, bool useRebase, bool noTags, bool prune, Action outputHandler) { _outputHandler = outputHandler; WorkingDirectory = repo; @@ -17,6 +17,8 @@ namespace SourceGit.Commands Args += "--rebase "; if (noTags) Args += "--no-tags "; + if (prune) + Args += "--prune "; Args += $"{remote} {branch}"; } diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs index ce4119f5..a8cc5770 100644 --- a/src/Models/RepositorySettings.cs +++ b/src/Models/RepositorySettings.cs @@ -16,6 +16,12 @@ namespace SourceGit.Models set; } = DealWithLocalChanges.DoNothing; + public bool EnablePruneOnFetch + { + get; + set; + } = false; + public bool FetchWithoutTags { get; diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index b2e0ef8d..c6f88ed1 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -145,6 +145,7 @@ Fetch remotes automatically Minute(s) Default Remote + Enable --prune on fetch Enable --signoff for commit ISSUE TRACKER Add Sample Github Rule diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 333dbd06..a274c06c 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -149,6 +149,7 @@ 分钟 默认远程 提交信息追加署名 (--signoff) + 拉取更新时启用修剪(--prune) ISSUE追踪 新增匹配Github Issue规则 新增匹配Jira规则 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 06f9bba4..ce62c299 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -149,6 +149,7 @@ 分鐘 預設遠端存放庫 提交訊息追加署名 (--signoff) + 提取變更时啟用修剪(--prune) Issue 追蹤 新增符合 GitHub Issue 規則 新增符合 Jira 規則 diff --git a/src/ViewModels/AddRemote.cs b/src/ViewModels/AddRemote.cs index d2a7729a..d6424572 100644 --- a/src/ViewModels/AddRemote.cs +++ b/src/ViewModels/AddRemote.cs @@ -100,7 +100,7 @@ namespace SourceGit.ViewModels { SetProgressDescription("Fetching from added remote ..."); new Commands.Config(_repo.FullPath).Set($"remote.{_name}.sshkey", _useSSH ? SSHKey : null); - new Commands.Fetch(_repo.FullPath, _name, false, SetProgressDescription).Exec(); + new Commands.Fetch(_repo.FullPath, _name, false, false, SetProgressDescription).Exec(); } CallUIThread(() => { diff --git a/src/ViewModels/Fetch.cs b/src/ViewModels/Fetch.cs index 3fe92a5f..7f54680d 100644 --- a/src/ViewModels/Fetch.cs +++ b/src/ViewModels/Fetch.cs @@ -40,6 +40,8 @@ namespace SourceGit.ViewModels { _repo.SetWatcherEnabled(false); + var notags = _repo.Settings.FetchWithoutTags; + var prune = _repo.Settings.EnablePruneOnFetch; return Task.Run(() => { if (FetchAllRemotes) @@ -47,13 +49,13 @@ namespace SourceGit.ViewModels foreach (var remote in _repo.Remotes) { SetProgressDescription($"Fetching remote: {remote.Name}"); - new Commands.Fetch(_repo.FullPath, remote.Name, NoTags, SetProgressDescription).Exec(); + new Commands.Fetch(_repo.FullPath, remote.Name, notags, prune, SetProgressDescription).Exec(); } } else { SetProgressDescription($"Fetching remote: {SelectedRemote.Name}"); - new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, NoTags, SetProgressDescription).Exec(); + new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, notags, prune, SetProgressDescription).Exec(); } CallUIThread(() => diff --git a/src/ViewModels/Pull.cs b/src/ViewModels/Pull.cs index b5c038ae..6c493449 100644 --- a/src/ViewModels/Pull.cs +++ b/src/ViewModels/Pull.cs @@ -147,7 +147,13 @@ namespace SourceGit.ViewModels if (FetchAllBranches) { SetProgressDescription($"Fetching remote: {_selectedRemote.Name}..."); - rs = new Commands.Fetch(_repo.FullPath, _selectedRemote.Name, NoTags, SetProgressDescription).Exec(); + rs = new Commands.Fetch( + _repo.FullPath, + _selectedRemote.Name, + NoTags, + _repo.Settings.EnablePruneOnFetch, + SetProgressDescription).Exec(); + if (!rs) { CallUIThread(() => _repo.SetWatcherEnabled(true)); @@ -171,7 +177,14 @@ namespace SourceGit.ViewModels else { SetProgressDescription($"Pull {_selectedRemote.Name}/{_selectedBranch.Name}..."); - rs = new Commands.Pull(_repo.FullPath, _selectedRemote.Name, _selectedBranch.Name, UseRebase, NoTags, SetProgressDescription).Exec(); + rs = new Commands.Pull( + _repo.FullPath, + _selectedRemote.Name, + _selectedBranch.Name, + UseRebase, + NoTags, + _repo.Settings.EnablePruneOnFetch, + SetProgressDescription).Exec(); } if (rs && needPopStash) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 917833db..c64967d1 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -2137,7 +2137,7 @@ namespace SourceGit.ViewModels IsAutoFetching = true; Dispatcher.UIThread.Invoke(() => OnPropertyChanged(nameof(IsAutoFetching))); - new Commands.Fetch(_fullpath, "--all", false, null) { RaiseError = false }.Exec(); + new Commands.Fetch(_fullpath, "--all", false, _settings.EnablePruneOnFetch, null) { RaiseError = false }.Exec(); _lastFetchTime = DateTime.Now; IsAutoFetching = false; Dispatcher.UIThread.Invoke(() => OnPropertyChanged(nameof(IsAutoFetching))); diff --git a/src/ViewModels/RepositoryConfigure.cs b/src/ViewModels/RepositoryConfigure.cs index d7eaa1cb..94efc09d 100644 --- a/src/ViewModels/RepositoryConfigure.cs +++ b/src/ViewModels/RepositoryConfigure.cs @@ -67,6 +67,12 @@ namespace SourceGit.ViewModels set => _repo.Settings.EnableSignOffForCommit = value; } + public bool EnablePruneOnFetch + { + get => _repo.Settings.EnablePruneOnFetch; + set => _repo.Settings.EnablePruneOnFetch = value; + } + public bool EnableAutoFetch { get => _repo.Settings.EnableAutoFetch; @@ -134,7 +140,7 @@ namespace SourceGit.ViewModels AvailableOpenAIServices.Add(service.Name); if (AvailableOpenAIServices.IndexOf(PreferedOpenAIService) == -1) - PreferedOpenAIService = "---"; + PreferedOpenAIService = "---"; _cached = new Commands.Config(repo.FullPath).ListAll(); if (_cached.TryGetValue("user.name", out var name)) diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml index ced0dab6..535a016c 100644 --- a/src/Views/RepositoryConfigure.axaml +++ b/src/Views/RepositoryConfigure.axaml @@ -51,7 +51,7 @@ - + - + + + From 0228bef1dbc28b461a19ed70bf41355ee49f0cf3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 30 Oct 2024 10:40:00 +0000 Subject: [PATCH 0089/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7e675368..2c7310c8 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.06%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.10%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-89.55%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-92.69%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-97.91%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.96%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-89.42%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-92.55%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.85%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 9aa14567..5cf27b14 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 98.06% +### de_DE.axaml: 97.91%
@@ -6,6 +6,7 @@ - Text.BranchCM.FetchInto - Text.ChangeCM.GenerateCommitMessage +- Text.Configure.Git.EnablePruneOnFetch - Text.Configure.Git.EnableSignOff - Text.Configure.IssueTracker.AddSampleGitLabIssue - Text.Configure.IssueTracker.AddSampleGitLabMergeRequest @@ -20,13 +21,14 @@
-### es_ES.axaml: 99.10% +### es_ES.axaml: 98.96%
Missing Keys - Text.ChangeCM.GenerateCommitMessage +- Text.Configure.Git.EnablePruneOnFetch - Text.Configure.OpenAI - Text.Configure.OpenAI.Prefered - Text.Configure.OpenAI.Prefered.Tip @@ -35,7 +37,7 @@
-### fr_FR.axaml: 89.55% +### fr_FR.axaml: 89.42%
@@ -53,6 +55,7 @@ - Text.CommitCM.SquashCommitsSinceThis - Text.CommitDetail.Info.WebLinks - Text.Configure.Git.DefaultRemote +- Text.Configure.Git.EnablePruneOnFetch - Text.Configure.Git.EnableSignOff - Text.Configure.IssueTracker.AddSampleGitLabIssue - Text.Configure.IssueTracker.AddSampleGitLabMergeRequest @@ -114,7 +117,7 @@
-### pt_BR.axaml: 92.69% +### pt_BR.axaml: 92.55%
@@ -134,6 +137,7 @@ - Text.CommitDetail.Info.ContainsIn.Title - Text.CommitDetail.Info.WebLinks - Text.Configure.Git.DefaultRemote +- Text.Configure.Git.EnablePruneOnFetch - Text.Configure.Git.EnableSignOff - Text.Configure.IssueTracker.AddSampleGitLabIssue - Text.Configure.IssueTracker.AddSampleGitLabMergeRequest @@ -172,13 +176,13 @@
-### ru_RU.axaml: 100.00% +### ru_RU.axaml: 99.85%
Missing Keys - +- Text.Configure.Git.EnablePruneOnFetch
From 9816a5e8ba58e6fc7794dcb260ffeb613cca086f Mon Sep 17 00:00:00 2001 From: Masgalor Date: Wed, 30 Oct 2024 11:45:25 +0100 Subject: [PATCH 0090/1283] fix: Make RPM builds compatible with OpenSUSE (libX11) (#628) --- build/resources/rpm/SPECS/build.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/resources/rpm/SPECS/build.spec b/build/resources/rpm/SPECS/build.spec index 0f80aac3..9dda5f96 100644 --- a/build/resources/rpm/SPECS/build.spec +++ b/build/resources/rpm/SPECS/build.spec @@ -5,7 +5,7 @@ Summary: Open-source & Free Git Gui Client License: MIT URL: https://sourcegit-scm.github.io/ Source: https://github.com/sourcegit-scm/sourcegit/archive/refs/tags/v%_version.tar.gz -Requires: libX11 +Requires: (libX11 or libX11-6) Requires: (libSM or libSM6) %define _build_id_links none From cffcf3448e854d5a3ee1dbfbe810d83ed9d30af6 Mon Sep 17 00:00:00 2001 From: GadflyFang Date: Wed, 30 Oct 2024 18:48:41 +0800 Subject: [PATCH 0091/1283] fix: query file size quote filename (#629) Signed-off-by: Gadfly --- src/Commands/QueryFileSize.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/QueryFileSize.cs b/src/Commands/QueryFileSize.cs index c36984dd..9016d826 100644 --- a/src/Commands/QueryFileSize.cs +++ b/src/Commands/QueryFileSize.cs @@ -11,7 +11,7 @@ namespace SourceGit.Commands { WorkingDirectory = repo; Context = repo; - Args = $"ls-tree {revision} -l -- {file}"; + Args = $"ls-tree {revision} -l -- \"{file}\""; } public long Result() From 9b2e0bc5cfeeaf50e77a1e92872ca701851acfec Mon Sep 17 00:00:00 2001 From: AquariusStar <48148723+AquariusStar@users.noreply.github.com> Date: Thu, 31 Oct 2024 00:56:06 +0300 Subject: [PATCH 0092/1283] localization: update (#632) --- src/Resources/Locales/ru_RU.axaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 33237603..da689e1b 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -147,8 +147,9 @@ GIT Автоматическое извлечение внешних хранилищ Минут(а/ы) - Удалённое хранилище по-умолчанию Разрешить --signoff для фиксации + Удалённое хранилище по-умолчанию + Разрешить --prune при извлечении ОТСЛЕЖИВАНИЕ ПРОБЛЕМ Добавить пример правила для Git Добавить пример правила Jira From 39250466d59fd29f2994ca4220e697e5c02f762b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 30 Oct 2024 21:56:22 +0000 Subject: [PATCH 0093/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2c7310c8..51008ea3 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-97.91%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.96%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-89.42%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-92.55%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.85%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-97.91%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.96%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-89.42%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-92.55%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 5cf27b14..8cd78b5c 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -176,13 +176,13 @@ -### ru_RU.axaml: 99.85% +### ru_RU.axaml: 100.00%
Missing Keys -- Text.Configure.Git.EnablePruneOnFetch +
From 1999e4bf477b815bc3c8b8acbcfc0aeef2ebf8f8 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 31 Oct 2024 20:02:31 +0800 Subject: [PATCH 0094/1283] ux: remove button padding and use content alignment to center text Signed-off-by: leo --- src/Views/LauncherPage.axaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Views/LauncherPage.axaml b/src/Views/LauncherPage.axaml index 3ef4286a..1b256e7b 100644 --- a/src/Views/LauncherPage.axaml +++ b/src/Views/LauncherPage.axaml @@ -60,13 +60,19 @@ HorizontalAlignment="Right" IsVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}"> - - -
-
- diff --git a/src/Views/CaptionButtonsMacOS.axaml.cs b/src/Views/CaptionButtonsMacOS.axaml.cs deleted file mode 100644 index 98bbb88f..00000000 --- a/src/Views/CaptionButtonsMacOS.axaml.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Interactivity; -using Avalonia.VisualTree; - -namespace SourceGit.Views -{ - public partial class CaptionButtonsMacOS : UserControl - { - public static readonly StyledProperty IsCloseButtonOnlyProperty = - AvaloniaProperty.Register(nameof(IsCloseButtonOnly)); - - public bool IsCloseButtonOnly - { - get => GetValue(IsCloseButtonOnlyProperty); - set => SetValue(IsCloseButtonOnlyProperty, value); - } - - public CaptionButtonsMacOS() - { - InitializeComponent(); - } - - private void MinimizeWindow(object _, RoutedEventArgs e) - { - var window = this.FindAncestorOfType(); - if (window != null) - window.WindowState = WindowState.Minimized; - - e.Handled = true; - } - - private void MaximizeOrRestoreWindow(object _, RoutedEventArgs e) - { - var window = this.FindAncestorOfType(); - if (window != null) - window.WindowState = window.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; - - e.Handled = true; - } - - private void CloseWindow(object _, RoutedEventArgs e) - { - var window = this.FindAncestorOfType(); - window?.Close(); - e.Handled = true; - } - } -} diff --git a/src/Views/ChromelessWindow.cs b/src/Views/ChromelessWindow.cs index a9b9f259..107a7ba3 100644 --- a/src/Views/ChromelessWindow.cs +++ b/src/Views/ChromelessWindow.cs @@ -32,14 +32,35 @@ namespace SourceGit.Views Classes.Add("custom_window_frame"); } } - else + else if (OperatingSystem.IsWindows()) { ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.NoChrome; ExtendClientAreaToDecorationsHint = true; - - if (OperatingSystem.IsWindows()) - Classes.Add("fix_maximized_padding"); + Classes.Add("fix_maximized_padding"); } + else + { + ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome; + ExtendClientAreaToDecorationsHint = true; + } + } + + public void BeginMoveWindow(object _, PointerPressedEventArgs e) + { + if (e.ClickCount == 1) + BeginMoveDrag(e); + + e.Handled = true; + } + + public void MaximizeOrRestoreWindow(object _, TappedEventArgs e) + { + if (WindowState == WindowState.Maximized) + WindowState = WindowState.Normal; + else + WindowState = WindowState.Maximized; + + e.Handled = true; } protected override void OnApplyTemplate(TemplateAppliedEventArgs e) diff --git a/src/Views/ConfigureWorkspace.axaml b/src/Views/ConfigureWorkspace.axaml index c7ed900b..9c18ad04 100644 --- a/src/Views/ConfigureWorkspace.axaml +++ b/src/Views/ConfigureWorkspace.axaml @@ -2,10 +2,8 @@ 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="500" d:DesignHeight="450" x:Class="SourceGit.Views.ConfigureWorkspace" x:DataType="vm:ConfigureWorkspace" @@ -17,30 +15,23 @@ WindowStartupLocation="CenterOwner"> - - + - - - - - diff --git a/src/Views/ConfigureWorkspace.axaml.cs b/src/Views/ConfigureWorkspace.axaml.cs index 82d8cd30..e2cc1cb2 100644 --- a/src/Views/ConfigureWorkspace.axaml.cs +++ b/src/Views/ConfigureWorkspace.axaml.cs @@ -1,5 +1,4 @@ using Avalonia.Controls; -using Avalonia.Input; namespace SourceGit.Views { @@ -15,10 +14,5 @@ namespace SourceGit.Views ViewModels.Preference.Instance.Save(); base.OnClosing(e); } - - private void BeginMoveWindow(object _, PointerPressedEventArgs e) - { - BeginMoveDrag(e); - } } } diff --git a/src/Views/ConfirmCommitWithoutFiles.axaml b/src/Views/ConfirmCommitWithoutFiles.axaml index 0b457531..a056f016 100644 --- a/src/Views/ConfirmCommitWithoutFiles.axaml +++ b/src/Views/ConfirmCommitWithoutFiles.axaml @@ -15,30 +15,23 @@ WindowStartupLocation="CenterOwner"> - - + - - - - - diff --git a/src/Views/ConfirmCommitWithoutFiles.axaml.cs b/src/Views/ConfirmCommitWithoutFiles.axaml.cs index 0be18902..342600fc 100644 --- a/src/Views/ConfirmCommitWithoutFiles.axaml.cs +++ b/src/Views/ConfirmCommitWithoutFiles.axaml.cs @@ -1,4 +1,3 @@ -using Avalonia.Input; using Avalonia.Interactivity; namespace SourceGit.Views @@ -10,11 +9,6 @@ namespace SourceGit.Views InitializeComponent(); } - private void BeginMoveWindow(object _, PointerPressedEventArgs e) - { - BeginMoveDrag(e); - } - private void Sure(object _1, RoutedEventArgs _2) { if (DataContext is ViewModels.ConfirmCommitWithoutFiles vm) diff --git a/src/Views/ConfirmRestart.axaml b/src/Views/ConfirmRestart.axaml index 9aafda7e..de2ddd4f 100644 --- a/src/Views/ConfirmRestart.axaml +++ b/src/Views/ConfirmRestart.axaml @@ -13,30 +13,23 @@ WindowStartupLocation="CenterOwner"> - - + - - - - - diff --git a/src/Views/ConfirmRestart.axaml.cs b/src/Views/ConfirmRestart.axaml.cs index d0647731..ea49bea1 100644 --- a/src/Views/ConfirmRestart.axaml.cs +++ b/src/Views/ConfirmRestart.axaml.cs @@ -1,8 +1,6 @@ using System; using System.Diagnostics; -using Avalonia.Controls; -using Avalonia.Input; using Avalonia.Interactivity; namespace SourceGit.Views @@ -14,11 +12,6 @@ namespace SourceGit.Views InitializeComponent(); } - private void BeginMoveWindow(object _, PointerPressedEventArgs e) - { - BeginMoveDrag(e); - } - private void CloseWindow(object _1, RoutedEventArgs _2) { Console.Out.WriteLine("No passphrase entered."); diff --git a/src/Views/ConventionalCommitMessageBuilder.axaml b/src/Views/ConventionalCommitMessageBuilder.axaml index ab2ae37f..4fe8b8f9 100644 --- a/src/Views/ConventionalCommitMessageBuilder.axaml +++ b/src/Views/ConventionalCommitMessageBuilder.axaml @@ -5,7 +5,6 @@ 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" @@ -18,30 +17,23 @@ WindowStartupLocation="CenterOwner"> - - + - - - - - diff --git a/src/Views/ConventionalCommitMessageBuilder.axaml.cs b/src/Views/ConventionalCommitMessageBuilder.axaml.cs index dfe56f0d..955450ed 100644 --- a/src/Views/ConventionalCommitMessageBuilder.axaml.cs +++ b/src/Views/ConventionalCommitMessageBuilder.axaml.cs @@ -1,4 +1,3 @@ -using Avalonia.Input; using Avalonia.Interactivity; namespace SourceGit.Views @@ -10,11 +9,6 @@ namespace SourceGit.Views InitializeComponent(); } - private void BeginMoveWindow(object _, PointerPressedEventArgs e) - { - BeginMoveDrag(e); - } - private void OnApplyClicked(object _, RoutedEventArgs e) { if (DataContext is ViewModels.ConventionalCommitMessageBuilder builder) diff --git a/src/Views/FileHistories.axaml b/src/Views/FileHistories.axaml index bc048706..703957b8 100644 --- a/src/Views/FileHistories.axaml +++ b/src/Views/FileHistories.axaml @@ -20,29 +20,26 @@ - + - - - - - - - - - - - + + + - - - + diff --git a/src/Views/FileHistories.axaml.cs b/src/Views/FileHistories.axaml.cs index 6a2ee7c9..c7a01e2f 100644 --- a/src/Views/FileHistories.axaml.cs +++ b/src/Views/FileHistories.axaml.cs @@ -1,3 +1,6 @@ +using System; + +using Avalonia; using Avalonia.Controls; using Avalonia.Input; using Avalonia.Interactivity; @@ -6,27 +9,29 @@ namespace SourceGit.Views { public partial class FileHistories : ChromelessWindow { + public static readonly StyledProperty HasLeftCaptionButtonProperty = + AvaloniaProperty.Register(nameof(HasLeftCaptionButton)); + + public bool HasLeftCaptionButton + { + get => GetValue(HasLeftCaptionButtonProperty); + set => SetValue(HasLeftCaptionButtonProperty, value); + } + public FileHistories() { + if (OperatingSystem.IsMacOS()) + HasLeftCaptionButton = true; + InitializeComponent(); } - - private void MaximizeOrRestoreWindow(object _, TappedEventArgs e) + + protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) { - if (WindowState == WindowState.Maximized) - WindowState = WindowState.Normal; - else - WindowState = WindowState.Maximized; - - e.Handled = true; - } - - private void BeginMoveWindow(object _, PointerPressedEventArgs e) - { - if (e.ClickCount == 1) - BeginMoveDrag(e); - - e.Handled = true; + base.OnPropertyChanged(change); + + if (change.Property == WindowStateProperty) + HasLeftCaptionButton = WindowState != WindowState.FullScreen; } private void OnPressCommitSHA(object sender, PointerPressedEventArgs e) diff --git a/src/Views/Hotkeys.axaml b/src/Views/Hotkeys.axaml index 5d98238d..a28bc566 100644 --- a/src/Views/Hotkeys.axaml +++ b/src/Views/Hotkeys.axaml @@ -15,30 +15,23 @@ WindowStartupLocation="CenterOwner"> - - + - - - - - diff --git a/src/Views/Hotkeys.axaml.cs b/src/Views/Hotkeys.axaml.cs index 2a21fef9..d8b5e1a8 100644 --- a/src/Views/Hotkeys.axaml.cs +++ b/src/Views/Hotkeys.axaml.cs @@ -1,5 +1,3 @@ -using Avalonia.Input; - namespace SourceGit.Views { public partial class Hotkeys : ChromelessWindow @@ -8,10 +6,5 @@ namespace SourceGit.Views { InitializeComponent(); } - - private void BeginMoveWindow(object _, PointerPressedEventArgs e) - { - BeginMoveDrag(e); - } } } diff --git a/src/Views/InteractiveRebase.axaml b/src/Views/InteractiveRebase.axaml index e1161a2b..c008193b 100644 --- a/src/Views/InteractiveRebase.axaml +++ b/src/Views/InteractiveRebase.axaml @@ -16,30 +16,23 @@ WindowStartupLocation="CenterOwner"> - - + - - - - - diff --git a/src/Views/InteractiveRebase.axaml.cs b/src/Views/InteractiveRebase.axaml.cs index 8f75cc26..a31b8a23 100644 --- a/src/Views/InteractiveRebase.axaml.cs +++ b/src/Views/InteractiveRebase.axaml.cs @@ -81,11 +81,6 @@ namespace SourceGit.Views InitializeComponent(); } - private void BeginMoveWindow(object _, PointerPressedEventArgs e) - { - BeginMoveDrag(e); - } - private void CloseWindow(object _1, RoutedEventArgs _2) { Close(); diff --git a/src/Views/LFSLocks.axaml b/src/Views/LFSLocks.axaml index ccbe9fe2..ac495bf1 100644 --- a/src/Views/LFSLocks.axaml +++ b/src/Views/LFSLocks.axaml @@ -16,30 +16,23 @@ WindowStartupLocation="CenterOwner"> - - + - - - - - diff --git a/src/Views/LFSLocks.axaml.cs b/src/Views/LFSLocks.axaml.cs index ee4b6ff1..695341f4 100644 --- a/src/Views/LFSLocks.axaml.cs +++ b/src/Views/LFSLocks.axaml.cs @@ -1,5 +1,4 @@ using Avalonia.Controls; -using Avalonia.Input; using Avalonia.Interactivity; namespace SourceGit.Views @@ -11,11 +10,6 @@ namespace SourceGit.Views InitializeComponent(); } - private void BeginMoveWindow(object _, PointerPressedEventArgs e) - { - BeginMoveDrag(e); - } - private void OnUnlockButtonClicked(object sender, RoutedEventArgs e) { if (DataContext is ViewModels.LFSLocks vm && sender is Button button) diff --git a/src/Views/Launcher.axaml b/src/Views/Launcher.axaml index 285ea72c..ad5a7f34 100644 --- a/src/Views/Launcher.axaml +++ b/src/Views/Launcher.axaml @@ -25,13 +25,11 @@ - - - + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Views/RepositoryConfigure.axaml.cs b/src/Views/RepositoryConfigure.axaml.cs index 21f6ad23..3faba5ee 100644 --- a/src/Views/RepositoryConfigure.axaml.cs +++ b/src/Views/RepositoryConfigure.axaml.cs @@ -1,4 +1,6 @@ using Avalonia.Controls; +using Avalonia.Interactivity; +using Avalonia.Platform.Storage; namespace SourceGit.Views { @@ -14,5 +16,20 @@ namespace SourceGit.Views (DataContext as ViewModels.RepositoryConfigure)?.Save(); base.OnClosing(e); } + + private async void SelectExecutableForCustomAction(object sender, RoutedEventArgs e) + { + var options = new FilePickerOpenOptions() + { + FileTypeFilter = [new FilePickerFileType("Executable file(script)") { Patterns = ["*.*"] }], + AllowMultiple = false, + }; + + var selected = await StorageProvider.OpenFilePickerAsync(options); + if (selected.Count == 1 && sender is Button { DataContext: Models.CustomAction action }) + action.Executable = selected[0].Path.LocalPath; + + e.Handled = true; + } } } diff --git a/src/Views/RepositoryToolbar.axaml b/src/Views/RepositoryToolbar.axaml index b76cfd63..c1eec786 100644 --- a/src/Views/RepositoryToolbar.axaml +++ b/src/Views/RepositoryToolbar.axaml @@ -96,6 +96,10 @@ + + diff --git a/src/Views/RepositoryToolbar.axaml.cs b/src/Views/RepositoryToolbar.axaml.cs index 27ac43cd..55132620 100644 --- a/src/Views/RepositoryToolbar.axaml.cs +++ b/src/Views/RepositoryToolbar.axaml.cs @@ -91,6 +91,17 @@ namespace SourceGit.Views e.Handled = true; } + + private void OpenCustomActionMenu(object sender, RoutedEventArgs e) + { + if (DataContext is ViewModels.Repository repo) + { + var menu = repo.CreateContextMenuForCustomAction(); + (sender as Control)?.OpenContextMenu(menu); + } + + e.Handled = true; + } } } From 26fe56e0652b44dc54162bfd30f1a1fa908ba5e1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 1 Nov 2024 09:25:17 +0000 Subject: [PATCH 0099/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 71 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 51008ea3..9f0d8cae 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-97.91%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.96%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-89.42%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-92.55%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-96.05%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-97.08%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.72%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.79%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-98.10%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 8cd78b5c..4b22ac57 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 97.91% +### de_DE.axaml: 96.05%
@@ -6,6 +6,15 @@ - Text.BranchCM.FetchInto - Text.ChangeCM.GenerateCommitMessage +- Text.CommitCM.CustomAction +- Text.Configure.CustomAction +- Text.Configure.CustomAction.Arguments +- Text.Configure.CustomAction.Arguments.Tip +- Text.Configure.CustomAction.Executable +- Text.Configure.CustomAction.Name +- Text.Configure.CustomAction.Scope +- Text.Configure.CustomAction.Scope.Commit +- Text.Configure.CustomAction.Scope.Repository - Text.Configure.Git.EnablePruneOnFetch - Text.Configure.Git.EnableSignOff - Text.Configure.IssueTracker.AddSampleGitLabIssue @@ -13,31 +22,48 @@ - Text.Configure.OpenAI - Text.Configure.OpenAI.Prefered - Text.Configure.OpenAI.Prefered.Tip +- Text.ExecuteCustomAction +- Text.ExecuteCustomAction.Name - Text.Preference.AI.AnalyzeDiffPrompt - Text.Preference.AI.GenerateSubjectPrompt - Text.Preference.AI.Name +- Text.Repository.CustomActions +- Text.Repository.CustomActions.Empty - Text.Stash.KeepIndex - Text.WorkingCopy.ConfirmCommitWithoutFiles
-### es_ES.axaml: 98.96% +### es_ES.axaml: 97.08%
Missing Keys - Text.ChangeCM.GenerateCommitMessage +- Text.CommitCM.CustomAction +- Text.Configure.CustomAction +- Text.Configure.CustomAction.Arguments +- Text.Configure.CustomAction.Arguments.Tip +- Text.Configure.CustomAction.Executable +- Text.Configure.CustomAction.Name +- Text.Configure.CustomAction.Scope +- Text.Configure.CustomAction.Scope.Commit +- Text.Configure.CustomAction.Scope.Repository - Text.Configure.Git.EnablePruneOnFetch - Text.Configure.OpenAI - Text.Configure.OpenAI.Prefered - Text.Configure.OpenAI.Prefered.Tip +- Text.ExecuteCustomAction +- Text.ExecuteCustomAction.Name - Text.Preference.AI.Name +- Text.Repository.CustomActions +- Text.Repository.CustomActions.Empty - Text.Stash.KeepIndex
-### fr_FR.axaml: 89.42% +### fr_FR.axaml: 87.72%
@@ -52,8 +78,17 @@ - Text.CherryPick.Mainline - Text.CherryPick.Mainline.Tips - Text.CommitCM.CherryPickMultiple +- Text.CommitCM.CustomAction - Text.CommitCM.SquashCommitsSinceThis - Text.CommitDetail.Info.WebLinks +- Text.Configure.CustomAction +- Text.Configure.CustomAction.Arguments +- Text.Configure.CustomAction.Arguments.Tip +- Text.Configure.CustomAction.Executable +- Text.Configure.CustomAction.Name +- Text.Configure.CustomAction.Scope +- Text.Configure.CustomAction.Scope.Commit +- Text.Configure.CustomAction.Scope.Repository - Text.Configure.Git.DefaultRemote - Text.Configure.Git.EnablePruneOnFetch - Text.Configure.Git.EnableSignOff @@ -74,6 +109,8 @@ - Text.ConventionalCommit.Type - Text.Diff.IgnoreWhitespace - Text.Discard.IncludeIgnored +- Text.ExecuteCustomAction +- Text.ExecuteCustomAction.Name - Text.FileHistory.FileChange - Text.GitLFS.Locks.OnlyMine - Text.Histories.Header.AuthorTime @@ -97,6 +134,8 @@ - Text.Preference.Shell.Type - Text.Preference.Shell.Path - Text.Repository.AutoFetching +- Text.Repository.CustomActions +- Text.Repository.CustomActions.Empty - Text.Repository.EnableReflog - Text.Repository.Search.InCurrentBranch - Text.ScanRepositories @@ -117,7 +156,7 @@
-### pt_BR.axaml: 92.55% +### pt_BR.axaml: 90.79%
@@ -132,10 +171,19 @@ - Text.CherryPick.Mainline - Text.CherryPick.Mainline.Tips - Text.CommitCM.CherryPickMultiple +- Text.CommitCM.CustomAction - Text.CommitCM.SquashCommitsSinceThis - Text.CommitDetail.Info.ContainsIn - Text.CommitDetail.Info.ContainsIn.Title - Text.CommitDetail.Info.WebLinks +- Text.Configure.CustomAction +- Text.Configure.CustomAction.Arguments +- Text.Configure.CustomAction.Arguments.Tip +- Text.Configure.CustomAction.Executable +- Text.Configure.CustomAction.Name +- Text.Configure.CustomAction.Scope +- Text.Configure.CustomAction.Scope.Commit +- Text.Configure.CustomAction.Scope.Repository - Text.Configure.Git.DefaultRemote - Text.Configure.Git.EnablePruneOnFetch - Text.Configure.Git.EnableSignOff @@ -156,6 +204,8 @@ - Text.ConventionalCommit.Type - Text.CopyAllText - Text.Discard.IncludeIgnored +- Text.ExecuteCustomAction +- Text.ExecuteCustomAction.Name - Text.FileHistory.FileContent - Text.FileHistory.FileChange - Text.GitLFS.Locks.OnlyMine @@ -163,6 +213,8 @@ - Text.MoveRepositoryNode.Target - Text.Preference.AI.Name - Text.Push.CheckSubmodules +- Text.Repository.CustomActions +- Text.Repository.CustomActions.Empty - Text.Squash.Into - Text.Stash.KeepIndex - Text.Stash.OnlyStagedChanges @@ -176,13 +228,25 @@
-### ru_RU.axaml: 100.00% +### ru_RU.axaml: 98.10%
Missing Keys - +- Text.CommitCM.CustomAction +- Text.Configure.CustomAction +- Text.Configure.CustomAction.Arguments +- Text.Configure.CustomAction.Arguments.Tip +- Text.Configure.CustomAction.Executable +- Text.Configure.CustomAction.Name +- Text.Configure.CustomAction.Scope +- Text.Configure.CustomAction.Scope.Commit +- Text.Configure.CustomAction.Scope.Repository +- Text.ExecuteCustomAction +- Text.ExecuteCustomAction.Name +- Text.Repository.CustomActions +- Text.Repository.CustomActions.Empty
From ba3c72585d352d1d2f3858ff22a7eeeade831347 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 1 Nov 2024 17:54:05 +0800 Subject: [PATCH 0100/1283] enhance: use Inter as default font for all platforms (#639) Signed-off-by: leo --- src/App.axaml.cs | 6 +++++- src/Resources/Themes.axaml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 682ec5fc..dfec763b 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -59,6 +59,10 @@ namespace SourceGit builder.UsePlatformDetect(); builder.LogToTrace(); builder.WithInterFont(); + builder.With(new FontManagerOptions() + { + DefaultFamilyName = "fonts:Inter#Inter" + }); builder.ConfigureFonts(manager => { var monospace = new EmbeddedFontCollection( @@ -223,7 +227,7 @@ namespace SourceGit if (onlyUseMonospaceFontInEditor) { if (string.IsNullOrEmpty(defaultFont)) - resDic.Add("Fonts.Primary", new FontFamily("fonts:Inter#Inter, $Default")); + resDic.Add("Fonts.Primary", new FontFamily("fonts:Inter#Inter")); else resDic.Add("Fonts.Primary", new FontFamily(defaultFont)); } diff --git a/src/Resources/Themes.axaml b/src/Resources/Themes.axaml index aa0cbbb8..6326023a 100644 --- a/src/Resources/Themes.axaml +++ b/src/Resources/Themes.axaml @@ -83,7 +83,7 @@ - fonts:Inter#Inter, $Default + fonts:Inter#Inter fonts:SourceGit#JetBrains Mono fonts:SourceGit#JetBrains Mono
From 2f9e825b63274eba3330069f4015243aabf0a9c1 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 1 Nov 2024 18:10:22 +0800 Subject: [PATCH 0101/1283] refactor: pass Models.Commit instead of just sha of it Signed-off-by: leo --- src/ViewModels/ExecuteCustomAction.cs | 6 +++--- src/ViewModels/Histories.cs | 2 +- src/ViewModels/Repository.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ViewModels/ExecuteCustomAction.cs b/src/ViewModels/ExecuteCustomAction.cs index e8893f5a..920b9f43 100644 --- a/src/ViewModels/ExecuteCustomAction.cs +++ b/src/ViewModels/ExecuteCustomAction.cs @@ -10,12 +10,12 @@ namespace SourceGit.ViewModels private set; } - public ExecuteCustomAction(Repository repo, Models.CustomAction action, string sha) + public ExecuteCustomAction(Repository repo, Models.CustomAction action, Models.Commit commit) { _repo = repo; _args = action.Arguments.Replace("${REPO}", _repo.FullPath); - if (!string.IsNullOrEmpty(sha)) - _args = _args.Replace("${SHA}", sha); + if (commit != null) + _args = _args.Replace("${SHA}", commit.SHA); CustomAction = action; View = new Views.ExecuteCustomAction() { DataContext = this }; diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index fc973948..713e1635 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -626,7 +626,7 @@ namespace SourceGit.ViewModels item.Click += (_, e) => { if (PopupHost.CanCreatePopup()) - PopupHost.ShowAndStartPopup(new ExecuteCustomAction(_repo, action, commit.SHA)); + PopupHost.ShowAndStartPopup(new ExecuteCustomAction(_repo, dup, commit)); e.Handled = true; }; diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index ae24d5ef..9dd5ab9d 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -1310,7 +1310,7 @@ namespace SourceGit.ViewModels item.Click += (_, e) => { if (PopupHost.CanCreatePopup()) - PopupHost.ShowAndStartPopup(new ExecuteCustomAction(this, action, null)); + PopupHost.ShowAndStartPopup(new ExecuteCustomAction(this, dup, null)); e.Handled = true; }; From 174430338c7cc1b7829ffefca835a9711cd01673 Mon Sep 17 00:00:00 2001 From: AquariusStar <48148723+AquariusStar@users.noreply.github.com> Date: Sat, 2 Nov 2024 06:11:48 +0300 Subject: [PATCH 0102/1283] localiztion: update (#641) --- src/Resources/Locales/ru_RU.axaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index da689e1b..d2076099 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -111,6 +111,7 @@ Сравнить с рабочим деревом Копировать информацию Копировать SHA + Пользовательское действие Интерактивное перемещение ${0}$ сюда Переместить ${0}$ сюда Сбросить ${0}$ сюда @@ -142,6 +143,14 @@ ШАБЛОН ФИКСАЦИИ Имя шаблона: Шаблон содержания: + ПОЛЬЗОВАТЕЛЬСКОЕ ДЕЙСТВИЕ + Аргументы: + ${REPO} - Путь хранилища; ${SHA} - Выбранные фиксации SHA + Исполняемый фалй: + Имя: + Диапазон: + Фиксация + Хранилище Адрес электронной почты Адрес электронной почты GIT @@ -165,7 +174,7 @@ Если «Предпочитаемый сервис» установлен, SourceGit будет использовать только этот хранилище. В противном случае, если доступно более одной услуги, будет отображено контекстное меню для выбора одной из них. HTTP-прокси HTTP-прокси, используемый этим хранилищем - Имя пользовтаеля + Имя пользователя Имя пользователя для этого хранилища Рабочие пространства Имя @@ -256,6 +265,8 @@ Цель: Редактировать выбранную группу Редактировать выбранное хранилище + Выполнить пользовательское действие + Имя действия: Быстрая перемотка вперёд (без проверки) Извлечь Извлечь все внешние хранилища @@ -520,6 +531,8 @@ Очистить всё Настройка этого хранилища ПРОДОЛЖИТЬ + Изменить действия + Не изменять действия Разрешить опцию --reflog Открыть в файловом менеджере Поиск веток, меток и подмодулей From 1fecbbb37f493ebde61b154112f756a8e8cb69b2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 2 Nov 2024 03:12:01 +0000 Subject: [PATCH 0103/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 9f0d8cae..52383670 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-96.05%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-97.08%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.72%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.79%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-98.10%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-96.05%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-97.08%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.72%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.79%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 4b22ac57..b6c255a1 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -228,25 +228,13 @@ -### ru_RU.axaml: 98.10% +### ru_RU.axaml: 100.00%
Missing Keys -- Text.CommitCM.CustomAction -- Text.Configure.CustomAction -- Text.Configure.CustomAction.Arguments -- Text.Configure.CustomAction.Arguments.Tip -- Text.Configure.CustomAction.Executable -- Text.Configure.CustomAction.Name -- Text.Configure.CustomAction.Scope -- Text.Configure.CustomAction.Scope.Commit -- Text.Configure.CustomAction.Scope.Repository -- Text.ExecuteCustomAction -- Text.ExecuteCustomAction.Name -- Text.Repository.CustomActions -- Text.Repository.CustomActions.Empty +
From 794163fe1cb80a39e2b62f1abab2385199c4f180 Mon Sep 17 00:00:00 2001 From: Aliaksandr Liakhavets Date: Sun, 3 Nov 2024 04:25:32 +0300 Subject: [PATCH 0104/1283] Set default focus on password text box (#644) Co-authored-by: AleksandrLiakhavetsEPAM <97155822+AleksandrLiakhavetsEPAM@users.noreply.github.com> --- src/Views/Askpass.axaml | 4 +++- src/Views/Askpass.axaml.cs | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Views/Askpass.axaml b/src/Views/Askpass.axaml index 9a38c58f..e1d257ec 100644 --- a/src/Views/Askpass.axaml +++ b/src/Views/Askpass.axaml @@ -39,9 +39,11 @@ - Date: Sun, 3 Nov 2024 10:58:50 +0800 Subject: [PATCH 0105/1283] code_review: PR #644 - use `AutoFocusBehaviour.IsEnable` instead of toggle focus by code in `OnOpened ` Signed-off-by: leo --- src/Views/Askpass.axaml | 6 +++--- src/Views/Askpass.axaml.cs | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Views/Askpass.axaml b/src/Views/Askpass.axaml index e1d257ec..f2308805 100644 --- a/src/Views/Askpass.axaml +++ b/src/Views/Askpass.axaml @@ -39,15 +39,15 @@ - + HorizontalAlignment="Stretch" + v:AutoFocusBehaviour.IsEnabled="True"> Date: Sun, 3 Nov 2024 14:45:19 +0800 Subject: [PATCH 0106/1283] localization: update zh_TW.axaml (#645) --- src/Resources/Locales/zh_TW.axaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 4526cce5..77a832ff 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -58,7 +58,7 @@ 刪除所選的 {0} 個分支 捨棄所有變更 快轉 (fast-forward) 到 ${0}$ - 提取(fetch) ${0}$ 至 ${1}$... + 提取 (fetch) ${0}$ 到 ${1}$... Git 工作流 - 完成 ${0}$ 合併 ${0}$ 到 ${1}$... 拉取 (pull) ${0}$ @@ -144,10 +144,10 @@ 範本名稱: 範本內容: 自訂動作 - 指令行參數: - 使用${REPO}代表儲存庫的路徑,${SHA}代表所選的提交編號 + 指令參數: + 使用 ${REPO} 表示存放庫路徑、${SHA} 表示所選的提交編號 可執行檔案路徑: - 名稱 : + 名稱: 執行範圍: 選取的提交 存放庫 @@ -158,20 +158,20 @@ 分鐘 預設遠端存放庫 提交訊息追加署名 (--signoff) - 提取變更时啟用修剪(--prune) + 拉取變更時進行清理 (--prune) Issue 追蹤 新增符合 GitHub Issue 規則 新增符合 Jira 規則 新增符合 GitLab 議題規則 新增符合 GitLab 合併請求規則 新增自訂規則 - 符合 Issue 的正則表達式: + 符合 Issue 的正規表達式: 規則名稱: 為 Issue 產生的網址連結: - 可在網址中使用 $1、$2 等變數填入正則表示式相符的內容 - OPEN AI - 启用特定服务 : - 当【启用特定服务】被设置时,SourceGit将在本仓库中仅使用该服务。否则将弹出可用的OpenAI服务列表供用户选择。 + 可在網址中使用 $1、$2 等變數填入正規表達式相符的內容 + OpenAI + 偏好服務: + 設定 [偏好服務] 後,SourceGit 將於此存放庫中使用該服務,否則會顯示 OpenAI 服務列表供使用者選擇。 HTTP 代理 HTTP 網路代理 使用者名稱 From fba84c82978efcacee91cffbbc455aba331e8e9b Mon Sep 17 00:00:00 2001 From: Chiahong <36815907+ChiahongHong@users.noreply.github.com> Date: Sun, 3 Nov 2024 17:00:17 +0800 Subject: [PATCH 0107/1283] fix: prevent crash in Custom Action when executable path is missing (#646) --- src/Commands/ExecuteCustomAction.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands/ExecuteCustomAction.cs b/src/Commands/ExecuteCustomAction.cs index 0573aed9..253c6b43 100644 --- a/src/Commands/ExecuteCustomAction.cs +++ b/src/Commands/ExecuteCustomAction.cs @@ -45,6 +45,9 @@ namespace SourceGit.Commands try { proc.Start(); + proc.BeginOutputReadLine(); + proc.BeginErrorReadLine(); + proc.WaitForExit(); } catch (Exception e) { @@ -54,9 +57,6 @@ namespace SourceGit.Commands }); } - proc.BeginOutputReadLine(); - proc.BeginErrorReadLine(); - proc.WaitForExit(); proc.Close(); } } From 1d0098703e771d4368821c80bc6179561efc201b Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Mon, 4 Nov 2024 01:22:16 +0000 Subject: [PATCH 0108/1283] feature: add support for Visual Studio as external tool (#648) * feature: support Visual Studio external tool on Windows * feature: when opening in Visual Studio, try to locate solution file --- README.md | 1 + src/Models/ExternalTool.cs | 40 ++++++++++++++++++++++++++++++++------ src/Native/Windows.cs | 20 +++++++++++++++++++ 3 files changed, 55 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 52383670..44ed5917 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ This app supports open repository in external tools listed in the table below. | JetBrains Fleet | YES | YES | YES | FLEET | | Sublime Text | YES | YES | YES | SUBLIME_TEXT | | Zed | NO | YES | YES | ZED | +| Visual Studio | YES | YES | YES | VISUALSTUDIO | > [!NOTE] > This app will try to find those tools based on some pre-defined or expected locations automatically. If you are using one portable version of these tools, it will not be detected by this app. diff --git a/src/Models/ExternalTool.cs b/src/Models/ExternalTool.cs index b26a9a90..960ebde6 100644 --- a/src/Models/ExternalTool.cs +++ b/src/Models/ExternalTool.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Text.Json; using System.Text.Json.Serialization; @@ -16,12 +17,14 @@ namespace SourceGit.Models public string Executable { get; private set; } public string OpenCmdArgs { get; private set; } public Bitmap IconImage { get; private set; } = null; + public Func ArgTransform { get; private set; } - public ExternalTool(string name, string icon, string executable, string openCmdArgs) + public ExternalTool(string name, string icon, string executable, string openCmdArgs, Func argsTransform) { Name = name; Executable = executable; OpenCmdArgs = openCmdArgs; + ArgTransform = argsTransform ?? ((s) => s); try { @@ -37,11 +40,16 @@ namespace SourceGit.Models public void Open(string repo) { + string arguments = string.Format(OpenCmdArgs, repo); + + if (ArgTransform != null) + arguments = ArgTransform.Invoke(arguments); + Process.Start(new ProcessStartInfo() { WorkingDirectory = repo, FileName = Executable, - Arguments = string.Format(OpenCmdArgs, repo), + Arguments = arguments, UseShellExecute = false, }); } @@ -110,17 +118,17 @@ namespace SourceGit.Models _customPaths = new ExternalToolPaths(); } - public void TryAdd(string name, string icon, string args, string key, Func finder) + public void TryAdd(string name, string icon, string args, string key, Func finder, Func argsTransform = null) { if (_customPaths.Tools.TryGetValue(key, out var customPath) && File.Exists(customPath)) { - Founded.Add(new ExternalTool(name, icon, customPath, args)); + Founded.Add(new ExternalTool(name, icon, customPath, args, argsTransform)); } else { var path = finder(); if (!string.IsNullOrEmpty(path) && File.Exists(path)) - Founded.Add(new ExternalTool(name, icon, path, args)); + Founded.Add(new ExternalTool(name, icon, path, args, argsTransform)); } } @@ -154,6 +162,25 @@ namespace SourceGit.Models TryAdd("Zed", "zed", "\"{0}\"", "ZED", platformFinder); } + public void VisualStudio(Func platformFinder) + { + TryAdd("Visual Studio", "vs", "\"{0}\"", "VISUALSTUDIO", platformFinder, VisualStudioTryFindSolution); + } + + private static string VisualStudioTryFindSolution(string path) + { + try + { + if (Directory.GetFiles(path.Trim('\"'), "*.sln", SearchOption.AllDirectories).FirstOrDefault() is string solutionPath) + return Path.GetFullPath(solutionPath); + } + catch + { + // do nothing + } + return path; + } + public void FindJetBrainsFromToolbox(Func platformFinder) { var exclude = new List { "fleet", "dotmemory", "dottrace", "resharper-u", "androidstudio" }; @@ -171,7 +198,8 @@ namespace SourceGit.Models $"{tool.DisplayName} {tool.DisplayVersion}", supported_icons.Contains(tool.ProductCode) ? $"JetBrains/{tool.ProductCode}" : "JetBrains/JB", Path.Combine(tool.InstallLocation, tool.LaunchCommand), - "\"{0}\"")); + "\"{0}\"", + null)); } } } diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs index 6ca0bbb0..0563644c 100644 --- a/src/Native/Windows.cs +++ b/src/Native/Windows.cs @@ -134,6 +134,7 @@ namespace SourceGit.Native finder.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\Programs\\Fleet\\Fleet.exe"); finder.FindJetBrainsFromToolbox(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\JetBrains\\Toolbox"); finder.SublimeText(FindSublimeText); + finder.VisualStudio(FindVisualStudio); return finder.Founded; } @@ -313,6 +314,25 @@ namespace SourceGit.Native return string.Empty; } + + private string FindVisualStudio() + { + var localMachine = Microsoft.Win32.RegistryKey.OpenBaseKey( + Microsoft.Win32.RegistryHive.LocalMachine, + Microsoft.Win32.RegistryView.Registry64); + + // Get default class for VisualStudio.Launcher.sln - the handler for *.sln files + if (localMachine.OpenSubKey(@"SOFTWARE\Classes\VisualStudio.Launcher.sln\CLSID") is Microsoft.Win32.RegistryKey launcher) + { + // Get actual path to the executable + if (launcher.GetValue(string.Empty) is string CLSID && localMachine.OpenSubKey(@$"SOFTWARE\Classes\CLSID\{CLSID}\LocalServer32") is Microsoft.Win32.RegistryKey devenv && devenv.GetValue(string.Empty) is string localServer32) + { + return localServer32!.Trim('\"'); + } + } + + return string.Empty; + } #endregion private void OpenFolderAndSelectFile(string folderPath) From 6b348fbd1a9ecc9f42fc0247ef508de96cadf346 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 10:02:20 +0800 Subject: [PATCH 0109/1283] code_review!: PR #648 * rewrite `Models.ExternalTool` to use `_execArgsGenerator` instead of `OpenCmdArgs` and `ArgTransform` * remove dependency of `System.Linq` due to AOT limitations * since the `Visual Studio` is only available on Windows, use `TryAdd` directly. * update `README.md` BREAKING CHANGE: now the key in `external_editors.json` uses the same name with external tool. Signed-off-by: leo --- README.md | 20 ++++++------ src/Models/ExternalTool.cs | 66 +++++++++++--------------------------- src/Native/Windows.cs | 32 ++++++++++++++++-- 3 files changed, 59 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 44ed5917..6a688d99 100644 --- a/README.md +++ b/README.md @@ -119,15 +119,15 @@ For other AI service: This app supports open repository in external tools listed in the table below. -| Tool | Windows | macOS | Linux | KEY IN `external_editors.json` | -|-------------------------------|---------|-------|-------|--------------------------------| -| Visual Studio Code | YES | YES | YES | VSCODE | -| Visual Studio Code - Insiders | YES | YES | YES | VSCODE_INSIDERS | -| VSCodium | YES | YES | YES | VSCODIUM | -| JetBrains Fleet | YES | YES | YES | FLEET | -| Sublime Text | YES | YES | YES | SUBLIME_TEXT | -| Zed | NO | YES | YES | ZED | -| Visual Studio | YES | YES | YES | VISUALSTUDIO | +| Tool | Windows | macOS | Linux | +|-------------------------------|---------|-------|-------| +| Visual Studio Code | YES | YES | YES | +| Visual Studio Code - Insiders | YES | YES | YES | +| VSCodium | YES | YES | YES | +| Fleet | YES | YES | YES | +| Sublime Text | YES | YES | YES | +| Zed | NO | YES | YES | +| Visual Studio | YES | NO | NO | > [!NOTE] > This app will try to find those tools based on some pre-defined or expected locations automatically. If you are using one portable version of these tools, it will not be detected by this app. @@ -135,7 +135,7 @@ This app supports open repository in external tools listed in the table below. ```json { "tools": { - "VSCODE": "D:\\VSCode\\Code.exe" + "Visual Studio Code": "D:\\VSCode\\Code.exe" } } ``` diff --git a/src/Models/ExternalTool.cs b/src/Models/ExternalTool.cs index 960ebde6..103e91bc 100644 --- a/src/Models/ExternalTool.cs +++ b/src/Models/ExternalTool.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Linq; using System.Text.Json; using System.Text.Json.Serialization; @@ -14,17 +13,13 @@ namespace SourceGit.Models public class ExternalTool { public string Name { get; private set; } - public string Executable { get; private set; } - public string OpenCmdArgs { get; private set; } public Bitmap IconImage { get; private set; } = null; - public Func ArgTransform { get; private set; } - public ExternalTool(string name, string icon, string executable, string openCmdArgs, Func argsTransform) + public ExternalTool(string name, string icon, string execFile, Func execArgsGenerator = null) { Name = name; - Executable = executable; - OpenCmdArgs = openCmdArgs; - ArgTransform = argsTransform ?? ((s) => s); + _execFile = execFile; + _execArgsGenerator = execArgsGenerator ?? (repo => $"\"{repo}\""); try { @@ -40,19 +35,17 @@ namespace SourceGit.Models public void Open(string repo) { - string arguments = string.Format(OpenCmdArgs, repo); - - if (ArgTransform != null) - arguments = ArgTransform.Invoke(arguments); - Process.Start(new ProcessStartInfo() { WorkingDirectory = repo, - FileName = Executable, - Arguments = arguments, + FileName = _execFile, + Arguments = _execArgsGenerator.Invoke(repo), UseShellExecute = false, }); } + + private string _execFile = string.Empty; + private Func _execArgsGenerator = null; } public class JetBrainsState @@ -118,67 +111,48 @@ namespace SourceGit.Models _customPaths = new ExternalToolPaths(); } - public void TryAdd(string name, string icon, string args, string key, Func finder, Func argsTransform = null) + public void TryAdd(string name, string icon, Func finder, Func execArgsGenerator = null) { - if (_customPaths.Tools.TryGetValue(key, out var customPath) && File.Exists(customPath)) + if (_customPaths.Tools.TryGetValue(name, out var customPath) && File.Exists(customPath)) { - Founded.Add(new ExternalTool(name, icon, customPath, args, argsTransform)); + Founded.Add(new ExternalTool(name, icon, customPath, execArgsGenerator)); } else { var path = finder(); if (!string.IsNullOrEmpty(path) && File.Exists(path)) - Founded.Add(new ExternalTool(name, icon, path, args, argsTransform)); + Founded.Add(new ExternalTool(name, icon, path, execArgsGenerator)); } } public void VSCode(Func platformFinder) { - TryAdd("Visual Studio Code", "vscode", "\"{0}\"", "VSCODE", platformFinder); + TryAdd("Visual Studio Code", "vscode", platformFinder); } public void VSCodeInsiders(Func platformFinder) { - TryAdd("Visual Studio Code - Insiders", "vscode_insiders", "\"{0}\"", "VSCODE_INSIDERS", platformFinder); + TryAdd("Visual Studio Code - Insiders", "vscode_insiders", platformFinder); } public void VSCodium(Func platformFinder) { - TryAdd("VSCodium", "codium", "\"{0}\"", "VSCODIUM", platformFinder); + TryAdd("VSCodium", "codium", platformFinder); } public void Fleet(Func platformFinder) { - TryAdd("Fleet", "fleet", "\"{0}\"", "FLEET", platformFinder); + TryAdd("Fleet", "fleet", platformFinder); } public void SublimeText(Func platformFinder) { - TryAdd("Sublime Text", "sublime_text", "\"{0}\"", "SUBLIME_TEXT", platformFinder); + TryAdd("Sublime Text", "sublime_text", platformFinder); } public void Zed(Func platformFinder) { - TryAdd("Zed", "zed", "\"{0}\"", "ZED", platformFinder); - } - - public void VisualStudio(Func platformFinder) - { - TryAdd("Visual Studio", "vs", "\"{0}\"", "VISUALSTUDIO", platformFinder, VisualStudioTryFindSolution); - } - - private static string VisualStudioTryFindSolution(string path) - { - try - { - if (Directory.GetFiles(path.Trim('\"'), "*.sln", SearchOption.AllDirectories).FirstOrDefault() is string solutionPath) - return Path.GetFullPath(solutionPath); - } - catch - { - // do nothing - } - return path; + TryAdd("Zed", "zed", platformFinder); } public void FindJetBrainsFromToolbox(Func platformFinder) @@ -197,9 +171,7 @@ namespace SourceGit.Models Founded.Add(new ExternalTool( $"{tool.DisplayName} {tool.DisplayVersion}", supported_icons.Contains(tool.ProductCode) ? $"JetBrains/{tool.ProductCode}" : "JetBrains/JB", - Path.Combine(tool.InstallLocation, tool.LaunchCommand), - "\"{0}\"", - null)); + Path.Combine(tool.InstallLocation, tool.LaunchCommand))); } } } diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs index 0563644c..a57d26d2 100644 --- a/src/Native/Windows.cs +++ b/src/Native/Windows.cs @@ -134,7 +134,7 @@ namespace SourceGit.Native finder.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\Programs\\Fleet\\Fleet.exe"); finder.FindJetBrainsFromToolbox(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\JetBrains\\Toolbox"); finder.SublimeText(FindSublimeText); - finder.VisualStudio(FindVisualStudio); + finder.TryAdd("Visual Studio", "vs", FindVisualStudio, GenerateCommandlineArgsForVisualStudio); return finder.Founded; } @@ -325,7 +325,9 @@ namespace SourceGit.Native if (localMachine.OpenSubKey(@"SOFTWARE\Classes\VisualStudio.Launcher.sln\CLSID") is Microsoft.Win32.RegistryKey launcher) { // Get actual path to the executable - if (launcher.GetValue(string.Empty) is string CLSID && localMachine.OpenSubKey(@$"SOFTWARE\Classes\CLSID\{CLSID}\LocalServer32") is Microsoft.Win32.RegistryKey devenv && devenv.GetValue(string.Empty) is string localServer32) + if (launcher.GetValue(string.Empty) is string CLSID && + localMachine.OpenSubKey(@$"SOFTWARE\Classes\CLSID\{CLSID}\LocalServer32") is Microsoft.Win32.RegistryKey devenv && + devenv.GetValue(string.Empty) is string localServer32) { return localServer32!.Trim('\"'); } @@ -348,5 +350,31 @@ namespace SourceGit.Native ILFree(pidl); } } + + private string GenerateCommandlineArgsForVisualStudio(string repo) + { + var sln = FindVSSolutionFile(repo, 4); + return string.IsNullOrEmpty(sln) ? $"\"{repo}\"" : $"\"{sln}\""; + } + + private string FindVSSolutionFile(string path, int leftDepth) + { + var found = Directory.GetFiles(path, "*.sln", SearchOption.TopDirectoryOnly); + if (found != null && found.Length > 0) + return Path.GetFullPath(found[0]); + + if (leftDepth <= 0) + return null; + + var subfolders = Directory.GetDirectories(path); + foreach (var subfolder in subfolders) + { + var first = FindVSSolutionFile(subfolder, leftDepth - 1); + if (!string.IsNullOrEmpty(first)) + return first; + } + + return null; + } } } From 5966b8ac08c2b53e5e956ab69df906c186bcc65c Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 10:06:51 +0800 Subject: [PATCH 0110/1283] version: Release 8.37 Signed-off-by: leo --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f42a1bc8..a5e93156 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.36 \ No newline at end of file +8.37 \ No newline at end of file From 310c78669384cae551f2c22dab67fa58d39a15b7 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 11:54:18 +0800 Subject: [PATCH 0111/1283] feature: ignore case when finding visual studio solution file Signed-off-by: leo --- src/Native/Windows.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs index a57d26d2..3c56edd3 100644 --- a/src/Native/Windows.cs +++ b/src/Native/Windows.cs @@ -353,23 +353,26 @@ namespace SourceGit.Native private string GenerateCommandlineArgsForVisualStudio(string repo) { - var sln = FindVSSolutionFile(repo, 4); + var sln = FindVSSolutionFile(new DirectoryInfo(repo), 4); return string.IsNullOrEmpty(sln) ? $"\"{repo}\"" : $"\"{sln}\""; } - private string FindVSSolutionFile(string path, int leftDepth) + private string FindVSSolutionFile(DirectoryInfo dir, int leftDepth) { - var found = Directory.GetFiles(path, "*.sln", SearchOption.TopDirectoryOnly); - if (found != null && found.Length > 0) - return Path.GetFullPath(found[0]); + var files = dir.GetFiles(); + foreach (var f in files) + { + if (f.Name.EndsWith(".sln", StringComparison.OrdinalIgnoreCase)) + return f.FullName; + } if (leftDepth <= 0) return null; - var subfolders = Directory.GetDirectories(path); - foreach (var subfolder in subfolders) + var subDirs = dir.GetDirectories(); + foreach (var subDir in subDirs) { - var first = FindVSSolutionFile(subfolder, leftDepth - 1); + var first = FindVSSolutionFile(subDir, leftDepth - 1); if (!string.IsNullOrEmpty(first)) return first; } From 64860950c776d17fb929546ec46e05e52f527ad5 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 12:03:47 +0800 Subject: [PATCH 0112/1283] localization: update en_US Signed-off-by: leo --- src/Resources/Locales/en_US.axaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 2e96e391..b9371f2e 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -274,7 +274,7 @@ Discard {0} files... Discard Changes in Selected Line(s) Open External Merge Tool - Save As Patch... + Save as Patch... Stage Stage {0} files Stage Changes in Selected Line(s) @@ -398,7 +398,7 @@ Name: Git has NOT been configured. Please to go [Preference] and configure it first. Open App Data Dir - Open With... + Open with... Optional. Create New Page Bookmark @@ -530,15 +530,15 @@ Custom Actions No Custom Actions Enable '--reflog' Option - Open In File Browser + Open in File Browser Search Branches/Tags/Submodules FILTERED BY: LOCAL BRANCHES - Navigate To HEAD + Navigate to HEAD Enable '--first-parent' Option Create Branch - Open In {0} - Open In External Tools + Open in {0} + Open in External Tools Refresh REMOTES ADD REMOTE @@ -556,7 +556,7 @@ UPDATE SUBMODULE TAGS NEW TAG - Open In Terminal + Open in Terminal WORKTREES ADD WORKTREE PRUNE From 163e8cc0a4f70c9d760b3cfb751d2791f512c65d Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 15:31:55 +0800 Subject: [PATCH 0113/1283] feature: add context menu for issue link in commit details panel (#651) Signed-off-by: leo --- src/Models/CustomAction.cs | 2 +- src/Native/Windows.cs | 4 +-- src/Resources/Locales/en_US.axaml | 2 ++ src/Views/Blame.axaml.cs | 2 +- src/Views/BranchCompare.axaml.cs | 2 +- src/Views/BranchTree.axaml.cs | 6 ++--- src/Views/CommitBaseInfo.axaml.cs | 4 +-- src/Views/CommitChanges.axaml.cs | 2 +- src/Views/CommitDetail.axaml.cs | 2 +- src/Views/CommitMessagePresenter.cs | 36 ++++++++++++++++++++++++- src/Views/ContextMenuExtension.cs | 26 ------------------ src/Views/Histories.axaml.cs | 2 +- src/Views/Launcher.axaml.cs | 2 +- src/Views/LauncherTabBar.axaml.cs | 2 +- src/Views/Repository.axaml.cs | 4 +-- src/Views/RepositoryToolbar.axaml.cs | 14 +++++----- src/Views/RevisionCompare.axaml.cs | 2 +- src/Views/RevisionFileTreeView.axaml.cs | 2 +- src/Views/RevisionFiles.axaml.cs | 2 +- src/Views/StashesPage.axaml.cs | 4 +-- src/Views/TagsView.axaml.cs | 2 +- src/Views/TextDiffView.axaml.cs | 2 +- src/Views/Welcome.axaml.cs | 2 +- src/Views/WorkingCopy.axaml.cs | 14 +++++----- 24 files changed, 76 insertions(+), 66 deletions(-) delete mode 100644 src/Views/ContextMenuExtension.cs diff --git a/src/Models/CustomAction.cs b/src/Models/CustomAction.cs index 2a400b02..8452a42d 100644 --- a/src/Models/CustomAction.cs +++ b/src/Models/CustomAction.cs @@ -30,7 +30,7 @@ namespace SourceGit.Models public string Arguments { - get => _arguments; + get => _arguments; set => SetProperty(ref _arguments, value); } diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs index 3c56edd3..48fbb287 100644 --- a/src/Native/Windows.cs +++ b/src/Native/Windows.cs @@ -325,8 +325,8 @@ namespace SourceGit.Native if (localMachine.OpenSubKey(@"SOFTWARE\Classes\VisualStudio.Launcher.sln\CLSID") is Microsoft.Win32.RegistryKey launcher) { // Get actual path to the executable - if (launcher.GetValue(string.Empty) is string CLSID && - localMachine.OpenSubKey(@$"SOFTWARE\Classes\CLSID\{CLSID}\LocalServer32") is Microsoft.Win32.RegistryKey devenv && + if (launcher.GetValue(string.Empty) is string CLSID && + localMachine.OpenSubKey(@$"SOFTWARE\Classes\CLSID\{CLSID}\LocalServer32") is Microsoft.Win32.RegistryKey devenv && devenv.GetValue(string.Empty) is string localServer32) { return localServer32!.Trim('\"'); diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index b9371f2e..15c8b6ee 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -387,6 +387,8 @@ Interactive Rebase Target Branch: On: + Open in Browser + Copy Link ERROR NOTICE Merge Branch diff --git a/src/Views/Blame.axaml.cs b/src/Views/Blame.axaml.cs index 164b89de..d32e4370 100644 --- a/src/Views/Blame.axaml.cs +++ b/src/Views/Blame.axaml.cs @@ -407,8 +407,8 @@ namespace SourceGit.Views var menu = new ContextMenu(); menu.Items.Add(copy); + menu.Open(TextArea.TextView); - TextArea.TextView.OpenContextMenu(menu); e.Handled = true; } diff --git a/src/Views/BranchCompare.axaml.cs b/src/Views/BranchCompare.axaml.cs index 90ec1af5..ca90a180 100644 --- a/src/Views/BranchCompare.axaml.cs +++ b/src/Views/BranchCompare.axaml.cs @@ -15,7 +15,7 @@ namespace SourceGit.Views if (DataContext is ViewModels.BranchCompare vm && sender is ChangeCollectionView view) { var menu = vm.CreateChangeContextMenu(); - view.OpenContextMenu(menu); + menu?.Open(view); } e.Handled = true; diff --git a/src/Views/BranchTree.axaml.cs b/src/Views/BranchTree.axaml.cs index 081160d0..e96b2594 100644 --- a/src/Views/BranchTree.axaml.cs +++ b/src/Views/BranchTree.axaml.cs @@ -374,7 +374,7 @@ namespace SourceGit.Views if (selected.Count == 1 && selected[0] is ViewModels.BranchTreeNode { Backend: Models.Remote remote }) { var menu = repo.CreateContextMenuForRemote(remote); - this.OpenContextMenu(menu); + menu?.Open(this); return; } @@ -391,7 +391,7 @@ namespace SourceGit.Views var menu = branch.IsLocal ? repo.CreateContextMenuForLocalBranch(branch) : repo.CreateContextMenuForRemoteBranch(branch); - this.OpenContextMenu(menu); + menu?.Open(this); } else if (branches.Find(x => x.IsCurrent) == null) { @@ -405,7 +405,7 @@ namespace SourceGit.Views ev.Handled = true; }; menu.Items.Add(deleteMulti); - this.OpenContextMenu(menu); + menu?.Open(this); } } diff --git a/src/Views/CommitBaseInfo.axaml.cs b/src/Views/CommitBaseInfo.axaml.cs index e31ddfba..7992b40d 100644 --- a/src/Views/CommitBaseInfo.axaml.cs +++ b/src/Views/CommitBaseInfo.axaml.cs @@ -68,7 +68,7 @@ namespace SourceGit.Views private void OnOpenWebLink(object sender, RoutedEventArgs e) { - if (DataContext is ViewModels.CommitDetail detail) + if (DataContext is ViewModels.CommitDetail detail && sender is Control control) { var links = WebLinks; if (links.Count > 1) @@ -88,7 +88,7 @@ namespace SourceGit.Views menu.Items.Add(item); } - (sender as Control)?.OpenContextMenu(menu); + menu?.Open(control); } else if (links.Count == 1) { diff --git a/src/Views/CommitChanges.axaml.cs b/src/Views/CommitChanges.axaml.cs index f197bdd5..c3d30018 100644 --- a/src/Views/CommitChanges.axaml.cs +++ b/src/Views/CommitChanges.axaml.cs @@ -16,7 +16,7 @@ namespace SourceGit.Views DataContext is ViewModels.CommitDetail vm) { var menu = vm.CreateChangeContextMenu(selected[0]); - view.OpenContextMenu(menu); + menu?.Open(view); } e.Handled = true; diff --git a/src/Views/CommitDetail.axaml.cs b/src/Views/CommitDetail.axaml.cs index 999d1c07..f0599c66 100644 --- a/src/Views/CommitDetail.axaml.cs +++ b/src/Views/CommitDetail.axaml.cs @@ -26,7 +26,7 @@ namespace SourceGit.Views if (DataContext is ViewModels.CommitDetail detail && sender is Grid grid && grid.DataContext is Models.Change change) { var menu = detail.CreateChangeContextMenu(change); - grid.OpenContextMenu(menu); + menu?.Open(grid); } e.Handled = true; diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index 55e1dfb1..112c1f57 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -176,7 +176,41 @@ namespace SourceGit.Views } else { - Native.OS.OpenBrowser(_lastHover.Link); + var point = e.GetCurrentPoint(this); + var link = _lastHover.Link; + + if (point.Properties.IsLeftButtonPressed) + { + Native.OS.OpenBrowser(link); + } + else if (point.Properties.IsRightButtonPressed) + { + var open = new MenuItem(); + open.Header = App.Text("IssueLinkCM.OpenInBrowser"); + open.Icon = App.CreateMenuIcon("Icons.OpenWith"); + open.Click += (_, ev) => + { + ev.Handled = true; + + var parentView = this.FindAncestorOfType(); + if (parentView is { DataContext: ViewModels.CommitDetail detail }) + detail.NavigateTo(link); + }; + + var copy = new MenuItem(); + copy.Header = App.Text("IssueLinkCM.CopyLink"); + copy.Icon = App.CreateMenuIcon("Icons.Copy"); + copy.Click += (_, ev) => + { + App.CopyText(link); + ev.Handled = true; + }; + + var menu = new ContextMenu(); + menu.Items.Add(open); + menu.Items.Add(copy); + menu.Open(this); + } } e.Handled = true; diff --git a/src/Views/ContextMenuExtension.cs b/src/Views/ContextMenuExtension.cs deleted file mode 100644 index 2abcf2b9..00000000 --- a/src/Views/ContextMenuExtension.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel; -using Avalonia.Controls; - -namespace SourceGit.Views -{ - public static class ContextMenuExtension - { - public static void OpenContextMenu(this Control control, ContextMenu menu) - { - if (menu == null) - return; - - menu.PlacementTarget = control; - menu.Closing += OnContextMenuClosing; // Clear context menu because it is dynamic. - - control.ContextMenu = menu; - control.ContextMenu?.Open(); - } - - private static void OnContextMenuClosing(object sender, CancelEventArgs e) - { - if (sender is ContextMenu menu && menu.PlacementTarget != null) - menu.PlacementTarget.ContextMenu = null; - } - } -} diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index 137fd298..43258dd7 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -706,7 +706,7 @@ namespace SourceGit.Views if (DataContext is ViewModels.Histories histories && sender is ListBox { SelectedItems: { Count: > 0 } } list) { var menu = histories.MakeContextMenu(list); - list.OpenContextMenu(menu); + menu?.Open(list); } e.Handled = true; } diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index b4a44868..99916da3 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -250,7 +250,7 @@ namespace SourceGit.Views if (sender is Button btn && DataContext is ViewModels.Launcher launcher) { var menu = launcher.CreateContextForWorkspace(); - btn.OpenContextMenu(menu); + menu?.Open(btn); } e.Handled = true; diff --git a/src/Views/LauncherTabBar.axaml.cs b/src/Views/LauncherTabBar.axaml.cs index 3258a09c..f8c9107c 100644 --- a/src/Views/LauncherTabBar.axaml.cs +++ b/src/Views/LauncherTabBar.axaml.cs @@ -234,7 +234,7 @@ namespace SourceGit.Views if (sender is Border border && DataContext is ViewModels.Launcher vm) { var menu = vm.CreateContextForPageTab(border.DataContext as ViewModels.LauncherPage); - border.OpenContextMenu(menu); + menu?.Open(border); } e.Handled = true; diff --git a/src/Views/Repository.axaml.cs b/src/Views/Repository.axaml.cs index 499f5e62..dec3d447 100644 --- a/src/Views/Repository.axaml.cs +++ b/src/Views/Repository.axaml.cs @@ -189,7 +189,7 @@ namespace SourceGit.Views if (sender is ListBox { SelectedItem: Models.Submodule submodule } grid && DataContext is ViewModels.Repository repo) { var menu = repo.CreateContextMenuForSubmodule(submodule.Path); - grid.OpenContextMenu(menu); + menu?.Open(grid); } e.Handled = true; @@ -210,7 +210,7 @@ namespace SourceGit.Views if (sender is ListBox { SelectedItem: Models.Worktree worktree } grid && DataContext is ViewModels.Repository repo) { var menu = repo.CreateContextMenuForWorktree(worktree); - grid.OpenContextMenu(menu); + menu?.Open(grid); } e.Handled = true; diff --git a/src/Views/RepositoryToolbar.axaml.cs b/src/Views/RepositoryToolbar.axaml.cs index 55132620..a4a05dc4 100644 --- a/src/Views/RepositoryToolbar.axaml.cs +++ b/src/Views/RepositoryToolbar.axaml.cs @@ -17,7 +17,7 @@ namespace SourceGit.Views if (sender is Button button && DataContext is ViewModels.Repository repo) { var menu = repo.CreateContextMenuForExternalTools(); - button.OpenContextMenu(menu); + menu?.Open(button); e.Handled = true; } } @@ -72,10 +72,10 @@ namespace SourceGit.Views private void OpenGitFlowMenu(object sender, RoutedEventArgs e) { - if (DataContext is ViewModels.Repository repo) + if (DataContext is ViewModels.Repository repo && sender is Control control) { var menu = repo.CreateContextMenuForGitFlow(); - (sender as Control)?.OpenContextMenu(menu); + menu?.Open(control); } e.Handled = true; @@ -83,10 +83,10 @@ namespace SourceGit.Views private void OpenGitLFSMenu(object sender, RoutedEventArgs e) { - if (DataContext is ViewModels.Repository repo) + if (DataContext is ViewModels.Repository repo && sender is Control control) { var menu = repo.CreateContextMenuForGitLFS(); - (sender as Control)?.OpenContextMenu(menu); + menu?.Open(control); } e.Handled = true; @@ -94,10 +94,10 @@ namespace SourceGit.Views private void OpenCustomActionMenu(object sender, RoutedEventArgs e) { - if (DataContext is ViewModels.Repository repo) + if (DataContext is ViewModels.Repository repo && sender is Control control) { var menu = repo.CreateContextMenuForCustomAction(); - (sender as Control)?.OpenContextMenu(menu); + menu?.Open(control); } e.Handled = true; diff --git a/src/Views/RevisionCompare.axaml.cs b/src/Views/RevisionCompare.axaml.cs index e3ecb2b7..b484b78f 100644 --- a/src/Views/RevisionCompare.axaml.cs +++ b/src/Views/RevisionCompare.axaml.cs @@ -15,7 +15,7 @@ namespace SourceGit.Views if (DataContext is ViewModels.RevisionCompare vm && sender is ChangeCollectionView view) { var menu = vm.CreateChangeContextMenu(); - view.OpenContextMenu(menu); + menu?.Open(view); } e.Handled = true; diff --git a/src/Views/RevisionFileTreeView.axaml.cs b/src/Views/RevisionFileTreeView.axaml.cs index e198f6f0..af9beb7d 100644 --- a/src/Views/RevisionFileTreeView.axaml.cs +++ b/src/Views/RevisionFileTreeView.axaml.cs @@ -229,7 +229,7 @@ namespace SourceGit.Views if (obj.Type != Models.ObjectType.Tree) { var menu = vm.CreateRevisionFileContextMenu(obj); - grid.OpenContextMenu(menu); + menu?.Open(grid); } } diff --git a/src/Views/RevisionFiles.axaml.cs b/src/Views/RevisionFiles.axaml.cs index b76e1360..53c36b1c 100644 --- a/src/Views/RevisionFiles.axaml.cs +++ b/src/Views/RevisionFiles.axaml.cs @@ -95,8 +95,8 @@ namespace SourceGit.Views var menu = new ContextMenu(); menu.Items.Add(copy); + menu.Open(TextArea.TextView); - TextArea.TextView.OpenContextMenu(menu); e.Handled = true; } diff --git a/src/Views/StashesPage.axaml.cs b/src/Views/StashesPage.axaml.cs index f3048889..af32cb2c 100644 --- a/src/Views/StashesPage.axaml.cs +++ b/src/Views/StashesPage.axaml.cs @@ -28,7 +28,7 @@ namespace SourceGit.Views if (DataContext is ViewModels.StashesPage vm && sender is Border border) { var menu = vm.MakeContextMenu(border.DataContext as Models.Stash); - border.OpenContextMenu(menu); + menu?.Open(border); } e.Handled = true; } @@ -38,7 +38,7 @@ namespace SourceGit.Views if (DataContext is ViewModels.StashesPage vm && sender is Grid grid) { var menu = vm.MakeContextMenuForChange(grid.DataContext as Models.Change); - grid.OpenContextMenu(menu); + menu?.Open(grid); } e.Handled = true; } diff --git a/src/Views/TagsView.axaml.cs b/src/Views/TagsView.axaml.cs index 29b591fb..8d4168b2 100644 --- a/src/Views/TagsView.axaml.cs +++ b/src/Views/TagsView.axaml.cs @@ -225,7 +225,7 @@ namespace SourceGit.Views if (selected != null && DataContext is ViewModels.Repository repo) { var menu = repo.CreateContextMenuForTag(selected); - control.OpenContextMenu(menu); + menu?.Open(control); } e.Handled = true; diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 63833fc1..99e499b0 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -589,8 +589,8 @@ namespace SourceGit.Views var menu = new ContextMenu(); menu.Items.Add(copy); + menu.Open(TextArea.TextView); - TextArea.TextView.OpenContextMenu(menu); e.Handled = true; } diff --git a/src/Views/Welcome.axaml.cs b/src/Views/Welcome.axaml.cs index a8045aa9..a292a6ef 100644 --- a/src/Views/Welcome.axaml.cs +++ b/src/Views/Welcome.axaml.cs @@ -117,7 +117,7 @@ namespace SourceGit.Views if (sender is Grid { DataContext: ViewModels.RepositoryNode node } grid) { var menu = ViewModels.Welcome.Instance.CreateContextMenu(node); - grid.OpenContextMenu(menu); + menu?.Open(grid); e.Handled = true; } } diff --git a/src/Views/WorkingCopy.axaml.cs b/src/Views/WorkingCopy.axaml.cs index f64e1a30..df45a7f1 100644 --- a/src/Views/WorkingCopy.axaml.cs +++ b/src/Views/WorkingCopy.axaml.cs @@ -31,27 +31,27 @@ namespace SourceGit.Views { var menu = vm.CreateContextMenuForCommitMessages(); menu.Placement = PlacementMode.TopEdgeAlignedLeft; - button.OpenContextMenu(menu); + menu?.Open(button); e.Handled = true; } } private void OnUnstagedContextRequested(object sender, ContextRequestedEventArgs e) { - if (DataContext is ViewModels.WorkingCopy vm) + if (DataContext is ViewModels.WorkingCopy vm && sender is Control control) { var menu = vm.CreateContextMenuForUnstagedChanges(); - (sender as Control)?.OpenContextMenu(menu); + menu?.Open(control); e.Handled = true; } } private void OnStagedContextRequested(object sender, ContextRequestedEventArgs e) { - if (DataContext is ViewModels.WorkingCopy vm) + if (DataContext is ViewModels.WorkingCopy vm && sender is Control control) { var menu = vm.CreateContextMenuForStagedChanges(); - (sender as Control)?.OpenContextMenu(menu); + menu?.Open(control); e.Handled = true; } } @@ -136,10 +136,10 @@ namespace SourceGit.Views private void OnOpenOpenAIHelper(object sender, RoutedEventArgs e) { - if (DataContext is ViewModels.WorkingCopy vm) + if (DataContext is ViewModels.WorkingCopy vm && sender is Control control) { var menu = vm.CreateContextForOpenAI(); - (sender as Button)?.OpenContextMenu(menu); + menu?.Open(control); } e.Handled = true; From 25028efa4d246423f36e449b72107474e928e6a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 4 Nov 2024 07:32:24 +0000 Subject: [PATCH 0114/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 31 +++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6a688d99..2ae6a047 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-96.05%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-97.08%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.72%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.79%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.77%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-96.79%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.46%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.52%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.71%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.71%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.71%25-yellow)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index b6c255a1..7e7e9e2d 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 96.05% +### de_DE.axaml: 95.77%
@@ -24,6 +24,8 @@ - Text.Configure.OpenAI.Prefered.Tip - Text.ExecuteCustomAction - Text.ExecuteCustomAction.Name +- Text.IssueLinkCM.OpenInBrowser +- Text.IssueLinkCM.CopyLink - Text.Preference.AI.AnalyzeDiffPrompt - Text.Preference.AI.GenerateSubjectPrompt - Text.Preference.AI.Name @@ -34,7 +36,7 @@
-### es_ES.axaml: 97.08% +### es_ES.axaml: 96.79%
@@ -56,6 +58,8 @@ - Text.Configure.OpenAI.Prefered.Tip - Text.ExecuteCustomAction - Text.ExecuteCustomAction.Name +- Text.IssueLinkCM.OpenInBrowser +- Text.IssueLinkCM.CopyLink - Text.Preference.AI.Name - Text.Repository.CustomActions - Text.Repository.CustomActions.Empty @@ -63,7 +67,7 @@
-### fr_FR.axaml: 87.72% +### fr_FR.axaml: 87.46%
@@ -119,6 +123,8 @@ - Text.Histories.Tips.Prefix - Text.Hotkeys.Repo.CommitWithAutoStage - Text.Hotkeys.Repo.DiscardSelected +- Text.IssueLinkCM.OpenInBrowser +- Text.IssueLinkCM.CopyLink - Text.MoveRepositoryNode - Text.MoveRepositoryNode.Target - Text.Preference.AI @@ -156,7 +162,7 @@
-### pt_BR.axaml: 90.79% +### pt_BR.axaml: 90.52%
@@ -209,6 +215,8 @@ - Text.FileHistory.FileContent - Text.FileHistory.FileChange - Text.GitLFS.Locks.OnlyMine +- Text.IssueLinkCM.OpenInBrowser +- Text.IssueLinkCM.CopyLink - Text.MoveRepositoryNode - Text.MoveRepositoryNode.Target - Text.Preference.AI.Name @@ -228,32 +236,35 @@
-### ru_RU.axaml: 100.00% +### ru_RU.axaml: 99.71%
Missing Keys - +- Text.IssueLinkCM.OpenInBrowser +- Text.IssueLinkCM.CopyLink
-### zh_CN.axaml: 100.00% +### zh_CN.axaml: 99.71%
Missing Keys - +- Text.IssueLinkCM.OpenInBrowser +- Text.IssueLinkCM.CopyLink
-### zh_TW.axaml: 100.00% +### zh_TW.axaml: 99.71%
Missing Keys - +- Text.IssueLinkCM.OpenInBrowser +- Text.IssueLinkCM.CopyLink
From fb9e342ee03da1ae05d24cb818a1fa3708bab383 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 15:34:25 +0800 Subject: [PATCH 0115/1283] localization: add translations for zh_CN and zh_TW Signed-off-by: leo --- src/Resources/Locales/zh_CN.axaml | 2 ++ src/Resources/Locales/zh_TW.axaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 469a88bb..d0975d2e 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -390,6 +390,8 @@ 交互式变基 目标分支 : 起始提交 : + 在浏览器中访问 + 复制链接地址 出错了 系统提示 合并分支 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 77a832ff..4a121feb 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -390,6 +390,8 @@ 互動式重定基底 目標分支: 起始提交: + 在瀏覽器中存取網址 + 複製網址 發生錯誤 系統提示 合併分支 From 2f628b0f0652327390abd1e3dfcc4bf091bd32c5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 4 Nov 2024 07:35:07 +0000 Subject: [PATCH 0116/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2ae6a047..361f97e5 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.77%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-96.79%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.46%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.52%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.71%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.71%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.71%25-yellow)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.77%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-96.79%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.46%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.52%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.71%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 7e7e9e2d..48bf29a8 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -247,24 +247,22 @@ -### zh_CN.axaml: 99.71% +### zh_CN.axaml: 100.00%
Missing Keys -- Text.IssueLinkCM.OpenInBrowser -- Text.IssueLinkCM.CopyLink +
-### zh_TW.axaml: 99.71% +### zh_TW.axaml: 100.00%
Missing Keys -- Text.IssueLinkCM.OpenInBrowser -- Text.IssueLinkCM.CopyLink +
From 635396008dee70a9b94a45710a6dc06d82aca13f Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 15:48:28 +0800 Subject: [PATCH 0117/1283] fix: clicking `Open in Browser` context menu item of issue link does not work (#651) Signed-off-by: leo --- src/Views/CommitMessagePresenter.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index 112c1f57..862ce9e1 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -190,11 +190,8 @@ namespace SourceGit.Views open.Icon = App.CreateMenuIcon("Icons.OpenWith"); open.Click += (_, ev) => { + Native.OS.OpenBrowser(link); ev.Handled = true; - - var parentView = this.FindAncestorOfType(); - if (parentView is { DataContext: ViewModels.CommitDetail detail }) - detail.NavigateTo(link); }; var copy = new MenuItem(); From ad01eb442d2b8e184e8dbca718f16a38816d9592 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 16:00:40 +0800 Subject: [PATCH 0118/1283] localization: change `OpenAI` to `AI` Signed-off-by: leo --- src/Resources/Locales/en_US.axaml | 6 +++--- src/Resources/Locales/zh_CN.axaml | 8 ++++---- src/Resources/Locales/zh_TW.axaml | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 15c8b6ee..eeecbb35 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -18,8 +18,8 @@ Optional. Default is the destination folder name. Track Branch: Tracking remote branch - OpenAI Assistant - Use OpenAI to generate commit message + AI Assistant + Use AI to generate commit message Patch Error Raise errors and refuses to apply the patch @@ -166,7 +166,7 @@ Rule Name: Result URL: Please use $1, $2 to access regex groups values. - OPEN AI + AI Prefered Service: If the 'Prefered Service' is set, SourceGit will only use it in this repository. Otherwise, if there is more than one service available, a context menu to choose one of them will be shown. HTTP Proxy diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index d0975d2e..19f07073 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -21,8 +21,8 @@ 选填。默认使用目标文件夹名称。 跟踪分支 设置上游跟踪分支 - OpenAI助手 - 使用OpenAI助手生成提交信息 + AI助手 + 使用AI助手生成提交信息 应用补丁(apply) 错误 输出错误,并终止应用补丁 @@ -169,9 +169,9 @@ 规则名 : 为ISSUE生成的URL链接 : 可在URL中使用$1,$2等变量填入正则表达式匹配的内容 - OPEN AI + AI 启用特定服务 : - 当【启用特定服务】被设置时,SourceGit将在本仓库中仅使用该服务。否则将弹出可用的OpenAI服务列表供用户选择。 + 当【启用特定服务】被设置时,SourceGit将在本仓库中仅使用该服务。否则将弹出可用的AI服务列表供用户选择。 HTTP代理 HTTP网络代理 用户名 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 4a121feb..2ff3db37 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -21,8 +21,8 @@ 選填。預設使用目標資料夾名稱。 追蹤分支 設定遠端追蹤分支 - OpenAI 助理 - 使用 OpenAI 產生提交訊息 + AI 助理 + 使用 AI 產生提交訊息 套用修補檔 (apply patch) 錯誤 輸出錯誤,並中止套用修補檔 @@ -169,9 +169,9 @@ 規則名稱: 為 Issue 產生的網址連結: 可在網址中使用 $1、$2 等變數填入正規表達式相符的內容 - OpenAI + AI 偏好服務: - 設定 [偏好服務] 後,SourceGit 將於此存放庫中使用該服務,否則會顯示 OpenAI 服務列表供使用者選擇。 + 設定 [偏好服務] 後,SourceGit 將於此存放庫中使用該服務,否則會顯示 AI 服務列表供使用者選擇。 HTTP 代理 HTTP 網路代理 使用者名稱 @@ -423,7 +423,7 @@ 一年前 {0} 年前 偏好設定 - OpenAI + AI 伺服器 API 金鑰 模型 From 779b38be2847cb2e935abeb9b14c9c55f931129e Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 16:04:19 +0800 Subject: [PATCH 0119/1283] localization: change `OpenAI` to `AI` Signed-off-by: leo --- src/Resources/Locales/en_US.axaml | 2 +- src/Resources/Locales/zh_CN.axaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index eeecbb35..bed03b0a 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -420,7 +420,7 @@ Last year {0} years ago Preference - OPEN AI + AI Analyze Diff Prompt API Key Generate Subject Prompt diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 19f07073..c148c229 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -423,7 +423,7 @@ 一年前 {0}年前 偏好设置 - OPEN AI + AI Analyze Diff Prompt API密钥 Generate Subject Prompt From 1a8acbf934f82e0926497dca47ee5e55a47856f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20W?= <44604769+goran-w@users.noreply.github.com> Date: Mon, 4 Nov 2024 09:32:51 +0100 Subject: [PATCH 0120/1283] feature: diff - toggle show all lines (#615) (#652) * Renamed 1 of 2 SyncScrollOffset props, for clarity The property "SyncScrollOffset" in TextDiff is distinct from the one with the same name in TwoSideTextDiff. These two properties are used in separate (though slightly related) ways and are not really connected. The one in TwoSideTextDiff is mainly used to keep the scroll-pos of the two SingleSideTextDiffPresenter views in sync (aligned), while the one in TextDiff is used only to preserve/reset the scroll-pos in the single CombinedTextDiffPresenter view when (re)loading Diff Content (so not really syncing anything). To clarify this and to make the two properties more distinguishable, I renamed the one in TextDiff to simply "ScrollOffset". * Added icon and string for "Show All Lines" New StreamGeometry "Icons.Lines.All" using SVG path from "text_line_spacing_regular" at https://avaloniaui.github.io/icons.html. New String "Text.Diff.VisualLines.All" for en_US locale (no translations yet). * Implemented new TextDiff feature "Show All Lines" (toggle) * Added new ToggleButton in DiffView toolbar, visible when IsTextDiff, disabling the buttons "Increase/Decrease Number of Visible Lines" when on. * Added new Preference property "UseFullTextDiff". * Added StyledProperty "UseFullTextDiffProperty" in TextDiffView, with a DataTemplate binding to the corresponding preference property. * When changed, UseFullTextDiffProperty is handled identically as UseSideBySideDiffProperty (via new helper method RefreshContent(), for unification with OnDataContextChanged()). * Added new method DiffContext.ToggleFullTextDiff() for changing the preference property and reloading the diff content. * Implemented the new feature by overriding the "unified" (number of context lines) for Commands.Diff() with a very high number. NOTE: The number used (~1 billion) is supposed to be the highest one working on Mac, according to this forum comment: https://stackoverflow.com/questions/28727424/for-git-diff-is-there-a-uinfinity-option-to-show-the-whole-file#comment135202820_28846576 --- src/Models/DiffResult.cs | 2 +- src/Resources/Icons.axaml | 1 + src/Resources/Locales/en_US.axaml | 1 + src/ViewModels/DiffContext.cs | 15 ++++++- src/ViewModels/Preference.cs | 7 +++ src/Views/DiffView.axaml | 26 +++++++++-- src/Views/TextDiffView.axaml.cs | 72 +++++++++++++++++++------------ 7 files changed, 90 insertions(+), 34 deletions(-) diff --git a/src/Models/DiffResult.cs b/src/Models/DiffResult.cs index e7cecaa3..61255ae9 100644 --- a/src/Models/DiffResult.cs +++ b/src/Models/DiffResult.cs @@ -63,7 +63,7 @@ namespace SourceGit.Models { public string File { get; set; } = string.Empty; public List Lines { get; set; } = new List(); - public Vector SyncScrollOffset { get; set; } = Vector.Zero; + public Vector ScrollOffset { get; set; } = Vector.Zero; public int MaxLineNumber = 0; public string Repo { get; set; } = null; diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml index 6cf53d96..bd2e551b 100644 --- a/src/Resources/Icons.axaml +++ b/src/Resources/Icons.axaml @@ -65,6 +65,7 @@ M875 117H149C109 117 75 151 75 192v640c0 41 34 75 75 75h725c41 0 75-34 75-75V192c0-41-34-75-75-75zM139 832V192c0-6 4-11 11-11h331v661H149c-6 0-11-4-11-11zm747 0c0 6-4 11-11 11H544v-661H875c6 0 11 4 11 11v640z M875 117H149C109 117 75 151 75 192v640c0 41 34 75 75 75h725c41 0 75-34 75-75V192c0-41-34-75-75-75zm-725 64h725c6 0 11 4 11 11v288h-747V192c0-6 4-11 11-11zm725 661H149c-6 0-11-4-11-11V544h747V832c0 6-4 11-11 11z M40 9 15 23 15 31 9 28 9 20 34 5 24 0 0 14 0 34 25 48 25 28 49 14zM26 29 26 48 49 34 49 15z + M19,13 C19.4142,13 19.75,13.3358 19.75,13.75 L19.75,18.4393 L20.4697,17.7197 C20.7626,17.4268 21.2374,17.4268 21.5303,17.7197 C21.8232,18.0126 21.8232,18.4874 21.5303,18.7803 L19.5303,20.7803 C19.4584,20.8522 19.3755,20.9065 19.2871,20.9431 C19.2099,20.9751 19.1262,20.9946 19.0386,20.999 L19,21 L19,21 C18.8983,21 18.8013,20.9798 18.7129,20.9431 C18.6245,20.9065 18.5416,20.8522 18.4697,20.7803 L16.4697,18.7803 C16.1768,18.4874 16.1768,18.0126 16.4697,17.7197 C16.7626,17.4268 17.2374,17.4268 17.5303,17.7197 L18.25,18.4393 L18.25,13.75 C18.25,13.3358 18.5858,13 19,13 Z M11.25,18 C11.6642,18 12,18.3358 12,18.75 C12,19.1296833 11.7178347,19.4434889 11.3517677,19.4931531 L11.25,19.5 L2.75,19.5 C2.33579,19.5 2,19.1642 2,18.75 C2,18.3703167 2.28215688,18.0565111 2.64823019,18.0068469 L2.75,18 L11.25,18 Z M14.25,11.5 C14.6642,11.5 15,11.8358 15,12.25 C15,12.6642 14.6642,13 14.25,13 L2.75,13 C2.33579,13 2,12.6642 2,12.25 C2,11.8358 2.33579,11.5 2.75,11.5 L14.25,11.5 Z M19.0022,3 C19.1031,3.0003 19.1993,3.02051 19.2871,3.05691 C19.3755,3.09351 19.4584,3.14776 19.5303,3.21967 L21.5303,5.21967 C21.8232,5.51256 21.8232,5.98744 21.5303,6.28033 C21.2374,6.57322 20.7626,6.57322 20.4697,6.28033 L19.75,5.56066 L19.75,10.25 C19.75,10.6642 19.4142,11 19,11 C18.5858,11 18.25,10.6642 18.25,10.25 L18.25,5.56066 L17.5303,6.28033 C17.2374,6.57322 16.7626,6.57322 16.4697,6.28033 C16.1768,5.98744 16.1768,5.51256 16.4697,5.21967 L18.4697,3.21967 C18.58634,3.102974 18.731972,3.0327676 18.8834536,3.00906104 L19.0022,3 Z M11.25,5 C11.6642,5 12,5.33579 12,5.75 C12,6.16421 11.6642,6.5 11.25,6.5 L2.75,6.5 C2.33579,6.5 2,6.16421 2,5.75 C2,5.33579 2.33579,5 2.75,5 L11.25,5 Z M408 232C408 210 426 192 448 192h416a40 40 0 110 80H448a40 40 0 01-40-40zM408 512c0-22 18-40 40-40h416a40 40 0 110 80H448A40 40 0 01408 512zM448 752A40 40 0 00448 832h416a40 40 0 100-80H448zM32 480l132 0 0-128 64 0 0 128 132 0 0 64-132 0 0 128-64 0 0-128-132 0Z M408 232C408 210 426 192 448 192h416a40 40 0 110 80H448a40 40 0 01-40-40zM408 512c0-22 18-40 40-40h416a40 40 0 110 80H448A40 40 0 01408 512zM448 752A40 40 0 00448 832h416a40 40 0 100-80H448zM32 480l328 0 0 64-328 0Z M 968 418 l -95 94 c -59 59 -146 71 -218 37 L 874 331 a 64 64 0 0 0 0 -90 L 783 150 a 64 64 0 0 0 -90 0 L 475 368 c -34 -71 -22 -159 37 -218 l 94 -94 c 75 -75 196 -75 271 0 l 90 90 c 75 75 75 196 0 271 z M 332 693 a 64 64 0 0 1 0 -90 l 271 -271 c 25 -25 65 -25 90 0 s 25 65 0 90 L 422 693 a 64 64 0 0 1 -90 0 z M 151 783 l 90 90 a 64 64 0 0 0 90 0 l 218 -218 c 34 71 22 159 -37 218 l -86 94 a 192 192 0 0 1 -271 0 l -98 -98 a 192 192 0 0 1 0 -271 l 94 -86 c 59 -59 146 -71 218 -37 L 151 693 a 64 64 0 0 0 0 90 z diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index bed03b0a..eb1c6de3 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -246,6 +246,7 @@ Syntax Highlighting Line Word Wrap Open in Merge Tool + Show All Lines Decrease Number of Visible Lines Increase Number of Visible Lines SELECT FILE TO VIEW CHANGES diff --git a/src/ViewModels/DiffContext.cs b/src/ViewModels/DiffContext.cs index 1a48c8e0..cfb9fa79 100644 --- a/src/ViewModels/DiffContext.cs +++ b/src/ViewModels/DiffContext.cs @@ -78,6 +78,12 @@ namespace SourceGit.ViewModels LoadDiffContent(); } + public void ToggleFullTextDiff() + { + Preference.Instance.UseFullTextDiff = !Preference.Instance.UseFullTextDiff; + LoadDiffContent(); + } + public void IncrUnified() { UnifiedLines = _unifiedLines + 1; @@ -109,7 +115,12 @@ namespace SourceGit.ViewModels Task.Run(() => { - var latest = new Commands.Diff(_repo, _option, _unifiedLines, _ignoreWhitespace).Result(); + // NOTE: Here we override the UnifiedLines value (if UseFullTextDiff is on). + // There is no way to tell a git-diff to use "ALL lines of context", + // so instead we set a very high number for the "lines of context" parameter. + var numLines = Preference.Instance.UseFullTextDiff ? 999999999 : _unifiedLines; + + var latest = new Commands.Diff(_repo, _option, numLines, _ignoreWhitespace).Result(); var rs = null as object; if (latest.TextDiff != null) @@ -203,7 +214,7 @@ namespace SourceGit.ViewModels Dispatcher.UIThread.Post(() => { if (_content is Models.TextDiff old && rs is Models.TextDiff cur && old.File == cur.File) - cur.SyncScrollOffset = old.SyncScrollOffset; + cur.ScrollOffset = old.ScrollOffset; FileModeChange = latest.FileModeChange; Content = rs; diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index 2741650c..efd31b72 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -186,6 +186,12 @@ namespace SourceGit.ViewModels set => SetProperty(ref _showHiddenSymbolsInDiffView, value); } + public bool UseFullTextDiff + { + get => _useFullTextDiff; + set => SetProperty(ref _useFullTextDiff, value); + } + public Models.ChangeViewMode UnstagedChangeViewMode { get => _unstagedChangeViewMode; @@ -591,6 +597,7 @@ namespace SourceGit.ViewModels private bool _useSyntaxHighlighting = false; private bool _enableDiffViewWordWrap = false; private bool _showHiddenSymbolsInDiffView = false; + private bool _useFullTextDiff = false; private Models.ChangeViewMode _unstagedChangeViewMode = Models.ChangeViewMode.List; private Models.ChangeViewMode _stagedChangeViewMode = Models.ChangeViewMode.List; diff --git a/src/Views/DiffView.axaml b/src/Views/DiffView.axaml index 8ccc25bb..9109e504 100644 --- a/src/Views/DiffView.axaml +++ b/src/Views/DiffView.axaml @@ -34,11 +34,24 @@ + + + @@ -46,8 +59,13 @@ Width="32" Command="{Binding DecrUnified}" IsVisible="{Binding IsTextDiff}" - ToolTip.Tip="{DynamicResource Text.Diff.VisualLines.Decr}" - IsEnabled="{Binding UnifiedLines, Converter={x:Static c:IntConverters.IsGreaterThanFour}}"> + ToolTip.Tip="{DynamicResource Text.Diff.VisualLines.Decr}"> + + + + + + @@ -211,7 +229,9 @@ - + diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 99e499b0..02b753ba 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -902,7 +902,7 @@ namespace SourceGit.Views var scroller = this.FindDescendantOfType(); if (scroller != null) { - scroller.Bind(ScrollViewer.OffsetProperty, new Binding("SyncScrollOffset", BindingMode.TwoWay)); + scroller.Bind(ScrollViewer.OffsetProperty, new Binding("ScrollOffset", BindingMode.TwoWay)); scroller.GotFocus += OnTextViewScrollGotFocus; } } @@ -1205,6 +1205,15 @@ namespace SourceGit.Views set => SetValue(UseSideBySideDiffProperty, value); } + public static readonly StyledProperty UseFullTextDiffProperty = + AvaloniaProperty.Register(nameof(UseFullTextDiff)); + + public bool UseFullTextDiff + { + get => GetValue(UseFullTextDiffProperty); + set => SetValue(UseFullTextDiffProperty, value); + } + public static readonly StyledProperty SelectedChunkProperty = AvaloniaProperty.Register(nameof(SelectedChunk)); @@ -1232,19 +1241,44 @@ namespace SourceGit.Views set => SetValue(EnableChunkSelectionProperty, value); } + private void RefreshContent(Models.TextDiff diff, bool keepScrollOffset = true) + { + if (SelectedChunk != null) + SetCurrentValue(SelectedChunkProperty, null); + + if (diff == null) + { + Editor.Content = null; + GC.Collect(); + return; + } + + if (UseSideBySideDiff) + { + var previousContent = Editor.Content as ViewModels.TwoSideTextDiff; + Editor.Content = new ViewModels.TwoSideTextDiff(diff, keepScrollOffset ? previousContent : null); + } + else + { + if (!keepScrollOffset) + diff.ScrollOffset = Vector.Zero; + Editor.Content = diff; + } + + IsUnstagedChange = diff.Option.IsUnstaged; + EnableChunkSelection = diff.Option.WorkingCopyChange != null; + } + static TextDiffView() { UseSideBySideDiffProperty.Changed.AddClassHandler((v, _) => { - if (v.DataContext is Models.TextDiff diff) - { - diff.SyncScrollOffset = Vector.Zero; + v.RefreshContent(v.DataContext as Models.TextDiff, false); + }); - if (v.UseSideBySideDiff) - v.Editor.Content = new ViewModels.TwoSideTextDiff(diff); - else - v.Editor.Content = diff; - } + UseFullTextDiffProperty.Changed.AddClassHandler((v, _) => + { + v.RefreshContent(v.DataContext as Models.TextDiff, false); }); SelectedChunkProperty.Changed.AddClassHandler((v, _) => @@ -1271,25 +1305,7 @@ namespace SourceGit.Views protected override void OnDataContextChanged(EventArgs e) { base.OnDataContextChanged(e); - - if (SelectedChunk != null) - SetCurrentValue(SelectedChunkProperty, null); - - var diff = DataContext as Models.TextDiff; - if (diff == null) - { - Editor.Content = null; - GC.Collect(); - return; - } - - if (UseSideBySideDiff) - Editor.Content = new ViewModels.TwoSideTextDiff(diff, Editor.Content as ViewModels.TwoSideTextDiff); - else - Editor.Content = diff; - - IsUnstagedChange = diff.Option.IsUnstaged; - EnableChunkSelection = diff.Option.WorkingCopyChange != null; + RefreshContent(DataContext as Models.TextDiff, true); } protected override void OnPointerExited(PointerEventArgs e) From 8d4afafd2dd9e33f1c7fc5639cc416ecf4bbcb7b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 4 Nov 2024 08:33:05 +0000 Subject: [PATCH 0121/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 361f97e5..d7403960 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.77%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-96.79%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.46%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.52%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.71%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.63%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-96.65%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.34%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.39%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.56%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.85%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.85%25-yellow)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 48bf29a8..07d95a97 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 95.77% +### de_DE.axaml: 95.63%
@@ -22,6 +22,7 @@ - Text.Configure.OpenAI - Text.Configure.OpenAI.Prefered - Text.Configure.OpenAI.Prefered.Tip +- Text.Diff.VisualLines.All - Text.ExecuteCustomAction - Text.ExecuteCustomAction.Name - Text.IssueLinkCM.OpenInBrowser @@ -36,7 +37,7 @@
-### es_ES.axaml: 96.79% +### es_ES.axaml: 96.65%
@@ -56,6 +57,7 @@ - Text.Configure.OpenAI - Text.Configure.OpenAI.Prefered - Text.Configure.OpenAI.Prefered.Tip +- Text.Diff.VisualLines.All - Text.ExecuteCustomAction - Text.ExecuteCustomAction.Name - Text.IssueLinkCM.OpenInBrowser @@ -67,7 +69,7 @@
-### fr_FR.axaml: 87.46% +### fr_FR.axaml: 87.34%
@@ -112,6 +114,7 @@ - Text.ConventionalCommit.ShortDescription - Text.ConventionalCommit.Type - Text.Diff.IgnoreWhitespace +- Text.Diff.VisualLines.All - Text.Discard.IncludeIgnored - Text.ExecuteCustomAction - Text.ExecuteCustomAction.Name @@ -162,7 +165,7 @@
-### pt_BR.axaml: 90.52% +### pt_BR.axaml: 90.39%
@@ -209,6 +212,7 @@ - Text.ConventionalCommit.ShortDescription - Text.ConventionalCommit.Type - Text.CopyAllText +- Text.Diff.VisualLines.All - Text.Discard.IncludeIgnored - Text.ExecuteCustomAction - Text.ExecuteCustomAction.Name @@ -236,33 +240,34 @@
-### ru_RU.axaml: 99.71% +### ru_RU.axaml: 99.56%
Missing Keys +- Text.Diff.VisualLines.All - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink
-### zh_CN.axaml: 100.00% +### zh_CN.axaml: 99.85%
Missing Keys - +- Text.Diff.VisualLines.All
-### zh_TW.axaml: 100.00% +### zh_TW.axaml: 99.85%
Missing Keys - +- Text.Diff.VisualLines.All
From 6209326fe0bcfc7b7a62150127e5e00b31e27433 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 16:49:15 +0800 Subject: [PATCH 0122/1283] code_review: PR #652 * update localization for zh_CN and zh_TW * change the icon for `Icons.Lines.All` * reorder diff view toolbar buttons * move private methods after protected Signed-off-by: leo --- src/Resources/Icons.axaml | 2 +- src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/Views/DiffView.axaml | 21 ++++++------ src/Views/TextDiffView.axaml.cs | 56 +++++++++++++++---------------- 5 files changed, 42 insertions(+), 39 deletions(-) diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml index bd2e551b..fb0759d7 100644 --- a/src/Resources/Icons.axaml +++ b/src/Resources/Icons.axaml @@ -65,7 +65,7 @@ M875 117H149C109 117 75 151 75 192v640c0 41 34 75 75 75h725c41 0 75-34 75-75V192c0-41-34-75-75-75zM139 832V192c0-6 4-11 11-11h331v661H149c-6 0-11-4-11-11zm747 0c0 6-4 11-11 11H544v-661H875c6 0 11 4 11 11v640z M875 117H149C109 117 75 151 75 192v640c0 41 34 75 75 75h725c41 0 75-34 75-75V192c0-41-34-75-75-75zm-725 64h725c6 0 11 4 11 11v288h-747V192c0-6 4-11 11-11zm725 661H149c-6 0-11-4-11-11V544h747V832c0 6-4 11-11 11z M40 9 15 23 15 31 9 28 9 20 34 5 24 0 0 14 0 34 25 48 25 28 49 14zM26 29 26 48 49 34 49 15z - M19,13 C19.4142,13 19.75,13.3358 19.75,13.75 L19.75,18.4393 L20.4697,17.7197 C20.7626,17.4268 21.2374,17.4268 21.5303,17.7197 C21.8232,18.0126 21.8232,18.4874 21.5303,18.7803 L19.5303,20.7803 C19.4584,20.8522 19.3755,20.9065 19.2871,20.9431 C19.2099,20.9751 19.1262,20.9946 19.0386,20.999 L19,21 L19,21 C18.8983,21 18.8013,20.9798 18.7129,20.9431 C18.6245,20.9065 18.5416,20.8522 18.4697,20.7803 L16.4697,18.7803 C16.1768,18.4874 16.1768,18.0126 16.4697,17.7197 C16.7626,17.4268 17.2374,17.4268 17.5303,17.7197 L18.25,18.4393 L18.25,13.75 C18.25,13.3358 18.5858,13 19,13 Z M11.25,18 C11.6642,18 12,18.3358 12,18.75 C12,19.1296833 11.7178347,19.4434889 11.3517677,19.4931531 L11.25,19.5 L2.75,19.5 C2.33579,19.5 2,19.1642 2,18.75 C2,18.3703167 2.28215688,18.0565111 2.64823019,18.0068469 L2.75,18 L11.25,18 Z M14.25,11.5 C14.6642,11.5 15,11.8358 15,12.25 C15,12.6642 14.6642,13 14.25,13 L2.75,13 C2.33579,13 2,12.6642 2,12.25 C2,11.8358 2.33579,11.5 2.75,11.5 L14.25,11.5 Z M19.0022,3 C19.1031,3.0003 19.1993,3.02051 19.2871,3.05691 C19.3755,3.09351 19.4584,3.14776 19.5303,3.21967 L21.5303,5.21967 C21.8232,5.51256 21.8232,5.98744 21.5303,6.28033 C21.2374,6.57322 20.7626,6.57322 20.4697,6.28033 L19.75,5.56066 L19.75,10.25 C19.75,10.6642 19.4142,11 19,11 C18.5858,11 18.25,10.6642 18.25,10.25 L18.25,5.56066 L17.5303,6.28033 C17.2374,6.57322 16.7626,6.57322 16.4697,6.28033 C16.1768,5.98744 16.1768,5.51256 16.4697,5.21967 L18.4697,3.21967 C18.58634,3.102974 18.731972,3.0327676 18.8834536,3.00906104 L19.0022,3 Z M11.25,5 C11.6642,5 12,5.33579 12,5.75 C12,6.16421 11.6642,6.5 11.25,6.5 L2.75,6.5 C2.33579,6.5 2,6.16421 2,5.75 C2,5.33579 2.33579,5 2.75,5 L11.25,5 Z + M416 192m32 0 448 0q32 0 32 32l0 0q0 32-32 32l-448 0q-32 0-32-32l0 0q0-32 32-32ZM416 448m32 0 448 0q32 0 32 32l0 0q0 32-32 32l-448 0q-32 0-32-32l0 0q0-32 32-32ZM416 704m32 0 448 0q32 0 32 32l0 0q0 32-32 32l-448 0q-32 0-32-32l0 0q0-32 32-32ZM96 320l128-192 128 192h-256zM96 640l128 192 128-192h-256zM190 320h64v320H190z M408 232C408 210 426 192 448 192h416a40 40 0 110 80H448a40 40 0 01-40-40zM408 512c0-22 18-40 40-40h416a40 40 0 110 80H448A40 40 0 01408 512zM448 752A40 40 0 00448 832h416a40 40 0 100-80H448zM32 480l132 0 0-128 64 0 0 128 132 0 0 64-132 0 0 128-64 0 0-128-132 0Z M408 232C408 210 426 192 448 192h416a40 40 0 110 80H448a40 40 0 01-40-40zM408 512c0-22 18-40 40-40h416a40 40 0 110 80H448A40 40 0 01408 512zM448 752A40 40 0 00448 832h416a40 40 0 100-80H448zM32 480l328 0 0 64-328 0Z M 968 418 l -95 94 c -59 59 -146 71 -218 37 L 874 331 a 64 64 0 0 0 0 -90 L 783 150 a 64 64 0 0 0 -90 0 L 475 368 c -34 -71 -22 -159 37 -218 l 94 -94 c 75 -75 196 -75 271 0 l 90 90 c 75 75 75 196 0 271 z M 332 693 a 64 64 0 0 1 0 -90 l 271 -271 c 25 -25 65 -25 90 0 s 25 65 0 90 L 422 693 a 64 64 0 0 1 -90 0 z M 151 783 l 90 90 a 64 64 0 0 0 90 0 l 218 -218 c 34 71 22 159 -37 218 l -86 94 a 192 192 0 0 1 -271 0 l -98 -98 a 192 192 0 0 1 0 -271 l 94 -86 c 59 -59 146 -71 218 -37 L 151 693 a 64 64 0 0 0 0 90 z diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index c148c229..04bf7e3e 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -249,6 +249,7 @@ 语法高亮 自动换行 使用外部合并工具查看 + 显示完整文件 减少可见的行数 增加可见的行数 请选择需要对比的文件 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 2ff3db37..0c268c75 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -249,6 +249,7 @@ 語法上色 自動換行 使用外部合併工具檢視 + 顯示檔案的全部內容 減少可見的行數 增加可見的行數 請選擇需要對比的檔案 diff --git a/src/Views/DiffView.axaml b/src/Views/DiffView.axaml index 9109e504..06525abd 100644 --- a/src/Views/DiffView.axaml +++ b/src/Views/DiffView.axaml @@ -34,16 +34,6 @@ - - - + + + + SetValue(EnableChunkSelectionProperty, value); } - private void RefreshContent(Models.TextDiff diff, bool keepScrollOffset = true) - { - if (SelectedChunk != null) - SetCurrentValue(SelectedChunkProperty, null); - - if (diff == null) - { - Editor.Content = null; - GC.Collect(); - return; - } - - if (UseSideBySideDiff) - { - var previousContent = Editor.Content as ViewModels.TwoSideTextDiff; - Editor.Content = new ViewModels.TwoSideTextDiff(diff, keepScrollOffset ? previousContent : null); - } - else - { - if (!keepScrollOffset) - diff.ScrollOffset = Vector.Zero; - Editor.Content = diff; - } - - IsUnstagedChange = diff.Option.IsUnstaged; - EnableChunkSelection = diff.Option.WorkingCopyChange != null; - } - static TextDiffView() { UseSideBySideDiffProperty.Changed.AddClassHandler((v, _) => @@ -1316,6 +1288,34 @@ namespace SourceGit.Views SetCurrentValue(SelectedChunkProperty, null); } + private void RefreshContent(Models.TextDiff diff, bool keepScrollOffset = true) + { + if (SelectedChunk != null) + SetCurrentValue(SelectedChunkProperty, null); + + if (diff == null) + { + Editor.Content = null; + GC.Collect(); + return; + } + + if (UseSideBySideDiff) + { + var previousContent = Editor.Content as ViewModels.TwoSideTextDiff; + Editor.Content = new ViewModels.TwoSideTextDiff(diff, keepScrollOffset ? previousContent : null); + } + else + { + if (!keepScrollOffset) + diff.ScrollOffset = Vector.Zero; + Editor.Content = diff; + } + + IsUnstagedChange = diff.Option.IsUnstaged; + EnableChunkSelection = diff.Option.WorkingCopyChange != null; + } + private void OnStageChunk(object _1, RoutedEventArgs _2) { var chunk = SelectedChunk; From a5aa2254f602f729365f1a0a94f38e0780e5a676 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 4 Nov 2024 08:49:32 +0000 Subject: [PATCH 0123/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d7403960..03271f29 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.63%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-96.65%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.34%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.39%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.56%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.85%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.85%25-yellow)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.63%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-96.65%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.34%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.39%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.56%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 07d95a97..55bf97f0 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -252,22 +252,22 @@ -### zh_CN.axaml: 99.85% +### zh_CN.axaml: 100.00%
Missing Keys -- Text.Diff.VisualLines.All +
-### zh_TW.axaml: 99.85% +### zh_TW.axaml: 100.00%
Missing Keys -- Text.Diff.VisualLines.All +
From dcf50934061e1e9549b8073b7c87dede6873096c Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 4 Nov 2024 18:21:07 +0800 Subject: [PATCH 0124/1283] enhance: avoid that diff view refresh more than one times Signed-off-by: leo --- src/Commands/Diff.cs | 32 ++++++++++++++++++------ src/Models/DiffResult.cs | 2 ++ src/ViewModels/DiffContext.cs | 46 ++++++++++++++++++++++++++--------- 3 files changed, 62 insertions(+), 18 deletions(-) diff --git a/src/Commands/Diff.cs b/src/Commands/Diff.cs index b9b6e064..04103d68 100644 --- a/src/Commands/Diff.cs +++ b/src/Commands/Diff.cs @@ -8,6 +8,10 @@ namespace SourceGit.Commands { [GeneratedRegex(@"^@@ \-(\d+),?\d* \+(\d+),?\d* @@")] private static partial Regex REG_INDICATOR(); + + [GeneratedRegex(@"^index\s([0-9a-f]{6,40})\.\.([0-9a-f]{6,40})(\s[1-9]{6})?")] + private static partial Regex REG_HASH_CHANGE(); + private const string PREFIX_LFS_NEW = "+version https://git-lfs.github.com/spec/"; private const string PREFIX_LFS_DEL = "-version https://git-lfs.github.com/spec/"; private const string PREFIX_LFS_MODIFY = " version https://git-lfs.github.com/spec/"; @@ -101,17 +105,31 @@ namespace SourceGit.Commands if (_result.TextDiff.Lines.Count == 0) { - var match = REG_INDICATOR().Match(line); - if (!match.Success) + if (line.StartsWith("Binary", StringComparison.Ordinal)) { - if (line.StartsWith("Binary", StringComparison.Ordinal)) - _result.IsBinary = true; + _result.IsBinary = true; return; } - _oldLine = int.Parse(match.Groups[1].Value); - _newLine = int.Parse(match.Groups[2].Value); - _result.TextDiff.Lines.Add(new Models.TextDiffLine(Models.TextDiffLineType.Indicator, line, 0, 0)); + if (string.IsNullOrEmpty(_result.OldHash)) + { + var match = REG_HASH_CHANGE().Match(line); + if (!match.Success) + return; + + _result.OldHash = match.Groups[1].Value; + _result.NewHash = match.Groups[2].Value; + } + else + { + var match = REG_INDICATOR().Match(line); + if (!match.Success) + return; + + _oldLine = int.Parse(match.Groups[1].Value); + _newLine = int.Parse(match.Groups[2].Value); + _result.TextDiff.Lines.Add(new Models.TextDiffLine(Models.TextDiffLineType.Indicator, line, 0, 0)); + } } else { diff --git a/src/Models/DiffResult.cs b/src/Models/DiffResult.cs index 61255ae9..e0ae82e0 100644 --- a/src/Models/DiffResult.cs +++ b/src/Models/DiffResult.cs @@ -674,6 +674,8 @@ namespace SourceGit.Models { public bool IsBinary { get; set; } = false; public bool IsLFS { get; set; } = false; + public string OldHash { get; set; } = string.Empty; + public string NewHash { get; set; } = string.Empty; public string OldMode { get; set; } = string.Empty; public string NewMode { get; set; } = string.Empty; public TextDiff TextDiff { get; set; } = null; diff --git a/src/ViewModels/DiffContext.cs b/src/ViewModels/DiffContext.cs index cfb9fa79..87b1a6de 100644 --- a/src/ViewModels/DiffContext.cs +++ b/src/ViewModels/DiffContext.cs @@ -33,12 +33,6 @@ namespace SourceGit.ViewModels private set => SetProperty(ref _fileModeChange, value); } - public bool IsLoading - { - get => _isLoading; - private set => SetProperty(ref _isLoading, value); - } - public bool IsTextDiff { get => _isTextDiff; @@ -68,6 +62,7 @@ namespace SourceGit.ViewModels _content = previous._content; _unifiedLines = previous._unifiedLines; _ignoreWhitespace = previous._ignoreWhitespace; + _info = previous._info; } if (string.IsNullOrEmpty(_option.OrgPath) || _option.OrgPath == "/dev/null") @@ -109,7 +104,6 @@ namespace SourceGit.ViewModels { Content = null; IsTextDiff = false; - IsLoading = false; return; } @@ -119,10 +113,14 @@ namespace SourceGit.ViewModels // There is no way to tell a git-diff to use "ALL lines of context", // so instead we set a very high number for the "lines of context" parameter. var numLines = Preference.Instance.UseFullTextDiff ? 999999999 : _unifiedLines; - var latest = new Commands.Diff(_repo, _option, numLines, _ignoreWhitespace).Result(); - var rs = null as object; + var info = new Info(_option, numLines, _ignoreWhitespace, latest); + if (_info != null && info.IsSame(_info)) + return; + _info = info; + + var rs = null as object; if (latest.TextDiff != null) { var count = latest.TextDiff.Lines.Count; @@ -219,7 +217,6 @@ namespace SourceGit.ViewModels FileModeChange = latest.FileModeChange; Content = rs; IsTextDiff = rs is Models.TextDiff; - IsLoading = false; }); }); } @@ -252,14 +249,41 @@ namespace SourceGit.ViewModels ".ico", ".bmp", ".jpg", ".png", ".jpeg", ".webp" }; + private class Info + { + public string Argument { get; set; } + public int UnifiedLines { get; set; } + public bool IgnoreWhitespace { get; set; } + public string OldHash { get; set; } + public string NewHash { get; set; } + + public Info(Models.DiffOption option, int unifiedLines, bool ignoreWhitespace, Models.DiffResult result) + { + Argument = option.ToString(); + UnifiedLines = unifiedLines; + IgnoreWhitespace = ignoreWhitespace; + OldHash = result.OldHash; + NewHash = result.NewHash; + } + + public bool IsSame(Info other) + { + return Argument.Equals(other.Argument, StringComparison.Ordinal) && + UnifiedLines == other.UnifiedLines && + IgnoreWhitespace == other.IgnoreWhitespace && + OldHash.Equals(other.OldHash, StringComparison.Ordinal) && + NewHash.Equals(other.NewHash, StringComparison.Ordinal); + } + } + private readonly string _repo; private readonly Models.DiffOption _option = null; private string _title; private string _fileModeChange = string.Empty; private int _unifiedLines = 4; - private bool _isLoading = true; private bool _isTextDiff = false; private bool _ignoreWhitespace = false; private object _content = null; + private Info _info = null; } } From 8f5dfcc209f2893bb42f49cacfbb4f5f50ef8545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A0s=20Civil?= <70479573+BernatBC@users.noreply.github.com> Date: Tue, 5 Nov 2024 02:48:37 +0100 Subject: [PATCH 0125/1283] Add missing translations in spanish (#655) --- src/Resources/Locales/es_ES.axaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index f8a2fa68..88a1e78d 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -73,6 +73,7 @@ CANCELAR Resetear a Esta Revisión Resetear a Revisión Padre + Generar mensaje de commit CAMBIAR MODO DE VISUALIZACIÓN Mostrar como Lista de Archivos y Directorios Mostrar como Lista de Rutas @@ -110,7 +111,10 @@ Comparar con Worktree Copiar Información Copiar SHA + Acción personalizada Rebase Interactivo ${0}$ hasta Aquí + Abrir en el Navegador + Copiar Enlace Rebase ${0}$ hasta Aquí Reset ${0}$ hasta Aquí Revertir Commit @@ -141,12 +145,21 @@ PLANTILLA DE COMMIT Nombre de la Plantilla: Contenido de la Plantilla: + ACCIÓN PERSONALIZADA + Argumentos: + ${REPO} - Ruta del repositorio; ${SHA} - SHA del commit seleccionado + Archivo Ejecutable: + Nombre: + Alcance: + Commit + Repositorio Dirección de Email Dirección de email GIT Fetch remotos automáticamente Minuto(s) Remoto por Defecto + Habilitar --prune para fetch Habilitar --signoff para commit SEGUIMIENTO DE INCIDENCIAS Añadir Regla de Ejemplo para Github @@ -158,6 +171,9 @@ Nombre de la Regla: URL Resultante: Por favor, use $1, $2 para acceder a los valores de los grupos regex. + OPEN AI + Servicio Preferido: + Si el 'Servicio Preferido' está establecido, SourceGit sólo lo usará en este repositorio. De lo contrario, si hay más de un servicio disponible, se mostrará un menú de contexto para elegir uno. Proxy HTTP Proxy HTTP utilizado por este repositorio Nombre de Usuario @@ -235,6 +251,7 @@ Resaltado de Sintaxis Ajuste de Línea Abrir en Herramienta de Merge + Mostrar Todas las Líneas Disminuir Número de Líneas Visibles Aumentar Número de Líneas Visibles SELECCIONA ARCHIVO PARA VER CAMBIOS @@ -250,6 +267,8 @@ Destino: Editar Grupo Seleccionado Editar Repositorio Seleccionado + Ejecutar Acción Personalizada + Nombre de la Acción: Fast-Forward (sin checkout) Fetch Fetch todos los remotos @@ -411,6 +430,7 @@ Clave API Generar Subject Prompt Modelo + Nombre Servidor APARIENCIA Fuente por defecto @@ -514,6 +534,8 @@ Limpiar todo Configurar este repositorio CONTINUAR + Acciones Personalizadas + No hay ninguna Acción Personalizada Habilitar Opción '--reflog' Abrir en el Explorador Buscar Ramas/Etiquetas/Submódulos @@ -576,6 +598,7 @@ INICIAR Stash Incluir archivos no rastreados + Mantener archivos staged Mensaje: Opcional. Nombre de este stash Solo cambios staged From c337d67bbe70cc1005f78bc5ef10b410e24d9bbe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 Nov 2024 01:48:51 +0000 Subject: [PATCH 0126/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 26 ++------------------------ 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 03271f29..24d12b3c 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.63%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-96.65%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.34%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.39%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.56%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.63%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-100.00%25-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.34%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.39%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.56%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 55bf97f0..bad6577c 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -37,35 +37,13 @@ -### es_ES.axaml: 96.65% +### es_ES.axaml: 100.00%
Missing Keys -- Text.ChangeCM.GenerateCommitMessage -- Text.CommitCM.CustomAction -- Text.Configure.CustomAction -- Text.Configure.CustomAction.Arguments -- Text.Configure.CustomAction.Arguments.Tip -- Text.Configure.CustomAction.Executable -- Text.Configure.CustomAction.Name -- Text.Configure.CustomAction.Scope -- Text.Configure.CustomAction.Scope.Commit -- Text.Configure.CustomAction.Scope.Repository -- Text.Configure.Git.EnablePruneOnFetch -- Text.Configure.OpenAI -- Text.Configure.OpenAI.Prefered -- Text.Configure.OpenAI.Prefered.Tip -- Text.Diff.VisualLines.All -- Text.ExecuteCustomAction -- Text.ExecuteCustomAction.Name -- Text.IssueLinkCM.OpenInBrowser -- Text.IssueLinkCM.CopyLink -- Text.Preference.AI.Name -- Text.Repository.CustomActions -- Text.Repository.CustomActions.Empty -- Text.Stash.KeepIndex +
From 9d2c2df6b36b4a78dac6f0ff8bb30876ced64159 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 5 Nov 2024 11:00:04 +0800 Subject: [PATCH 0127/1283] ux: issue link tooltip max width Signed-off-by: leo --- src/Views/CommitBaseInfo.axaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index 62117480..a16143ae 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -141,7 +141,13 @@ Message="{Binding #ThisControl.Message}" IssueTrackerRules="{Binding #ThisControl.IssueTrackerRules}" HorizontalAlignment="Stretch" - TextWrapping="Wrap"/> + TextWrapping="Wrap"> + + + +
From 680cdca28da1905b9c4acca79b6f7bb39e016434 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 5 Nov 2024 12:15:20 +0800 Subject: [PATCH 0128/1283] feature: handle custom action error output Signed-off-by: leo --- src/Commands/ExecuteCustomAction.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Commands/ExecuteCustomAction.cs b/src/Commands/ExecuteCustomAction.cs index 253c6b43..10ecb450 100644 --- a/src/Commands/ExecuteCustomAction.cs +++ b/src/Commands/ExecuteCustomAction.cs @@ -30,6 +30,8 @@ namespace SourceGit.Commands start.Environment.Add("PATH", Native.OS.CustomPathEnv); var proc = new Process() { StartInfo = start }; + var builder = new StringBuilder(); + proc.OutputDataReceived += (_, e) => { if (e.Data != null) @@ -39,7 +41,10 @@ namespace SourceGit.Commands proc.ErrorDataReceived += (_, e) => { if (e.Data != null) + { outputHandler?.Invoke(e.Data); + builder.Append(e.Data); + } }; try @@ -57,7 +62,17 @@ namespace SourceGit.Commands }); } + var exitCode = proc.ExitCode; proc.Close(); + + if (exitCode != 0) + { + var errMsg = builder.ToString(); + Dispatcher.UIThread.Invoke(() => + { + App.RaiseException(repo, errMsg); + }); + } } } } From fdf30aa7cc1396e03ff982ad48956c6b736aca3f Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 5 Nov 2024 12:24:33 +0800 Subject: [PATCH 0129/1283] fix: custom action error message format Signed-off-by: leo --- src/Commands/ExecuteCustomAction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/ExecuteCustomAction.cs b/src/Commands/ExecuteCustomAction.cs index 10ecb450..f5fec82c 100644 --- a/src/Commands/ExecuteCustomAction.cs +++ b/src/Commands/ExecuteCustomAction.cs @@ -43,7 +43,7 @@ namespace SourceGit.Commands if (e.Data != null) { outputHandler?.Invoke(e.Data); - builder.Append(e.Data); + builder.AppendLine(e.Data); } }; From 2e6eca26f7cd0207821af33dcb6df4e31c7c651c Mon Sep 17 00:00:00 2001 From: Fernando Medeiros Date: Wed, 6 Nov 2024 01:14:56 +0000 Subject: [PATCH 0130/1283] Adding hotkeys for creating branch, pushing and pulling (#657) --- src/Resources/Locales/en_US.axaml | 3 +++ src/ViewModels/Histories.cs | 2 ++ src/Views/Histories.axaml.cs | 34 ++++++++++++++++++++++++------- src/Views/Hotkeys.axaml | 15 +++++++++++--- src/Views/RepositoryToolbar.axaml | 5 +++-- 5 files changed, 47 insertions(+), 12 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index eb1c6de3..2b6c8ce9 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -371,6 +371,9 @@ Switch to 'Changes' Switch to 'Histories' Switch to 'Stashes' + Pull, starts directly + Push, starts directly + Creates a new branch based on selected commit TEXT EDITOR Close search panel Find next match diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 713e1635..3fb048ae 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Text; using Avalonia.Controls; +using Avalonia.Input; using Avalonia.Platform.Storage; using CommunityToolkit.Mvvm.ComponentModel; @@ -544,6 +545,7 @@ namespace SourceGit.ViewModels var createBranch = new MenuItem(); createBranch.Icon = App.CreateMenuIcon("Icons.Branch.Add"); createBranch.Header = App.Text("CreateBranch"); + createBranch.HotKey = new KeyGesture(Key.B, KeyModifiers.Control); createBranch.Click += (_, e) => { if (PopupHost.CanCreatePopup()) diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index 43258dd7..e621a0aa 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -12,6 +12,7 @@ using Avalonia.Interactivity; using Avalonia.Media; using Avalonia.Threading; using Avalonia.VisualTree; +using SourceGit.ViewModels; namespace SourceGit.Views { @@ -722,19 +723,38 @@ namespace SourceGit.Views private void OnCommitListKeyDown(object sender, KeyEventArgs e) { + // These shortcuts are not mentioned in the Shortcut Reference window. Is this expected? if (sender is ListBox { SelectedItems: { Count: > 0 } selected } && - e.Key == Key.C && e.KeyModifiers.HasFlag(KeyModifiers.Control)) { - var builder = new StringBuilder(); - foreach (var item in selected) + // CTRL + C -> Copy selected commit SHA and subject. + if (e.Key == Key.C) { - if (item is Models.Commit commit) - builder.AppendLine($"{commit.SHA.Substring(0, 10)} - {commit.Subject}"); + var builder = new StringBuilder(); + foreach (var item in selected) + { + if (item is Models.Commit commit) + builder.AppendLine($"{commit.SHA.Substring(0, 10)} - {commit.Subject}"); + } + + App.CopyText(builder.ToString()); + e.Handled = true; + return; } - App.CopyText(builder.ToString()); - e.Handled = true; + // CTRL + B -> shows Create Branch pop-up at selected commit. + if (e.Key == Key.B) + { + if (selected.Count == 1 && + selected[0] is Models.Commit commit && + DataContext is ViewModels.Histories histories && + PopupHost.CanCreatePopup()) + { + PopupHost.ShowPopup(new ViewModels.CreateBranch(histories.Repo, commit)); + e.Handled = true; + + } + } } } diff --git a/src/Views/Hotkeys.axaml b/src/Views/Hotkeys.axaml index a28bc566..cb6f6e64 100644 --- a/src/Views/Hotkeys.axaml +++ b/src/Views/Hotkeys.axaml @@ -71,7 +71,7 @@ FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Increase}}" Margin="0,8"/> - + @@ -102,8 +102,17 @@ - - + + + + + + + + + + + - - From dc49c1bf7624538361fee2de24730395f55485bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 Nov 2024 01:15:14 +0000 Subject: [PATCH 0131/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 38 ++++++++++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 24d12b3c..47c32222 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.63%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-100.00%25-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.34%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.39%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.56%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.22%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.96%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.00%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.13%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.57%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.57%25-yellow)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index bad6577c..5895b971 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 95.63% +### de_DE.axaml: 95.22%
@@ -25,6 +25,9 @@ - Text.Diff.VisualLines.All - Text.ExecuteCustomAction - Text.ExecuteCustomAction.Name +- Text.Hotkeys.Repo.Pull +- Text.Hotkeys.Repo.Push +- Text.Hotkeys.Repo.CreateBranchOnCommit - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink - Text.Preference.AI.AnalyzeDiffPrompt @@ -37,17 +40,19 @@
-### es_ES.axaml: 100.00% +### es_ES.axaml: 99.57%
Missing Keys - +- Text.Hotkeys.Repo.Pull +- Text.Hotkeys.Repo.Push +- Text.Hotkeys.Repo.CreateBranchOnCommit
-### fr_FR.axaml: 87.34% +### fr_FR.axaml: 86.96%
@@ -104,6 +109,9 @@ - Text.Histories.Tips.Prefix - Text.Hotkeys.Repo.CommitWithAutoStage - Text.Hotkeys.Repo.DiscardSelected +- Text.Hotkeys.Repo.Pull +- Text.Hotkeys.Repo.Push +- Text.Hotkeys.Repo.CreateBranchOnCommit - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink - Text.MoveRepositoryNode @@ -143,7 +151,7 @@
-### pt_BR.axaml: 90.39% +### pt_BR.axaml: 90.00%
@@ -197,6 +205,9 @@ - Text.FileHistory.FileContent - Text.FileHistory.FileChange - Text.GitLFS.Locks.OnlyMine +- Text.Hotkeys.Repo.Pull +- Text.Hotkeys.Repo.Push +- Text.Hotkeys.Repo.CreateBranchOnCommit - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink - Text.MoveRepositoryNode @@ -218,34 +229,41 @@
-### ru_RU.axaml: 99.56% +### ru_RU.axaml: 99.13%
Missing Keys - Text.Diff.VisualLines.All +- Text.Hotkeys.Repo.Pull +- Text.Hotkeys.Repo.Push +- Text.Hotkeys.Repo.CreateBranchOnCommit - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink
-### zh_CN.axaml: 100.00% +### zh_CN.axaml: 99.57%
Missing Keys - +- Text.Hotkeys.Repo.Pull +- Text.Hotkeys.Repo.Push +- Text.Hotkeys.Repo.CreateBranchOnCommit
-### zh_TW.axaml: 100.00% +### zh_TW.axaml: 99.57%
Missing Keys - +- Text.Hotkeys.Repo.Pull +- Text.Hotkeys.Repo.Push +- Text.Hotkeys.Repo.CreateBranchOnCommit
From d50b2c0298b8a27022b9db43ac4bb204743eefb3 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 6 Nov 2024 09:44:52 +0800 Subject: [PATCH 0132/1283] code_review: PR #657 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add hotkey `Ctrl+Down/⌘+Down` to fetch directly * keep translation keys of en_US in order * add translations for zh_CN and zh_TW * do NOT using namespace under `SourceGit` * use `⇧` instead of `Shift` in hotkey tips * hotkey mismatch on macOS * hotkeys to start fetch/pull/push directly not work on macOS * remove the hotkey of `Create Branch` context menu item - there are other objects (such as branch and tag) also have the `Create Branch` context menu item without hotkeys - on macOS, we already use `⌘+B` to create branch with selected commit, not `Ctrl + B` Signed-off-by: leo --- README.md | 2 +- TRANSLATION.md | 37 ++++++++++++++-------------- src/Resources/Locales/en_US.axaml | 7 +++--- src/Resources/Locales/zh_CN.axaml | 4 +++ src/Resources/Locales/zh_TW.axaml | 4 +++ src/ViewModels/Histories.cs | 2 -- src/Views/Histories.axaml.cs | 18 ++++++++------ src/Views/Hotkeys.axaml | 21 +++++++++------- src/Views/RepositoryToolbar.axaml | 3 +-- src/Views/RepositoryToolbar.axaml.cs | 35 +++++++++++++++++++++----- 10 files changed, 84 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 47c32222..69e0d738 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.22%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.96%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.00%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.13%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.57%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.57%25-yellow)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.08%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.42%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.83%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-89.87%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-98.99%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 5895b971..05bf208c 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 95.22% +### de_DE.axaml: 95.08%
@@ -25,9 +25,10 @@ - Text.Diff.VisualLines.All - Text.ExecuteCustomAction - Text.ExecuteCustomAction.Name +- Text.Hotkeys.Repo.CreateBranchOnCommit +- Text.Hotkeys.Repo.Fetch - Text.Hotkeys.Repo.Pull - Text.Hotkeys.Repo.Push -- Text.Hotkeys.Repo.CreateBranchOnCommit - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink - Text.Preference.AI.AnalyzeDiffPrompt @@ -40,19 +41,20 @@
-### es_ES.axaml: 99.57% +### es_ES.axaml: 99.42%
Missing Keys +- Text.Hotkeys.Repo.CreateBranchOnCommit +- Text.Hotkeys.Repo.Fetch - Text.Hotkeys.Repo.Pull - Text.Hotkeys.Repo.Push -- Text.Hotkeys.Repo.CreateBranchOnCommit
-### fr_FR.axaml: 86.96% +### fr_FR.axaml: 86.83%
@@ -108,10 +110,11 @@ - Text.Histories.Tips.MacOS - Text.Histories.Tips.Prefix - Text.Hotkeys.Repo.CommitWithAutoStage +- Text.Hotkeys.Repo.CreateBranchOnCommit - Text.Hotkeys.Repo.DiscardSelected +- Text.Hotkeys.Repo.Fetch - Text.Hotkeys.Repo.Pull - Text.Hotkeys.Repo.Push -- Text.Hotkeys.Repo.CreateBranchOnCommit - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink - Text.MoveRepositoryNode @@ -151,7 +154,7 @@
-### pt_BR.axaml: 90.00% +### pt_BR.axaml: 89.87%
@@ -205,9 +208,10 @@ - Text.FileHistory.FileContent - Text.FileHistory.FileChange - Text.GitLFS.Locks.OnlyMine +- Text.Hotkeys.Repo.CreateBranchOnCommit +- Text.Hotkeys.Repo.Fetch - Text.Hotkeys.Repo.Pull - Text.Hotkeys.Repo.Push -- Text.Hotkeys.Repo.CreateBranchOnCommit - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink - Text.MoveRepositoryNode @@ -229,41 +233,38 @@
-### ru_RU.axaml: 99.13% +### ru_RU.axaml: 98.99%
Missing Keys - Text.Diff.VisualLines.All +- Text.Hotkeys.Repo.CreateBranchOnCommit +- Text.Hotkeys.Repo.Fetch - Text.Hotkeys.Repo.Pull - Text.Hotkeys.Repo.Push -- Text.Hotkeys.Repo.CreateBranchOnCommit - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink
-### zh_CN.axaml: 99.57% +### zh_CN.axaml: 100.00%
Missing Keys -- Text.Hotkeys.Repo.Pull -- Text.Hotkeys.Repo.Push -- Text.Hotkeys.Repo.CreateBranchOnCommit +
-### zh_TW.axaml: 99.57% +### zh_TW.axaml: 100.00%
Missing Keys -- Text.Hotkeys.Repo.Pull -- Text.Hotkeys.Repo.Push -- Text.Hotkeys.Repo.CreateBranchOnCommit +
diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 2b6c8ce9..ee44181b 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -363,17 +363,18 @@ Commit staged changes Commit and push staged changes Stage all changes and commit + Creates a new branch based on selected commit Discard selected changes + Fetch, starts directly Dashboard mode (Default) + Pull, starts directly + Push, starts directly Force to reload this repository Stage/Unstage selected changes Commit search mode Switch to 'Changes' Switch to 'Histories' Switch to 'Stashes' - Pull, starts directly - Push, starts directly - Creates a new branch based on selected commit TEXT EDITOR Close search panel Find next match diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 04bf7e3e..b97f9aab 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -366,8 +366,12 @@ 提交暂存区更改 提交暂存区更改并推送 自动暂存全部变更并提交 + 基于选中提交创建新分支 丢弃选中的更改 + 拉取 (fetch) 远程变更 切换左边栏为分支/标签等显示模式(默认) + 拉回 (pull) 远程变更 + 推送本地变更到远程 重新加载仓库状态 将选中的变更暂存或从暂存列表中移除 切换左边栏为提交搜索模式 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 0c268c75..494616ab 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -366,8 +366,12 @@ 提交暫存區變更 提交暫存區變更並推送 自動暫存全部變更並提交 + 根據選取的提交建立新的分支 捨棄選取的變更 + 提取 (fetch) 遠端的變更 切換左邊欄為分支/標籤等顯示模式 (預設) + 拉取 (pull) 遠端的變更 + 推送 (push) 本地變更到遠端存放庫 強制重新載入存放庫 暫存或取消暫存選取的變更 切換左邊欄為歷史搜尋模式 diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 3fb048ae..713e1635 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Text; using Avalonia.Controls; -using Avalonia.Input; using Avalonia.Platform.Storage; using CommunityToolkit.Mvvm.ComponentModel; @@ -545,7 +544,6 @@ namespace SourceGit.ViewModels var createBranch = new MenuItem(); createBranch.Icon = App.CreateMenuIcon("Icons.Branch.Add"); createBranch.Header = App.Text("CreateBranch"); - createBranch.HotKey = new KeyGesture(Key.B, KeyModifiers.Control); createBranch.Click += (_, e) => { if (PopupHost.CanCreatePopup()) diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index e621a0aa..e72888fe 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -12,7 +12,6 @@ using Avalonia.Interactivity; using Avalonia.Media; using Avalonia.Threading; using Avalonia.VisualTree; -using SourceGit.ViewModels; namespace SourceGit.Views { @@ -723,11 +722,15 @@ namespace SourceGit.Views private void OnCommitListKeyDown(object sender, KeyEventArgs e) { + bool isSystemCmdKeyDown = (OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Meta)) || + (!OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Control)); + if (!isSystemCmdKeyDown) + return; + // These shortcuts are not mentioned in the Shortcut Reference window. Is this expected? - if (sender is ListBox { SelectedItems: { Count: > 0 } selected } && - e.KeyModifiers.HasFlag(KeyModifiers.Control)) + if (sender is ListBox { SelectedItems: { Count: > 0 } selected }) { - // CTRL + C -> Copy selected commit SHA and subject. + // CTRL/COMMAND + C -> Copy selected commit SHA and subject. if (e.Key == Key.C) { var builder = new StringBuilder(); @@ -742,17 +745,16 @@ namespace SourceGit.Views return; } - // CTRL + B -> shows Create Branch pop-up at selected commit. + // CTRL/COMMAND + B -> shows Create Branch pop-up at selected commit. if (e.Key == Key.B) { if (selected.Count == 1 && selected[0] is Models.Commit commit && DataContext is ViewModels.Histories histories && - PopupHost.CanCreatePopup()) + ViewModels.PopupHost.CanCreatePopup()) { - PopupHost.ShowPopup(new ViewModels.CreateBranch(histories.Repo, commit)); + ViewModels.PopupHost.ShowPopup(new ViewModels.CreateBranch(histories.Repo, commit)); e.Handled = true; - } } } diff --git a/src/Views/Hotkeys.axaml b/src/Views/Hotkeys.axaml index cb6f6e64..4fe77066 100644 --- a/src/Views/Hotkeys.axaml +++ b/src/Views/Hotkeys.axaml @@ -71,7 +71,7 @@ FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Increase}}" Margin="0,8"/> - + @@ -102,17 +102,20 @@ - - + + - - + + - - + + - - + + + + + - diff --git a/src/Views/RepositoryToolbar.axaml.cs b/src/Views/RepositoryToolbar.axaml.cs index a4a05dc4..e2c7df8c 100644 --- a/src/Views/RepositoryToolbar.axaml.cs +++ b/src/Views/RepositoryToolbar.axaml.cs @@ -1,3 +1,5 @@ +using System; + using Avalonia.Controls; using Avalonia.Input; using Avalonia.Interactivity; @@ -45,22 +47,43 @@ namespace SourceGit.Views private void Fetch(object _, RoutedEventArgs e) { var launcher = this.FindAncestorOfType(); - (DataContext as ViewModels.Repository)?.Fetch(launcher?.HasKeyModifier(KeyModifiers.Control) ?? false); - e.Handled = true; + if (launcher is not null && DataContext is ViewModels.Repository repo) + { + var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); + if (!startDirectly && OperatingSystem.IsMacOS()) + startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); + + repo.Fetch(startDirectly); + e.Handled = true; + } } private void Pull(object _, RoutedEventArgs e) { var launcher = this.FindAncestorOfType(); - (DataContext as ViewModels.Repository)?.Pull(launcher?.HasKeyModifier(KeyModifiers.Control) ?? false); - e.Handled = true; + if (launcher is not null && DataContext is ViewModels.Repository repo) + { + var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); + if (!startDirectly && OperatingSystem.IsMacOS()) + startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); + + repo.Pull(startDirectly); + e.Handled = true; + } } private void Push(object _, RoutedEventArgs e) { var launcher = this.FindAncestorOfType(); - (DataContext as ViewModels.Repository)?.Push(launcher?.HasKeyModifier(KeyModifiers.Control) ?? false); - e.Handled = true; + if (launcher is not null && DataContext is ViewModels.Repository repo) + { + var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); + if (!startDirectly && OperatingSystem.IsMacOS()) + startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); + + repo.Push(startDirectly); + e.Handled = true; + } } private void StashAll(object _, RoutedEventArgs e) From c72506d939ad576585b2d7a05d71620c89be7ef0 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 6 Nov 2024 10:36:10 +0800 Subject: [PATCH 0133/1283] code_style: simplify the way detacting system preferred command key Signed-off-by: leo --- src/Views/CommitMessageTextBox.axaml.cs | 2 +- src/Views/Histories.axaml.cs | 4 +--- src/Views/Launcher.axaml.cs | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Views/CommitMessageTextBox.axaml.cs b/src/Views/CommitMessageTextBox.axaml.cs index 6eec0379..91f8c47e 100644 --- a/src/Views/CommitMessageTextBox.axaml.cs +++ b/src/Views/CommitMessageTextBox.axaml.cs @@ -125,7 +125,7 @@ namespace SourceGit.Views DescriptionEditor.CaretIndex = 0; e.Handled = true; } - else if (e.Key == Key.V && ((OperatingSystem.IsMacOS() && e.KeyModifiers == KeyModifiers.Meta) || (!OperatingSystem.IsMacOS() && e.KeyModifiers == KeyModifiers.Control))) + else if (e.Key == Key.V && e.KeyModifiers == (OperatingSystem.IsMacOS() ? KeyModifiers.Meta : KeyModifiers.Control)) { e.Handled = true; diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index e72888fe..9f436346 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -722,9 +722,7 @@ namespace SourceGit.Views private void OnCommitListKeyDown(object sender, KeyEventArgs e) { - bool isSystemCmdKeyDown = (OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Meta)) || - (!OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Control)); - if (!isSystemCmdKeyDown) + if (!e.KeyModifiers.HasFlag(OperatingSystem.IsMacOS() ? KeyModifiers.Meta : KeyModifiers.Control)) return; // These shortcuts are not mentioned in the Shortcut Reference window. Is this expected? diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index 99916da3..29d90e09 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -115,8 +115,7 @@ namespace SourceGit.Views return; } - if ((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Meta)) || - (!OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Control))) + if (e.KeyModifiers.HasFlag(OperatingSystem.IsMacOS() ? KeyModifiers.Meta : KeyModifiers.Control)) { if (e.Key == Key.W) { From 9cb85081ab8a01c59d5ee526bffbe66b6af7b020 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 6 Nov 2024 12:35:55 +0800 Subject: [PATCH 0134/1283] feature: saving as patch supports multiple commits (#658) Signed-off-by: leo --- src/Commands/SaveChangesAsPatch.cs | 16 +++++++++++- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/ViewModels/Histories.cs | 39 ++++++++++++++++++++++++++++++ src/ViewModels/RevisionCompare.cs | 17 +++++++++++++ src/ViewModels/WorkingCopy.cs | 8 +++--- src/Views/RevisionCompare.axaml | 11 ++++++--- src/Views/RevisionCompare.axaml.cs | 24 ++++++++++++++++++ 9 files changed, 110 insertions(+), 8 deletions(-) diff --git a/src/Commands/SaveChangesAsPatch.cs b/src/Commands/SaveChangesAsPatch.cs index 409127ba..461bbfb5 100644 --- a/src/Commands/SaveChangesAsPatch.cs +++ b/src/Commands/SaveChangesAsPatch.cs @@ -9,7 +9,7 @@ namespace SourceGit.Commands { public static class SaveChangesAsPatch { - public static bool Exec(string repo, List changes, bool isUnstaged, string saveTo) + public static bool ProcessLocalChanges(string repo, List changes, bool isUnstaged, string saveTo) { using (var sw = File.Create(saveTo)) { @@ -23,6 +23,20 @@ namespace SourceGit.Commands return true; } + public static bool ProcessRevisionCompareChanges(string repo, List changes, string baseRevision, string targetRevision, string saveTo) + { + using (var sw = File.Create(saveTo)) + { + foreach (var change in changes) + { + if (!ProcessSingleChange(repo, new Models.DiffOption(baseRevision, targetRevision, change), sw)) + return false; + } + } + + return true; + } + private static bool ProcessSingleChange(string repo, Models.DiffOption opt, FileStream writer) { var starter = new ProcessStartInfo(); diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index ee44181b..7393fd19 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -238,6 +238,7 @@ Next Difference NO CHANGES OR ONLY EOL CHANGES Previous Difference + Save as Patch Show hidden symbols Side-By-Side Diff SUBMODULE diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index b97f9aab..dd457295 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -241,6 +241,7 @@ 下一个差异 没有变更或仅有换行符差异 上一个差异 + 保存为补丁文件 显示隐藏符号 分列对比 子模块 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 494616ab..c4963c39 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -241,6 +241,7 @@ 下一個差異 沒有變更或僅有換行字元差異 上一個差異 + 另存為修補檔 顯示隱藏符號 並排對比 子模組 diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 713e1635..688dab87 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Text; +using System.Threading.Tasks; using Avalonia.Controls; using Avalonia.Platform.Storage; @@ -258,6 +259,44 @@ namespace SourceGit.ViewModels multipleMenu.Items.Add(new MenuItem() { Header = "-" }); } + var saveToPatchMultiple = new MenuItem(); + saveToPatchMultiple.Icon = App.CreateMenuIcon("Icons.Diff"); + saveToPatchMultiple.Header = App.Text("CommitCM.SaveAsPatch"); + saveToPatchMultiple.Click += async (_, e) => + { + var storageProvider = App.GetStorageProvider(); + if (storageProvider == null) + return; + + var options = new FolderPickerOpenOptions() { AllowMultiple = false }; + try + { + var picker = await storageProvider.OpenFolderPickerAsync(options); + if (picker.Count == 1) + { + var saveTo = $"{picker[0].Path.LocalPath}/patches"; + var succ = false; + foreach (var c in selected) + { + succ = await Task.Run(() => new Commands.FormatPatch(_repo.FullPath, c.SHA, saveTo).Exec()); + if (!succ) + break; + } + + if (succ) + App.SendNotification(_repo.FullPath, App.Text("SaveAsPatchSuccess")); + } + } + catch (Exception exception) + { + App.RaiseException(_repo.FullPath, $"Failed to save as patch: {exception.Message}"); + } + + e.Handled = true; + }; + multipleMenu.Items.Add(saveToPatchMultiple); + multipleMenu.Items.Add(new MenuItem() { Header = "-" }); + var copyMultipleSHAs = new MenuItem(); copyMultipleSHAs.Header = App.Text("CommitCM.CopySHA"); copyMultipleSHAs.Icon = App.CreateMenuIcon("Icons.Copy"); diff --git a/src/ViewModels/RevisionCompare.cs b/src/ViewModels/RevisionCompare.cs index 55c85129..ffc05643 100644 --- a/src/ViewModels/RevisionCompare.cs +++ b/src/ViewModels/RevisionCompare.cs @@ -24,6 +24,11 @@ namespace SourceGit.ViewModels private set => SetProperty(ref _endPoint, value); } + public bool CanSaveAsPatch + { + get => _canSaveAsPatch; + } + public List VisibleChanges { get => _visibleChanges; @@ -73,6 +78,7 @@ namespace SourceGit.ViewModels _repo = repo; _startPoint = (object)startPoint ?? new Models.Null(); _endPoint = (object)endPoint ?? new Models.Null(); + _canSaveAsPatch = startPoint != null && endPoint != null; Task.Run(Refresh); } @@ -105,6 +111,16 @@ namespace SourceGit.ViewModels Task.Run(Refresh); } + public void SaveAsPatch(string saveTo) + { + Task.Run(() => + { + var succ = Commands.SaveChangesAsPatch.ProcessRevisionCompareChanges(_repo, _changes, GetSHA(_startPoint), GetSHA(_endPoint), saveTo); + if (succ) + Dispatcher.UIThread.Invoke(() => App.SendNotification(_repo, App.Text("SaveAsPatchSuccess"))); + }); + } + public void ClearSearchFilter() { SearchFilter = string.Empty; @@ -218,6 +234,7 @@ namespace SourceGit.ViewModels private string _repo; private object _startPoint = null; private object _endPoint = null; + private bool _canSaveAsPatch = false; private List _changes = null; private List _visibleChanges = null; private List _selectedChanges = null; diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index 020053f9..4bac8e08 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -539,7 +539,7 @@ namespace SourceGit.ViewModels var storageFile = await storageProvider.SaveFilePickerAsync(options); if (storageFile != null) { - var succ = await Task.Run(() => Commands.SaveChangesAsPatch.Exec(_repo.FullPath, _selectedUnstaged, true, storageFile.Path.LocalPath)); + var succ = await Task.Run(() => Commands.SaveChangesAsPatch.ProcessLocalChanges(_repo.FullPath, _selectedUnstaged, true, storageFile.Path.LocalPath)); if (succ) App.SendNotification(_repo.FullPath, App.Text("SaveAsPatchSuccess")); } @@ -858,7 +858,7 @@ namespace SourceGit.ViewModels var storageFile = await storageProvider.SaveFilePickerAsync(options); if (storageFile != null) { - var succ = await Task.Run(() => Commands.SaveChangesAsPatch.Exec(_repo.FullPath, _selectedUnstaged, true, storageFile.Path.LocalPath)); + var succ = await Task.Run(() => Commands.SaveChangesAsPatch.ProcessLocalChanges(_repo.FullPath, _selectedUnstaged, true, storageFile.Path.LocalPath)); if (succ) App.SendNotification(_repo.FullPath, App.Text("SaveAsPatchSuccess")); } @@ -981,7 +981,7 @@ namespace SourceGit.ViewModels var storageFile = await storageProvider.SaveFilePickerAsync(options); if (storageFile != null) { - var succ = await Task.Run(() => Commands.SaveChangesAsPatch.Exec(_repo.FullPath, _selectedStaged, false, storageFile.Path.LocalPath)); + var succ = await Task.Run(() => Commands.SaveChangesAsPatch.ProcessLocalChanges(_repo.FullPath, _selectedStaged, false, storageFile.Path.LocalPath)); if (succ) App.SendNotification(_repo.FullPath, App.Text("SaveAsPatchSuccess")); } @@ -1156,7 +1156,7 @@ namespace SourceGit.ViewModels var storageFile = await storageProvider.SaveFilePickerAsync(options); if (storageFile != null) { - var succ = await Task.Run(() => Commands.SaveChangesAsPatch.Exec(_repo.FullPath, _selectedStaged, false, storageFile.Path.LocalPath)); + var succ = await Task.Run(() => Commands.SaveChangesAsPatch.ProcessLocalChanges(_repo.FullPath, _selectedStaged, false, storageFile.Path.LocalPath)); if (succ) App.SendNotification(_repo.FullPath, App.Text("SaveAsPatchSuccess")); } diff --git a/src/Views/RevisionCompare.axaml b/src/Views/RevisionCompare.axaml index f6303b45..912fde39 100644 --- a/src/Views/RevisionCompare.axaml +++ b/src/Views/RevisionCompare.axaml @@ -35,21 +35,26 @@ - + - + + + + diff --git a/src/Views/RevisionCompare.axaml.cs b/src/Views/RevisionCompare.axaml.cs index b484b78f..2c548240 100644 --- a/src/Views/RevisionCompare.axaml.cs +++ b/src/Views/RevisionCompare.axaml.cs @@ -1,5 +1,7 @@ using Avalonia.Controls; using Avalonia.Input; +using Avalonia.Interactivity; +using Avalonia.Platform.Storage; namespace SourceGit.Views { @@ -28,5 +30,27 @@ namespace SourceGit.Views e.Handled = true; } + + private async void OnSaveAsPatch(object sender, RoutedEventArgs e) + { + var topLevel = TopLevel.GetTopLevel(this); + if (topLevel == null) + return; + + var vm = DataContext as ViewModels.RevisionCompare; + if (vm == null) + return; + + var options = new FilePickerSaveOptions(); + options.Title = App.Text("FileCM.SaveAsPatch"); + options.DefaultExtension = ".patch"; + options.FileTypeChoices = [new FilePickerFileType("Patch File") { Patterns = ["*.patch"] }]; + + var storageFile = await topLevel.StorageProvider.SaveFilePickerAsync(options); + if (storageFile != null) + vm.SaveAsPatch(storageFile.Path.LocalPath); + + e.Handled = true; + } } } From a715143a162bd7c0cbe80a869e0b6fe69ff179c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 Nov 2024 04:36:13 +0000 Subject: [PATCH 0135/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 69e0d738..9072e28b 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-95.08%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.42%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.83%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-89.87%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-98.99%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-94.94%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.28%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.71%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-89.74%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-98.84%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 05bf208c..eb084e0b 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 95.08% +### de_DE.axaml: 94.94%
@@ -22,6 +22,7 @@ - Text.Configure.OpenAI - Text.Configure.OpenAI.Prefered - Text.Configure.OpenAI.Prefered.Tip +- Text.Diff.SaveAsPatch - Text.Diff.VisualLines.All - Text.ExecuteCustomAction - Text.ExecuteCustomAction.Name @@ -41,12 +42,13 @@
-### es_ES.axaml: 99.42% +### es_ES.axaml: 99.28%
Missing Keys +- Text.Diff.SaveAsPatch - Text.Hotkeys.Repo.CreateBranchOnCommit - Text.Hotkeys.Repo.Fetch - Text.Hotkeys.Repo.Pull @@ -54,7 +56,7 @@
-### fr_FR.axaml: 86.83% +### fr_FR.axaml: 86.71%
@@ -99,6 +101,7 @@ - Text.ConventionalCommit.ShortDescription - Text.ConventionalCommit.Type - Text.Diff.IgnoreWhitespace +- Text.Diff.SaveAsPatch - Text.Diff.VisualLines.All - Text.Discard.IncludeIgnored - Text.ExecuteCustomAction @@ -154,7 +157,7 @@
-### pt_BR.axaml: 89.87% +### pt_BR.axaml: 89.74%
@@ -201,6 +204,7 @@ - Text.ConventionalCommit.ShortDescription - Text.ConventionalCommit.Type - Text.CopyAllText +- Text.Diff.SaveAsPatch - Text.Diff.VisualLines.All - Text.Discard.IncludeIgnored - Text.ExecuteCustomAction @@ -233,12 +237,13 @@
-### ru_RU.axaml: 98.99% +### ru_RU.axaml: 98.84%
Missing Keys +- Text.Diff.SaveAsPatch - Text.Diff.VisualLines.All - Text.Hotkeys.Repo.CreateBranchOnCommit - Text.Hotkeys.Repo.Fetch From 88cec05e67424c1cd8e254104eae93e4b01b68a5 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 6 Nov 2024 14:50:25 +0800 Subject: [PATCH 0136/1283] ux: do not use OpenAI logo Signed-off-by: leo --- src/Resources/Icons.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml index fb0759d7..53b2b3d3 100644 --- a/src/Resources/Icons.axaml +++ b/src/Resources/Icons.axaml @@ -1,6 +1,6 @@ M41 512c0-128 46-241 138-333C271 87 384 41 512 41s241 46 333 138c92 92 138 205 138 333s-46 241-138 333c-92 92-205 138-333 138s-241-46-333-138C87 753 41 640 41 512zm87 0c0 108 36 195 113 271s164 113 271 113c108 0 195-36 271-113s113-164 113-271-36-195-113-271c-77-77-164-113-271-113-108 0-195 36-271 113C164 317 128 404 128 512zm256 148V292l195 113L768 512l-195 113-195 113v-77zm148-113-61 36V440l61 36 61 36-61 36z - M951 419a255 255 0 00-22-209 258 258 0 00-278-124A259 259 0 00213 178a255 255 0 00-171 124 258 258 0 0032 303 255 255 0 0022 210 258 258 0 00278 124A255 255 0 00566 1024a258 258 0 00246-179 256 256 0 00171-124 258 258 0 00-32-302zM566 957a191 191 0 01-123-44l6-3 204-118a34 34 0 0017-29v-287l86 50a3 3 0 012 2v238a192 192 0 01-192 192zM154 781a191 191 0 01-23-129l6 4 204 118a33 33 0 0033 0l249-144v99a3 3 0 01-1 3L416 851a192 192 0 01-262-70zM100 337a191 191 0 01101-84V495a33 33 0 0017 29l248 143-86 50a3 3 0 01-3 0l-206-119A192 192 0 01100 336zm708 164-249-145L645 307a3 3 0 013 0l206 119a192 192 0 01-29 346v-242a34 34 0 00-17-28zm86-129-6-4-204-119a33 33 0 00-33 0L401 394V294a3 3 0 011-3l206-119a192 192 0 01285 199zm-539 176-86-50a3 3 0 01-2-2V259a192 192 0 01315-147l-6 3-204 118a34 34 0 00-17 29zm47-101 111-64 111 64v128l-111 64-111-64z + M304 464a128 128 0 01128-128c71 0 128 57 128 128v224a32 32 0 01-64 0V592h-128v95a32 32 0 01-64 0v-224zm64 1v64h128v-64a64 64 0 00-64-64c-35 0-64 29-64 64zM688 337c18 0 32 14 32 32v319a32 32 0 01-32 32c-18 0-32-14-32-32v-319a32 32 0 0132-32zM84 911l60-143A446 446 0 0164 512C64 265 265 64 512 64s448 201 448 448-201 448-448 448c-54 0-105-9-153-27l-242 22a32 32 0 01-32-44zm133-150-53 126 203-18 13 5c41 15 85 23 131 23 212 0 384-172 384-384S724 128 512 128 128 300 128 512c0 82 26 157 69 220l20 29z M296 392h64v64h-64zM296 582v160h128V582h-64v-62h-64v62zm80 48v64h-32v-64h32zM360 328h64v64h-64zM296 264h64v64h-64zM360 456h64v64h-64zM360 200h64v64h-64zM855 289 639 73c-6-6-14-9-23-9H192c-18 0-32 14-32 32v832c0 18 14 32 32 32h640c18 0 32-14 32-32V311c0-9-3-17-9-23zM790 326H602V138L790 326zm2 562H232V136h64v64h64v-64h174v216c0 23 19 42 42 42h216v494z M71 1024V0h661L953 219V1024H71zm808-731-220-219H145V951h735V293zM439 512h-220V219h220V512zm-74-219H292v146h74v-146zm0 512h74v73h-220v-73H292v-146H218V585h147v219zm294-366h74V512H512v-73h74v-146H512V219h147v219zm74 439H512V585h220v293zm-74-219h-74v146h74v-146z M128 256h192a64 64 0 110 128H128a64 64 0 110-128zm576 192h192a64 64 0 010 128h-192a64 64 0 010-128zm-576 192h192a64 64 0 010 128H128a64 64 0 010-128zm576 0h192a64 64 0 010 128h-192a64 64 0 010-128zm0-384h192a64 64 0 010 128h-192a64 64 0 010-128zM128 448h192a64 64 0 110 128H128a64 64 0 110-128zm384-320a64 64 0 0164 64v640a64 64 0 01-128 0V192a64 64 0 0164-64z From 45f4a5a4b1d9e9779a89b14f7e35276899877fa4 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 7 Nov 2024 11:07:47 +0800 Subject: [PATCH 0137/1283] ux: layout of floating panels (commands and notifications) (#659) Signed-off-by: leo --- src/Views/LauncherPage.axaml | 180 ++++++++++++++++---------------- src/Views/LauncherPage.axaml.cs | 2 +- 2 files changed, 90 insertions(+), 92 deletions(-) diff --git a/src/Views/LauncherPage.axaml b/src/Views/LauncherPage.axaml index 1b256e7b..e75fd936 100644 --- a/src/Views/LauncherPage.axaml +++ b/src/Views/LauncherPage.axaml @@ -5,6 +5,7 @@ xmlns:m="using:SourceGit.Models" xmlns:v="using:SourceGit.Views" xmlns:vm="using:SourceGit.ViewModels" + xmlns:c="using:SourceGit.Converters" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="SourceGit.Views.LauncherPage" x:DataType="vm:LauncherPage"> @@ -38,103 +39,100 @@ - - - - - - - - - - - + + + + + + + + - - - + - - - -
-### pt_BR.axaml: 89.60% +### pt_BR.axaml: 100.00%
Missing Keys -- Text.About.Chart -- Text.AIAssistant -- Text.AIAssistant.Tip -- Text.BranchCM.FetchInto -- Text.ChangeCM.GenerateCommitMessage -- Text.CherryPick.AppendSourceToMessage -- Text.CherryPick.Mainline -- Text.CherryPick.Mainline.Tips -- Text.CommitCM.CherryPickMultiple -- Text.CommitCM.CustomAction -- Text.CommitCM.SquashCommitsSinceThis -- Text.CommitDetail.Info.ContainsIn -- Text.CommitDetail.Info.ContainsIn.Title -- Text.CommitDetail.Info.WebLinks -- Text.Configure.CustomAction -- Text.Configure.CustomAction.Arguments -- Text.Configure.CustomAction.Arguments.Tip -- Text.Configure.CustomAction.Executable -- Text.Configure.CustomAction.Name -- Text.Configure.CustomAction.Scope -- Text.Configure.CustomAction.Scope.Commit -- Text.Configure.CustomAction.Scope.Repository -- Text.Configure.Git.DefaultRemote -- Text.Configure.Git.EnablePruneOnFetch -- Text.Configure.Git.EnableSignOff -- Text.Configure.IssueTracker.AddSampleGitLabIssue -- Text.Configure.IssueTracker.AddSampleGitLabMergeRequest -- Text.Configure.OpenAI -- Text.Configure.OpenAI.Prefered -- Text.Configure.OpenAI.Prefered.Tip -- Text.ConfigureWorkspace -- Text.ConfigureWorkspace.Color -- Text.ConfigureWorkspace.Restore -- Text.ConventionalCommit -- Text.ConventionalCommit.BreakingChanges -- Text.ConventionalCommit.ClosedIssue -- Text.ConventionalCommit.Detail -- Text.ConventionalCommit.Scope -- Text.ConventionalCommit.ShortDescription -- Text.ConventionalCommit.Type -- Text.CopyAllText -- Text.Diff.SaveAsPatch -- Text.Diff.VisualLines.All -- Text.Discard.IncludeIgnored -- Text.ExecuteCustomAction -- Text.ExecuteCustomAction.Name -- Text.FileHistory.FileContent -- Text.FileHistory.FileChange -- Text.GitLFS.Locks.OnlyMine -- Text.Hotkeys.Repo.CreateBranchOnCommit -- Text.Hotkeys.Repo.Fetch -- Text.Hotkeys.Repo.Pull -- Text.Hotkeys.Repo.Push -- Text.IssueLinkCM.OpenInBrowser -- Text.IssueLinkCM.CopyLink -- Text.MoveRepositoryNode -- Text.MoveRepositoryNode.Target -- Text.Preference.AI.Name -- Text.Preference.Appearance.EditorFontSize -- Text.Push.CheckSubmodules -- Text.Repository.CustomActions -- Text.Repository.CustomActions.Empty -- Text.Squash.Into -- Text.Stash.KeepIndex -- Text.Stash.OnlyStagedChanges -- Text.Stash.TipForSelectedFiles -- Text.Statistics.Overview -- Text.TagCM.CopyMessage -- Text.WorkingCopy.Staged.UnstageAll -- Text.WorkingCopy.Unstaged -- Text.WorkingCopy.Unstaged.Stage -- Text.WorkingCopy.Unstaged.StageAll +
From 3b4e03754796b0befe99e393c6de5bb7a3765c74 Mon Sep 17 00:00:00 2001 From: Katharina Sternbauer Date: Fri, 8 Nov 2024 14:25:47 +0100 Subject: [PATCH 0149/1283] add missing german localization for v8.37 (#664) Add the missing keys in the German translation file. --- src/Resources/Locales/de_DE.axaml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index ef426bf8..c99acf77 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -58,6 +58,7 @@ Lösche alle ausgewählten {0} Branches Alle Änderungen verwerfen Fast-Forward zu ${0}$ + Fetche ${0}$ nach ${1}$... Git Flow - Abschließen ${0}$ Merge ${0}$ in ${1}$ hinein... Pull ${0}$ @@ -72,6 +73,7 @@ ABBRECHEN Auf diese Revision zurücksetzen Auf Vorgänger-Revision zurücksetzen + Generiere Commit-Nachricht ANZEIGE MODUS ÄNDERN Zeige als Datei- und Ordnerliste Zeige als Pfadliste @@ -109,6 +111,7 @@ Mit Worktree vergleichen Info kopieren SHA kopieren + Benutzerdefinierte Aktion Interactives Rebase von ${0}$ auf diesen Commit Rebase von ${0}$ auf diesen Commit Reset ${0}$ auf diesen Commit @@ -140,20 +143,35 @@ COMMIT TEMPLATE Template Name: Template Inhalt: + BENUTZERDEFINIERTE AKTION + Argumente: + ${REPO} - Repository Pfad; ${SHA} - SHA-Wert des selektierten Commits + Ausführbare Datei: + Name: + Geltungsbereich: + Commit + Repository Email Adresse Email Adresse GIT Remotes automatisch fetchen Minute(n) Standard Remote + Aktivere --prune beim fetchen + Aktiviere --signoff für Commits TICKETSYSTEM Beispiel für Github-Regel hinzufügen Beispiel für Jira-Regel hinzufügen + Beispiel für eine Gitlab Issue Regel einfügen + Beispiel für einen Gitlab Merge Request einfügen Neue Regel Ticketnummer Regex-Ausdruck: Name: Ergebnis-URL: Verwende bitte $1, $2 um auf Regex-Gruppenwerte zuzugreifen. + OPEN AI + Bevorzugter Service: + Wenn der 'Bevorzugte Service' aktiviert ist, wird SourceGit nur dieses Repository nutzen. Ansonsten wird, wenn mehrere Services verfügbar sind, eine Kontextmenü zur Auswahl angezeigt. HTTP Proxy HTTP Proxy für dieses Repository Benutzername @@ -245,6 +263,8 @@ Ziel: Ausgewählte Gruppe bearbeiten Ausgewähltes Repository bearbeiten + Führe benutzerte Aktion aus + Name der Aktion: Fast-Forward (ohne Auschecken) Fetch Alle Remotes fetchen @@ -401,8 +421,11 @@ Vor {0} Jahren Einstellungen OPEN AI - Server + Analysierung des Diff Befehl API Schlüssel + Generiere Nachricht Befehl + Name + Server Modell DARSTELLUNG Standardschriftart @@ -506,6 +529,8 @@ Alles löschen Repository Einstellungen WEITER + Benutzerdefinierte Aktionen + Keine benutzerdefinierten Aktionen Aktiviere '--reflog' Option Öffne im Datei-Browser Suche Branches/Tags/Submodule @@ -568,6 +593,7 @@ START Stash Inklusive nicht-verfolgter Dateien + Behalte Dateien des Stages Name: Optional. Name dieses Stashes Nur gestagte Änderungen @@ -637,6 +663,7 @@ Template/Historie Klick-Ereignis auslösen Alle Änderungen stagen und committen + Leerer Commit erkannt! Fortfahren (--allow-empty)? KONFLIKTE ERKANNT DATEI KONFLIKTE GELÖST NICHT-VERFOLGTE DATEIEN INKLUDIEREN From b974436c8abcd5e72a127df48f2800e288451285 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 8 Nov 2024 13:25:59 +0000 Subject: [PATCH 0150/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 29 +---------------------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 9194df17..257c999f 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-94.80%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.13%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.56%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.70%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.13%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.56%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 8d3f8010..c5950f28 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,45 +1,18 @@ -### de_DE.axaml: 94.80% +### de_DE.axaml: 98.70%
Missing Keys -- Text.BranchCM.FetchInto -- Text.ChangeCM.GenerateCommitMessage -- Text.CommitCM.CustomAction -- Text.Configure.CustomAction -- Text.Configure.CustomAction.Arguments -- Text.Configure.CustomAction.Arguments.Tip -- Text.Configure.CustomAction.Executable -- Text.Configure.CustomAction.Name -- Text.Configure.CustomAction.Scope -- Text.Configure.CustomAction.Scope.Commit -- Text.Configure.CustomAction.Scope.Repository -- Text.Configure.Git.EnablePruneOnFetch -- Text.Configure.Git.EnableSignOff -- Text.Configure.IssueTracker.AddSampleGitLabIssue -- Text.Configure.IssueTracker.AddSampleGitLabMergeRequest -- Text.Configure.OpenAI -- Text.Configure.OpenAI.Prefered -- Text.Configure.OpenAI.Prefered.Tip - Text.Diff.SaveAsPatch - Text.Diff.VisualLines.All -- Text.ExecuteCustomAction -- Text.ExecuteCustomAction.Name - Text.Hotkeys.Repo.CreateBranchOnCommit - Text.Hotkeys.Repo.Fetch - Text.Hotkeys.Repo.Pull - Text.Hotkeys.Repo.Push - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink -- Text.Preference.AI.AnalyzeDiffPrompt -- Text.Preference.AI.GenerateSubjectPrompt -- Text.Preference.AI.Name - Text.Preference.Appearance.EditorFontSize -- Text.Repository.CustomActions -- Text.Repository.CustomActions.Empty -- Text.Stash.KeepIndex -- Text.WorkingCopy.ConfirmCommitWithoutFiles
From 4924e960bffc2343f809d3ad93027e6080cf4dad Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Sun, 10 Nov 2024 04:51:15 +0000 Subject: [PATCH 0151/1283] feature: allow merging tags into branches (#671) Adds "Merge {tag} into {branch}" menu item to tag menu in histories. The rest is handled by already existing merge code. --- src/Resources/Locales/de_DE.axaml | 1 + src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/es_ES.axaml | 1 + src/Resources/Locales/fr_FR.axaml | 1 + src/Resources/Locales/pt_BR.axaml | 1 + src/Resources/Locales/ru_RU.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/ViewModels/Histories.cs | 17 +++++++++++++++-- 9 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index c99acf77..d1f43695 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -627,6 +627,7 @@ Tag-Namen kopieren Tag-Nachricht kopieren Lösche ${0}$... + Merge ${0}$ in ${1}$ hinein... Pushe ${0}$... URL: Submodule aktualisieren diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 166ad3ab..3803bd39 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -633,6 +633,7 @@ Copy Tag Name Copy Tag Message Delete ${0}$... + Merge ${0}$ into ${1}$... Push ${0}$... URL: Update Submodules diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 43296be0..8ae1d789 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -631,6 +631,7 @@ Copiar Nombre de la Etiqueta Copiar Mensaje de la Etiqueta Eliminar ${0}$... + Merge ${0}$ en ${1}$... Push ${0}$... URL: Actualizar Submódulos diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index f50b8f34..043e8f97 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -551,6 +551,7 @@ OK Copy Tag Name Delete ${0}$... + Fusionner ${0}$ dans ${1}$... Push ${0}$... URL : Actualiser les sous-modules diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index d7f4170d..61ded334 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -661,6 +661,7 @@ Copiar Nome da Tag Copiar mensage da Tag Excluir ${0}$... + Mesclar ${0}$ em ${1}$... Enviar ${0}$... Todos os submódulos Inicializar conforme necessário diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index cfca1cc8..3ea6a922 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -637,6 +637,7 @@ Копировать имя метки Копировать сообщение с метки Удалить ${0}$... + Слить ${0}$ в ${1}$... Выложить ${0}$... Сетевой адрес: Обновление подмодулей diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 5632a3ef..3df54899 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -636,6 +636,7 @@ 复制标签名 复制标签信息 删除 ${0}$... + 合并 ${0}$ 到 ${1}$... 推送 ${0}$... 仓库地址 : 更新子模块 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 229a5fdb..4dcb31aa 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -636,6 +636,7 @@ 複製標籤名稱 複製標籤訊息 刪除 ${0}$... + 合併 ${0}$ 到 ${1}$... 推送 ${0}$... 存放庫網址: 更新子模組 diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 688dab87..47736a06 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -365,7 +365,7 @@ namespace SourceGit.ViewModels if (tags.Count > 0) { foreach (var tag in tags) - FillTagMenu(menu, tag); + FillTagMenu(menu, tag, current, commit.IsMerged); menu.Items.Add(new MenuItem() { Header = "-" }); } @@ -893,7 +893,7 @@ namespace SourceGit.ViewModels menu.Items.Add(submenu); } - private void FillTagMenu(ContextMenu menu, Models.Tag tag) + private void FillTagMenu(ContextMenu menu, Models.Tag tag, Models.Branch current, bool merged) { var submenu = new MenuItem(); submenu.Header = tag.Name; @@ -912,6 +912,19 @@ namespace SourceGit.ViewModels }; submenu.Items.Add(push); + var merge = new MenuItem(); + merge.Header = new Views.NameHighlightedTextBlock("TagCM.Merge", tag.Name, current.Name); + merge.Icon = App.CreateMenuIcon("Icons.Merge"); + merge.IsEnabled = !merged; + merge.Click += (_, e) => + { + if (PopupHost.CanCreatePopup()) + PopupHost.ShowPopup(new Merge(_repo, tag.Name, current.Name)); + e.Handled = true; + }; + submenu.Items.Add(merge); + submenu.Items.Add(new MenuItem() { Header = "-" }); + var delete = new MenuItem(); delete.Header = new Views.NameHighlightedTextBlock("TagCM.Delete", tag.Name); delete.Icon = App.CreateMenuIcon("Icons.Clear"); From 96c2d0b3caad9dc7f9fea884639d88d95d5af720 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 10 Nov 2024 04:51:30 +0000 Subject: [PATCH 0152/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 257c999f..99f4370e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.70%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.13%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.56%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.70%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.13%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.58%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index c5950f28..dd16b917 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -31,7 +31,7 @@ -### fr_FR.axaml: 86.56% +### fr_FR.axaml: 86.58%
From bbfc94d624d7ec2c1d77a64fc2661c77ebc70ca3 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Sun, 10 Nov 2024 04:56:08 +0000 Subject: [PATCH 0153/1283] enhance: several commit links improvements (#672) * Codeberge (https://codeberg.org/) * Gitea (https://gitea.org/) * sourcehut (https://git.sr.ht/) --- src/ViewModels/CommitDetail.cs | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 1600c4cd..f1f39f6f 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -116,13 +116,19 @@ namespace SourceGit.ViewModels if (remote.TryGetVisitURL(out var url)) { if (url.StartsWith("https://github.com/", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = "Github", URLPrefix = $"{url}/commit/" }); - else if (url.StartsWith("https://gitlab.com/", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = "GitLab", URLPrefix = $"{url}/-/commit/" }); + WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("Github", url), URLPrefix = $"{url}/commit/" }); + else if (url.StartsWith("https://gitlab.", StringComparison.Ordinal)) + WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("GitLab", url), URLPrefix = $"{url}/-/commit/" }); else if (url.StartsWith("https://gitee.com/", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = "Gitee", URLPrefix = $"{url}/commit/" }); + WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("Gitee", url), URLPrefix = $"{url}/commit/" }); else if (url.StartsWith("https://bitbucket.org/", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = "Bitbucket", URLPrefix = $"{url}/commits/" }); + WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("Bitbucket", url), URLPrefix = $"{url}/commits/" }); + else if (url.StartsWith("https://codeberg.org/", StringComparison.Ordinal)) + WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("Codeberg", url), URLPrefix = $"{url}/commit/" }); + else if (url.StartsWith("https://gitea.org/", StringComparison.Ordinal)) + WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("Gitea", url), URLPrefix = $"{url}/commit/" }); + else if (url.StartsWith("https://git.sr.ht/", StringComparison.Ordinal)) + WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("sourcehut", url), URLPrefix = $"{url}/commit/" }); } } } @@ -639,6 +645,18 @@ namespace SourceGit.ViewModels menu.Items.Add(new MenuItem() { Header = "-" }); } + private string CommitUrlTitle(string provider, string url) + { + try + { + return string.Format("{0} ({1})", provider, string.Join('/', url.Split('/')[3..5])); + } + catch + { + return provider; + } + } + [GeneratedRegex(@"^version https://git-lfs.github.com/spec/v\d+\r?\noid sha256:([0-9a-f]+)\r?\nsize (\d+)[\r\n]*$")] private static partial Regex REG_LFS_FORMAT(); From daba8e5064dc4ff9dfef818f7b6f9c85e0c758f1 Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 10 Nov 2024 13:19:05 +0800 Subject: [PATCH 0154/1283] code_review: PR #672 * use formatted string instead of `CommitUrlTitle` Signed-off-by: leo --- src/ViewModels/CommitDetail.cs | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index f1f39f6f..3f41eb99 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -115,20 +115,24 @@ namespace SourceGit.ViewModels { if (remote.TryGetVisitURL(out var url)) { + var trimmedUrl = url; + if (url.EndsWith(".git")) + trimmedUrl = url.Substring(0, url.Length - 4); + if (url.StartsWith("https://github.com/", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("Github", url), URLPrefix = $"{url}/commit/" }); + WebLinks.Add(new Models.CommitLink() { Name = $"Github ({trimmedUrl.Substring(19)})", URLPrefix = $"{url}/commit/" }); else if (url.StartsWith("https://gitlab.", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("GitLab", url), URLPrefix = $"{url}/-/commit/" }); + WebLinks.Add(new Models.CommitLink() { Name = $"GitLab ({trimmedUrl.Substring(trimmedUrl.Substring(15).IndexOf('/') + 16)})", URLPrefix = $"{url}/-/commit/" }); else if (url.StartsWith("https://gitee.com/", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("Gitee", url), URLPrefix = $"{url}/commit/" }); + WebLinks.Add(new Models.CommitLink() { Name = $"Gitee ({trimmedUrl.Substring(18)})", URLPrefix = $"{url}/commit/" }); else if (url.StartsWith("https://bitbucket.org/", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("Bitbucket", url), URLPrefix = $"{url}/commits/" }); + WebLinks.Add(new Models.CommitLink() { Name = $"BitBucket ({trimmedUrl.Substring(22)})", URLPrefix = $"{url}/commits/" }); else if (url.StartsWith("https://codeberg.org/", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("Codeberg", url), URLPrefix = $"{url}/commit/" }); + WebLinks.Add(new Models.CommitLink() { Name = $"Codeberg ({trimmedUrl.Substring(21)})", URLPrefix = $"{url}/commit/" }); else if (url.StartsWith("https://gitea.org/", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("Gitea", url), URLPrefix = $"{url}/commit/" }); + WebLinks.Add(new Models.CommitLink() { Name = $"Gitea ({trimmedUrl.Substring(18)})", URLPrefix = $"{url}/commit/" }); else if (url.StartsWith("https://git.sr.ht/", StringComparison.Ordinal)) - WebLinks.Add(new Models.CommitLink() { Name = CommitUrlTitle("sourcehut", url), URLPrefix = $"{url}/commit/" }); + WebLinks.Add(new Models.CommitLink() { Name = $"sourcehut ({trimmedUrl.Substring(18)})", URLPrefix = $"{url}/commit/" }); } } } @@ -645,18 +649,6 @@ namespace SourceGit.ViewModels menu.Items.Add(new MenuItem() { Header = "-" }); } - private string CommitUrlTitle(string provider, string url) - { - try - { - return string.Format("{0} ({1})", provider, string.Join('/', url.Split('/')[3..5])); - } - catch - { - return provider; - } - } - [GeneratedRegex(@"^version https://git-lfs.github.com/spec/v\d+\r?\noid sha256:([0-9a-f]+)\r?\nsize (\d+)[\r\n]*$")] private static partial Regex REG_LFS_FORMAT(); From 8de37720faff606935be2fed5a278d18fe8a6237 Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 10 Nov 2024 13:19:25 +0800 Subject: [PATCH 0155/1283] code_style: remove Rider warnings Signed-off-by: leo --- src/ViewModels/CommitDetail.cs | 2 +- src/ViewModels/Histories.cs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 3f41eb99..cf677c34 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -196,7 +196,7 @@ namespace SourceGit.ViewModels var stream = Commands.QueryFileContent.Run(_repo.FullPath, _commit.SHA, file.Path); var fileSize = stream.Length; var bitmap = fileSize > 0 ? new Bitmap(stream) : null; - var imageType = Path.GetExtension(file.Path).TrimStart('.').ToUpper(CultureInfo.CurrentCulture); + var imageType = ext!.Substring(1).ToUpper(CultureInfo.CurrentCulture); var image = new Models.RevisionImageFile() { Image = bitmap, FileSize = fileSize, ImageType = imageType }; Dispatcher.UIThread.Invoke(() => ViewRevisionFileContent = image); } diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 47736a06..55b04713 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -153,12 +153,9 @@ namespace SourceGit.ViewModels } else if (commits.Count == 1) { - var commit = commits[0] as Models.Commit; - + var commit = (commits[0] as Models.Commit)!; if (_repo.SearchResultSelectedCommit == null || _repo.SearchResultSelectedCommit.SHA != commit.SHA) - { _repo.SearchResultSelectedCommit = _repo.SearchedCommits.Find(x => x.SHA == commit.SHA); - } AutoSelectedCommit = commit; NavigationId = _navigationId + 1; @@ -224,7 +221,7 @@ namespace SourceGit.ViewModels public ContextMenu MakeContextMenu(ListBox list) { var current = _repo.CurrentBranch; - if (current == null) + if (current == null || list.SelectedItems == null) return null; if (list.SelectedItems.Count > 1) From 8b3212e287c72b3afd219468da179bc3b2fc5f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernat=20Borr=C3=A0s=20Civil?= <70479573+BernatBC@users.noreply.github.com> Date: Mon, 11 Nov 2024 02:19:41 +0100 Subject: [PATCH 0156/1283] localization: update spanish translation (#676) --- src/Resources/Locales/es_ES.axaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 8ae1d789..6bc96dd1 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -242,6 +242,7 @@ Siguiente Diferencia SIN CAMBIOS O SOLO CAMBIOS DE EOL Diferencia Anterior + Guardar como Patch Mostrar símbolos ocultos Diferencia Lado a Lado SUBMÓDULO @@ -367,8 +368,12 @@ Commit cambios staged Commit y push cambios staged Stage todos los cambios y commit + Crea una nueva rama basada en el commit seleccionado Descartar cambios seleccionados + Fetch, empieza directamente Modo Dashboard (Por Defecto) + Pull, empieza directamente + Push, empieza directamente Forzar a recargar este repositorio Stage/Unstage cambios seleccionados Modo de búsqueda de commits @@ -434,6 +439,7 @@ APARIENCIA Fuente por defecto Tamaño de fuente por defecto + Tamaño de fuente del editor Fuente Monospace Usar solo fuente monospace en el editor de texto Tema From e2e79fe1b34a5524dac49dbfb53b27accabd9049 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Nov 2024 01:19:53 +0000 Subject: [PATCH 0157/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 99f4370e..e464f74c 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.70%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.13%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.58%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.70%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-100.00%25-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.58%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index dd16b917..587ba99a 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -16,18 +16,13 @@
-### es_ES.axaml: 99.13% +### es_ES.axaml: 100.00%
Missing Keys -- Text.Diff.SaveAsPatch -- Text.Hotkeys.Repo.CreateBranchOnCommit -- Text.Hotkeys.Repo.Fetch -- Text.Hotkeys.Repo.Pull -- Text.Hotkeys.Repo.Push -- Text.Preference.Appearance.EditorFontSize +
From 03f96cc9f8d76754d58b25509c258ea5e48177f5 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Mon, 11 Nov 2024 01:24:49 +0000 Subject: [PATCH 0158/1283] feature: add children list to the commit base info view (#673) --- src/Commands/QueryCommitChildren.cs | 34 +++++++++++++++++++++++++++++ src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/fr_FR.axaml | 1 + src/ViewModels/CommitDetail.cs | 13 +++++++++++ src/Views/CommitBaseInfo.axaml | 34 ++++++++++++++++++++++++----- src/Views/CommitBaseInfo.axaml.cs | 11 +++++++++- src/Views/CommitDetail.axaml | 1 + 7 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 src/Commands/QueryCommitChildren.cs diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs new file mode 100644 index 00000000..22a44563 --- /dev/null +++ b/src/Commands/QueryCommitChildren.cs @@ -0,0 +1,34 @@ +namespace SourceGit.Commands +{ + public class QueryCommitChildren : Command + { + public QueryCommitChildren(string repo, string sha) + { + WorkingDirectory = repo; + Context = repo; + _sha = sha; + Args = $"rev-list --children --all {sha}^.."; + } + + public string[] Result() + { + var rs = ReadToEnd(); + if (!rs.IsSuccess) + return []; + + int start = rs.StdOut.IndexOf($"\n{_sha}"); + if (start != -1) + { + int end = rs.StdOut.IndexOf('\n', start + 1); + if (end == -1) + end = rs.StdOut.Length; + start = rs.StdOut.IndexOf(' ', start); + if (start != -1 && start < end) + return rs.StdOut.Substring(start + 1, end - start - 1).Split(' ', System.StringSplitOptions.RemoveEmptyEntries); + } + return []; + } + + private string _sha; + } +} diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 3803bd39..302f7cba 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -125,6 +125,7 @@ INFORMATION AUTHOR CHANGED + CHILDREN COMMITTER Check refs that contains this commit COMMIT IS CONTAINED BY diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 043e8f97..88e2a661 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -118,6 +118,7 @@ INFORMATIONS AUTEUR CHANGÉ + ENFANTS COMMITTER Vérifier les références contenant ce commit LE COMMIT EST CONTENU PAR diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index cf677c34..349dc56d 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -78,6 +78,12 @@ namespace SourceGit.ViewModels } } + public AvaloniaList Children + { + get; + private set; + } = new AvaloniaList(); + public string SearchChangeFilter { get => _searchChangeFilter; @@ -496,6 +502,7 @@ namespace SourceGit.ViewModels VisibleChanges = null; SelectedChanges = null; ViewRevisionFileContent = null; + Children.Clear(); if (_commit == null) return; @@ -512,6 +519,12 @@ namespace SourceGit.ViewModels Dispatcher.UIThread.Invoke(() => SignInfo = signInfo); }); + Task.Run(() => + { + var children = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA).Result(); + Dispatcher.UIThread.Invoke(() => Children.AddRange(children)); + }); + if (_cancelToken != null) _cancelToken.Requested = true; diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index a16143ae..a886cd9e 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -51,7 +51,7 @@ - + @@ -117,14 +117,36 @@ TextDecorations="Underline" Cursor="Hand" Margin="0,0,16,0" - PointerPressed="OnParentSHAPressed"/> + PointerPressed="OnSHAPressed"/> + + + + + + + + + + + + + + + + - - + + - - + SetValue(IssueTrackerRulesProperty, value); } + public static readonly StyledProperty> ChildrenProperty = + AvaloniaProperty.Register>(nameof(Children)); + + public AvaloniaList Children + { + get => GetValue(ChildrenProperty); + set => SetValue(ChildrenProperty, value); + } + public CommitBaseInfo() { InitializeComponent(); @@ -113,7 +122,7 @@ namespace SourceGit.Views e.Handled = true; } - private void OnParentSHAPressed(object sender, PointerPressedEventArgs e) + private void OnSHAPressed(object sender, PointerPressedEventArgs e) { if (DataContext is ViewModels.CommitDetail detail && sender is Control { DataContext: string sha }) { diff --git a/src/Views/CommitDetail.axaml b/src/Views/CommitDetail.axaml index cb99b3d9..4c6fd5dc 100644 --- a/src/Views/CommitDetail.axaml +++ b/src/Views/CommitDetail.axaml @@ -24,6 +24,7 @@ SignInfo="{Binding SignInfo}" SupportsContainsIn="True" WebLinks="{Binding WebLinks}" + Children="{Binding Children}" IssueTrackerRules="{Binding IssueTrackerRules}"/> From 055835cac2d571c02047cf9f4c83f1141ebc5173 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Nov 2024 01:25:03 +0000 Subject: [PATCH 0159/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e464f74c..23a68cd7 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.70%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-100.00%25-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.58%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.56%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.86%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.60%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.86%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.86%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.86%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.86%25-yellow)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 587ba99a..bbc6ff9f 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,9 +1,10 @@ -### de_DE.axaml: 98.70% +### de_DE.axaml: 98.56%
Missing Keys +- Text.CommitDetail.Info.Children - Text.Diff.SaveAsPatch - Text.Diff.VisualLines.All - Text.Hotkeys.Repo.CreateBranchOnCommit @@ -16,17 +17,17 @@
-### es_ES.axaml: 100.00% +### es_ES.axaml: 99.86%
Missing Keys - +- Text.CommitDetail.Info.Children
-### fr_FR.axaml: 86.58% +### fr_FR.axaml: 86.60%
@@ -128,42 +129,42 @@
-### pt_BR.axaml: 100.00% +### pt_BR.axaml: 99.86%
Missing Keys - +- Text.CommitDetail.Info.Children
-### ru_RU.axaml: 100.00% +### ru_RU.axaml: 99.86%
Missing Keys - +- Text.CommitDetail.Info.Children
-### zh_CN.axaml: 100.00% +### zh_CN.axaml: 99.86%
Missing Keys - +- Text.CommitDetail.Info.Children
-### zh_TW.axaml: 100.00% +### zh_TW.axaml: 99.86%
Missing Keys - +- Text.CommitDetail.Info.Children
From bbac6c14781286b5c76e911810cd8b712b70e937 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 11 Nov 2024 09:31:04 +0800 Subject: [PATCH 0160/1283] code_review: PR #673 * add translations for zh_CN and zh_TW * hide `CHILDREN` line if it is empty Signed-off-by: leo --- src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/Views/CommitBaseInfo.axaml | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 3df54899..34c8e647 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -128,6 +128,7 @@ 基本信息 修改者 变更列表 + 子提交 提交者 查看包含此提交的分支/标签 本提交已被以下分支/标签包含 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 4dcb31aa..a35abc1c 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -128,6 +128,7 @@ 基本資訊 作者 變更列表 + 子提交 提交者 檢視包含此提交的分支或標籤 本提交包含於以下分支或標籤 diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index a886cd9e..5f80f5f9 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -123,8 +123,14 @@ - - + + From 06656f625e4e92d306c1d2c519f96bc193087950 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Nov 2024 01:31:18 +0000 Subject: [PATCH 0161/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 23a68cd7..1cc9b64e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.56%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.86%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.60%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.86%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.86%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.86%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.86%25-yellow)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.56%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.86%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.60%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.86%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.86%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index bbc6ff9f..fa6701f0 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -149,22 +149,22 @@ -### zh_CN.axaml: 99.86% +### zh_CN.axaml: 100.00%
Missing Keys -- Text.CommitDetail.Info.Children +
-### zh_TW.axaml: 99.86% +### zh_TW.axaml: 100.00%
Missing Keys -- Text.CommitDetail.Info.Children +
From 67cf23267a76a5c2727833c5e8716ec34050e03f Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 11 Nov 2024 09:37:27 +0800 Subject: [PATCH 0162/1283] feature: supports open selected revision file with default editor (#674) Signed-off-by: leo --- src/ViewModels/CommitDetail.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 349dc56d..d180f6d6 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -384,6 +384,16 @@ namespace SourceGit.ViewModels ev.Handled = true; }; + var openWith = new MenuItem(); + openWith.Header = App.Text("OpenWith"); + openWith.Icon = App.CreateMenuIcon("Icons.OpenWith"); + openWith.IsEnabled = File.Exists(fullPath); + openWith.Click += (_, ev) => + { + Native.OS.OpenWithDefaultEditor(fullPath); + ev.Handled = true; + }; + var saveAs = new MenuItem(); saveAs.Header = App.Text("SaveAs"); saveAs.Icon = App.CreateMenuIcon("Icons.Save"); @@ -413,6 +423,7 @@ namespace SourceGit.ViewModels }; menu.Items.Add(explore); + menu.Items.Add(openWith); menu.Items.Add(saveAs); menu.Items.Add(new MenuItem() { Header = "-" }); From 7df6d32ad2c55894863411bc24a8694163c260de Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 11 Nov 2024 09:55:40 +0800 Subject: [PATCH 0163/1283] version: release 8.38 Signed-off-by: leo --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a5e93156..833d11c8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.37 \ No newline at end of file +8.38 \ No newline at end of file From 82320f3494c3079be25c3e47a5f0e0207930c070 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 11 Nov 2024 10:26:34 +0800 Subject: [PATCH 0164/1283] revert: PR #673 * the `Commands.QueryCommitChildren` takes too much time when executes in a large repo Signed-off-by: leo --- src/Commands/QueryCommitChildren.cs | 34 --------------------------- src/Resources/Locales/en_US.axaml | 1 - src/Resources/Locales/fr_FR.axaml | 1 - src/Resources/Locales/zh_CN.axaml | 1 - src/Resources/Locales/zh_TW.axaml | 1 - src/ViewModels/CommitDetail.cs | 13 ----------- src/Views/CommitBaseInfo.axaml | 36 ++++------------------------- src/Views/CommitBaseInfo.axaml.cs | 9 -------- src/Views/CommitDetail.axaml | 1 - 9 files changed, 4 insertions(+), 93 deletions(-) delete mode 100644 src/Commands/QueryCommitChildren.cs diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs deleted file mode 100644 index 22a44563..00000000 --- a/src/Commands/QueryCommitChildren.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace SourceGit.Commands -{ - public class QueryCommitChildren : Command - { - public QueryCommitChildren(string repo, string sha) - { - WorkingDirectory = repo; - Context = repo; - _sha = sha; - Args = $"rev-list --children --all {sha}^.."; - } - - public string[] Result() - { - var rs = ReadToEnd(); - if (!rs.IsSuccess) - return []; - - int start = rs.StdOut.IndexOf($"\n{_sha}"); - if (start != -1) - { - int end = rs.StdOut.IndexOf('\n', start + 1); - if (end == -1) - end = rs.StdOut.Length; - start = rs.StdOut.IndexOf(' ', start); - if (start != -1 && start < end) - return rs.StdOut.Substring(start + 1, end - start - 1).Split(' ', System.StringSplitOptions.RemoveEmptyEntries); - } - return []; - } - - private string _sha; - } -} diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 302f7cba..3803bd39 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -125,7 +125,6 @@ INFORMATION AUTHOR CHANGED - CHILDREN COMMITTER Check refs that contains this commit COMMIT IS CONTAINED BY diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 88e2a661..043e8f97 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -118,7 +118,6 @@ INFORMATIONS AUTEUR CHANGÉ - ENFANTS COMMITTER Vérifier les références contenant ce commit LE COMMIT EST CONTENU PAR diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 34c8e647..3df54899 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -128,7 +128,6 @@ 基本信息 修改者 变更列表 - 子提交 提交者 查看包含此提交的分支/标签 本提交已被以下分支/标签包含 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index a35abc1c..4dcb31aa 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -128,7 +128,6 @@ 基本資訊 作者 變更列表 - 子提交 提交者 檢視包含此提交的分支或標籤 本提交包含於以下分支或標籤 diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index d180f6d6..e56ea3fd 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -78,12 +78,6 @@ namespace SourceGit.ViewModels } } - public AvaloniaList Children - { - get; - private set; - } = new AvaloniaList(); - public string SearchChangeFilter { get => _searchChangeFilter; @@ -513,7 +507,6 @@ namespace SourceGit.ViewModels VisibleChanges = null; SelectedChanges = null; ViewRevisionFileContent = null; - Children.Clear(); if (_commit == null) return; @@ -530,12 +523,6 @@ namespace SourceGit.ViewModels Dispatcher.UIThread.Invoke(() => SignInfo = signInfo); }); - Task.Run(() => - { - var children = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA).Result(); - Dispatcher.UIThread.Invoke(() => Children.AddRange(children)); - }); - if (_cancelToken != null) _cancelToken.Requested = true; diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index 5f80f5f9..76ea0227 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -51,7 +51,7 @@ - + @@ -122,37 +122,9 @@
- - - - - - - - - - - - - - - - - - + + - + SetValue(IssueTrackerRulesProperty, value); } - public static readonly StyledProperty> ChildrenProperty = - AvaloniaProperty.Register>(nameof(Children)); - - public AvaloniaList Children - { - get => GetValue(ChildrenProperty); - set => SetValue(ChildrenProperty, value); - } - public CommitBaseInfo() { InitializeComponent(); diff --git a/src/Views/CommitDetail.axaml b/src/Views/CommitDetail.axaml index 4c6fd5dc..cb99b3d9 100644 --- a/src/Views/CommitDetail.axaml +++ b/src/Views/CommitDetail.axaml @@ -24,7 +24,6 @@ SignInfo="{Binding SignInfo}" SupportsContainsIn="True" WebLinks="{Binding WebLinks}" - Children="{Binding Children}" IssueTrackerRules="{Binding IssueTrackerRules}"/> From 79c1fb63d012bd1a1eda29a6bfce32a4a2fd95c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Nov 2024 02:26:54 +0000 Subject: [PATCH 0165/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1cc9b64e..e464f74c 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.56%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.86%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.60%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.86%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.86%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.70%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-100.00%25-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.58%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index fa6701f0..587ba99a 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,10 +1,9 @@ -### de_DE.axaml: 98.56% +### de_DE.axaml: 98.70%
Missing Keys -- Text.CommitDetail.Info.Children - Text.Diff.SaveAsPatch - Text.Diff.VisualLines.All - Text.Hotkeys.Repo.CreateBranchOnCommit @@ -17,17 +16,17 @@
-### es_ES.axaml: 99.86% +### es_ES.axaml: 100.00%
Missing Keys -- Text.CommitDetail.Info.Children +
-### fr_FR.axaml: 86.60% +### fr_FR.axaml: 86.58%
@@ -129,23 +128,23 @@
-### pt_BR.axaml: 99.86% +### pt_BR.axaml: 100.00%
Missing Keys -- Text.CommitDetail.Info.Children +
-### ru_RU.axaml: 99.86% +### ru_RU.axaml: 100.00%
Missing Keys -- Text.CommitDetail.Info.Children +
From 774ec65ef693d2a313465782d80ad287c7e8afd5 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 11 Nov 2024 11:01:02 +0800 Subject: [PATCH 0166/1283] ux: layout for font size settings Signed-off-by: leo --- src/Resources/Locales/de_DE.axaml | 3 +- src/Resources/Locales/en_US.axaml | 5 ++-- src/Resources/Locales/es_ES.axaml | 2 -- src/Resources/Locales/fr_FR.axaml | 1 - src/Resources/Locales/pt_BR.axaml | 2 -- src/Resources/Locales/ru_RU.axaml | 2 -- src/Resources/Locales/zh_CN.axaml | 4 ++- src/Resources/Locales/zh_TW.axaml | 5 ++-- src/Views/Preference.axaml | 49 ++++++++++++++++++------------- 9 files changed, 39 insertions(+), 34 deletions(-) diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index d1f43695..c7cd3200 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -73,7 +73,7 @@ ABBRECHEN Auf diese Revision zurücksetzen Auf Vorgänger-Revision zurücksetzen - Generiere Commit-Nachricht + Generiere Commit-Nachricht ANZEIGE MODUS ÄNDERN Zeige als Datei- und Ordnerliste Zeige als Pfadliste @@ -429,7 +429,6 @@ Modell DARSTELLUNG Standardschriftart - Standardschriftgröße Monospace-Schriftart Verwende die Monospace-Schriftart nur im Texteditor Design diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 3803bd39..281f13a3 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -434,8 +434,9 @@ Server APPEARANCE Default Font - Default Font Size - Editor Font Size + Font Size + Default + Editor Monospace Font Only use monospace font in text editor Theme diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 6bc96dd1..365cebfb 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -438,8 +438,6 @@ Servidor APARIENCIA Fuente por defecto - Tamaño de fuente por defecto - Tamaño de fuente del editor Fuente Monospace Usar solo fuente monospace en el editor de texto Tema diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 043e8f97..5668db44 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -371,7 +371,6 @@ Préférences APPARENCE Police par défaut - Taille de police par défaut Police monospace N'utiliser que des polices monospace pour l'éditeur de texte Thème diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index 61ded334..ecd1654c 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -460,8 +460,6 @@ Servidor INTELIGÊNCIA ARTIFICIAL Fonte Padrão - Tamanho da fonte padrão - Tamanho da fonte do editor Fonte Monoespaçada Usar fonte monoespaçada apenas no editor de texto Tema diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 3ea6a922..7c558db2 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -438,8 +438,6 @@ Сервер ВИД Шрифт по-умолчанию - Размер шрифта по-умолчанию - Размер шрифта редактора Моноширный шрифт В текстовом редакторе используется только моноширный шрифт Тема diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 3df54899..5b1f1403 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -437,7 +437,9 @@ 服务地址 外观配置 缺省字体 - 默认字体大小 + 字体大小 + 默认 + 代码编辑器 代码字体大小 等宽字体 仅在文本编辑器中使用等宽字体 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 4dcb31aa..0587f089 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -437,8 +437,9 @@ 產生提交訊息提示詞 外觀設定 預設字型 - 預設字型大小 - 程式碼字型大小 + 字型大小 + 預設 + 程式碼 等寬字型 僅在文字編輯器中使用等寬字型 佈景主題 diff --git a/src/Views/Preference.axaml b/src/Views/Preference.axaml index 73be0f7c..9b84604a 100644 --- a/src/Views/Preference.axaml +++ b/src/Views/Preference.axaml @@ -121,7 +121,7 @@ - + - + + Value="{Binding DefaultFontSize, Mode=TwoWay}"> + + + + + + + + + + + + + + - - - - @@ -196,16 +205,16 @@ - - - Date: Mon, 11 Nov 2024 03:01:20 +0000 Subject: [PATCH 0167/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 30 ++++++++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e464f74c..63d84a13 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.70%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-100.00%25-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.58%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.41%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.31%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.57%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 587ba99a..45d6cbe9 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 98.70% +### de_DE.axaml: 98.41%
@@ -12,21 +12,25 @@ - Text.Hotkeys.Repo.Push - Text.IssueLinkCM.OpenInBrowser - Text.IssueLinkCM.CopyLink -- Text.Preference.Appearance.EditorFontSize +- Text.Preference.Appearance.FontSize +- Text.Preference.Appearance.FontSize.Default +- Text.Preference.Appearance.FontSize.Editor
-### es_ES.axaml: 100.00% +### es_ES.axaml: 99.57%
Missing Keys - +- Text.Preference.Appearance.FontSize +- Text.Preference.Appearance.FontSize.Default +- Text.Preference.Appearance.FontSize.Editor
-### fr_FR.axaml: 86.58% +### fr_FR.axaml: 86.31%
@@ -99,7 +103,9 @@ - Text.Preference.AI.Model - Text.Preference.AI.Name - Text.Preference.AI.Server -- Text.Preference.Appearance.EditorFontSize +- Text.Preference.Appearance.FontSize +- Text.Preference.Appearance.FontSize.Default +- Text.Preference.Appearance.FontSize.Editor - Text.Preference.General.ShowAuthorTime - Text.Preference.Integration - Text.Preference.Shell @@ -128,23 +134,27 @@
-### pt_BR.axaml: 100.00% +### pt_BR.axaml: 99.57%
Missing Keys - +- Text.Preference.Appearance.FontSize +- Text.Preference.Appearance.FontSize.Default +- Text.Preference.Appearance.FontSize.Editor
-### ru_RU.axaml: 100.00% +### ru_RU.axaml: 99.57%
Missing Keys - +- Text.Preference.Appearance.FontSize +- Text.Preference.Appearance.FontSize.Default +- Text.Preference.Appearance.FontSize.Editor
From 050b1d1188ad39b707621b17106d0699c6e4cdb6 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 11 Nov 2024 12:16:20 +0800 Subject: [PATCH 0168/1283] enhance: supports issue link in keywords (#678) Signed-off-by: leo --- src/Commands/Diff.cs | 2 +- src/Commands/ExecuteCustomAction.cs | 2 +- src/ViewModels/CommitDetail.cs | 2 +- src/Views/Histories.axaml.cs | 61 ++++++++++++++++++---------- src/Views/RepositoryToolbar.axaml.cs | 6 +-- 5 files changed, 45 insertions(+), 28 deletions(-) diff --git a/src/Commands/Diff.cs b/src/Commands/Diff.cs index 04103d68..cb9e6a18 100644 --- a/src/Commands/Diff.cs +++ b/src/Commands/Diff.cs @@ -129,7 +129,7 @@ namespace SourceGit.Commands _oldLine = int.Parse(match.Groups[1].Value); _newLine = int.Parse(match.Groups[2].Value); _result.TextDiff.Lines.Add(new Models.TextDiffLine(Models.TextDiffLineType.Indicator, line, 0, 0)); - } + } } else { diff --git a/src/Commands/ExecuteCustomAction.cs b/src/Commands/ExecuteCustomAction.cs index f5fec82c..4981b2f9 100644 --- a/src/Commands/ExecuteCustomAction.cs +++ b/src/Commands/ExecuteCustomAction.cs @@ -44,7 +44,7 @@ namespace SourceGit.Commands { outputHandler?.Invoke(e.Data); builder.AppendLine(e.Data); - } + } }; try diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index e56ea3fd..71b9ddb6 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -118,7 +118,7 @@ namespace SourceGit.ViewModels var trimmedUrl = url; if (url.EndsWith(".git")) trimmedUrl = url.Substring(0, url.Length - 4); - + if (url.StartsWith("https://github.com/", StringComparison.Ordinal)) WebLinks.Add(new Models.CommitLink() { Name = $"Github ({trimmedUrl.Substring(19)})", URLPrefix = $"{url}/commit/" }); else if (url.StartsWith("https://gitlab.", StringComparison.Ordinal)) diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index 9f436346..85092b64 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -192,35 +192,26 @@ namespace SourceGit.Views if (string.IsNullOrEmpty(subject)) return; - var offset = 0; var keywordMatch = REG_KEYWORD_FORMAT1().Match(subject); if (!keywordMatch.Success) keywordMatch = REG_KEYWORD_FORMAT2().Match(subject); - if (keywordMatch.Success) - { - var keyword = new Run(subject.Substring(0, keywordMatch.Length)); - keyword.FontWeight = FontWeight.Bold; - Inlines.Add(keyword); - - offset = keywordMatch.Length; - subject = subject.Substring(offset); - } - - var rules = IssueTrackerRules; - if (rules == null || rules.Count == 0) - { - Inlines.Add(new Run(subject)); - return; - } - + var rules = IssueTrackerRules ?? []; var matches = new List(); foreach (var rule in rules) rule.Matches(matches, subject); if (matches.Count == 0) { - Inlines.Add(new Run(subject)); + if (keywordMatch.Success) + { + Inlines.Add(new Run(subject.Substring(0, keywordMatch.Length)) { FontWeight = FontWeight.Bold }); + Inlines.Add(new Run(subject.Substring(keywordMatch.Length))); + } + else + { + Inlines.Add(new Run(subject)); + } return; } @@ -232,18 +223,44 @@ namespace SourceGit.Views foreach (var match in matches) { if (match.Start > pos) - inlines.Add(new Run(subject.Substring(pos, match.Start - pos))); + { + if (keywordMatch.Success && pos < keywordMatch.Length) + { + if (keywordMatch.Length < match.Start) + { + inlines.Add(new Run(subject.Substring(pos, keywordMatch.Length - pos)) { FontWeight = FontWeight.Bold }); + inlines.Add(new Run(subject.Substring(keywordMatch.Length, match.Start - keywordMatch.Length))); + } + else + { + inlines.Add(new Run(subject.Substring(pos, match.Start - pos)) { FontWeight = FontWeight.Bold }); + } + } + else + { + inlines.Add(new Run(subject.Substring(pos, match.Start - pos))); + } + } var link = new Run(subject.Substring(match.Start, match.Length)); link.Classes.Add("issue_link"); inlines.Add(link); pos = match.Start + match.Length; - match.Start += offset; // Because we use this index of whole subject to detect mouse event. } if (pos < subject.Length) - inlines.Add(new Run(subject.Substring(pos))); + { + if (keywordMatch.Success && pos < keywordMatch.Length) + { + inlines.Add(new Run(subject.Substring(pos, keywordMatch.Length - pos)) { FontWeight = FontWeight.Bold }); + inlines.Add(new Run(subject.Substring(keywordMatch.Length))); + } + else + { + inlines.Add(new Run(subject.Substring(pos))); + } + } Inlines.AddRange(inlines); } diff --git a/src/Views/RepositoryToolbar.axaml.cs b/src/Views/RepositoryToolbar.axaml.cs index e2c7df8c..afc8ac5a 100644 --- a/src/Views/RepositoryToolbar.axaml.cs +++ b/src/Views/RepositoryToolbar.axaml.cs @@ -52,7 +52,7 @@ namespace SourceGit.Views var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); if (!startDirectly && OperatingSystem.IsMacOS()) startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); - + repo.Fetch(startDirectly); e.Handled = true; } @@ -66,7 +66,7 @@ namespace SourceGit.Views var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); if (!startDirectly && OperatingSystem.IsMacOS()) startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); - + repo.Pull(startDirectly); e.Handled = true; } @@ -80,7 +80,7 @@ namespace SourceGit.Views var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); if (!startDirectly && OperatingSystem.IsMacOS()) startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); - + repo.Push(startDirectly); e.Handled = true; } From d3e1796492919800f93e07f89078fb629d46a4fe Mon Sep 17 00:00:00 2001 From: AquariusStar <48148723+AquariusStar@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:22:16 +0300 Subject: [PATCH 0169/1283] localization: update translation for russian (#680) --- src/Resources/Locales/ru_RU.axaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 7c558db2..ac94ee77 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -438,6 +438,9 @@ Сервер ВИД Шрифт по-умолчанию + Размер шрифта + По-умолчанию + Редактор Моноширный шрифт В текстовом редакторе используется только моноширный шрифт Тема From db66ba82a627449b0da2bcafd901fa2049e2bc36 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 Nov 2024 06:22:28 +0000 Subject: [PATCH 0170/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 63d84a13..a0fe4147 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.41%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.31%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.57%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.41%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.31%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 45d6cbe9..b85511df 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -146,15 +146,13 @@ -### ru_RU.axaml: 99.57% +### ru_RU.axaml: 100.00%
Missing Keys -- Text.Preference.Appearance.FontSize -- Text.Preference.Appearance.FontSize.Default -- Text.Preference.Appearance.FontSize.Editor +
From 503f700fc2ad6530525cd8cdaae7c6322176c167 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 11 Nov 2024 20:24:17 +0800 Subject: [PATCH 0171/1283] refactor: open selected revision file (#681) * Instead of opening the file from current worktree, save the selected revision file to the temp dir and the open it with default editor * Do NOT set the `IsEnable` property, since the revision file is always available Signed-off-by: leo --- src/ViewModels/CommitDetail.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 71b9ddb6..51056f67 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -381,10 +381,13 @@ namespace SourceGit.ViewModels var openWith = new MenuItem(); openWith.Header = App.Text("OpenWith"); openWith.Icon = App.CreateMenuIcon("Icons.OpenWith"); - openWith.IsEnabled = File.Exists(fullPath); openWith.Click += (_, ev) => { - Native.OS.OpenWithDefaultEditor(fullPath); + var fileName = Path.GetFileNameWithoutExtension(fullPath) ?? ""; + var fileExt = Path.GetExtension(fullPath) ?? ""; + var tmpFile = Path.Combine(Path.GetTempPath(), $"{fileName}~{_commit.SHA.Substring(0, 10)}{fileExt}"); + Commands.SaveRevisionFile.Run(_repo.FullPath, _commit.SHA, file.Path, tmpFile); + Native.OS.OpenWithDefaultEditor(tmpFile); ev.Handled = true; }; From 1f158eeded62b87043211fb441621261e331cc9b Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 12 Nov 2024 09:27:53 +0800 Subject: [PATCH 0172/1283] refactor: use `--tags` instead of `--force` for `git fetch` command if `Fetch without tags` is turned off (#684) Signed-off-by: leo --- src/Commands/Fetch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/Fetch.cs b/src/Commands/Fetch.cs index 08d2d1c6..834cd7fc 100644 --- a/src/Commands/Fetch.cs +++ b/src/Commands/Fetch.cs @@ -16,7 +16,7 @@ namespace SourceGit.Commands if (noTags) Args += "--no-tags "; else - Args += "--force "; + Args += "--tags "; if (prune) Args += "--prune "; From 6e4f9717336a31e5e2d7fa98da9d04a5da8593b3 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 12 Nov 2024 17:59:50 +0800 Subject: [PATCH 0173/1283] feature: show tooltip of parent commit when hover the parent SHA Signed-off-by: leo --- src/ViewModels/CommitDetail.cs | 5 +++++ src/Views/CommitBaseInfo.axaml | 23 ++++++++++++++++++++++- src/Views/CommitBaseInfo.axaml.cs | 25 +++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 51056f67..ef060f04 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -169,6 +169,11 @@ namespace SourceGit.ViewModels SearchChangeFilter = string.Empty; } + public Models.Commit GetParent(string sha) + { + return new Commands.QuerySingleCommit(_repo.FullPath, sha).Result(); + } + public List GetRevisionFilesUnderFolder(string parentFolder) { return new Commands.QueryRevisionObjects(_repo.FullPath, _commit.SHA, parentFolder).Result(); diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index 76ea0227..3eece45f 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -117,7 +117,28 @@ TextDecorations="Underline" Cursor="Hand" Margin="0,0,16,0" - PointerPressed="OnSHAPressed"/> + PointerEntered="OnSHAPointerEntered" + PointerPressed="OnSHAPressed"> + + + + + + + + + + + + + + + + + +
diff --git a/src/Views/CommitBaseInfo.axaml.cs b/src/Views/CommitBaseInfo.axaml.cs index 228fbe8e..6eb31a60 100644 --- a/src/Views/CommitBaseInfo.axaml.cs +++ b/src/Views/CommitBaseInfo.axaml.cs @@ -1,3 +1,5 @@ +using System.Threading.Tasks; + using Avalonia; using Avalonia.Collections; using Avalonia.Controls; @@ -113,6 +115,29 @@ namespace SourceGit.Views e.Handled = true; } + private async void OnSHAPointerEntered(object sender, PointerEventArgs e) + { + if (DataContext is ViewModels.CommitDetail detail && sender is Control { DataContext: string sha } ctl) + { + var tooltip = ToolTip.GetTip(ctl); + if (tooltip is Models.Commit commit && commit.SHA == sha) + { + ToolTip.SetIsOpen(ctl, true); + } + else + { + var c = await Task.Run(() => detail.GetParent(sha)); + if (c != null) + { + ToolTip.SetTip(ctl, c); + ToolTip.SetIsOpen(ctl, true); + } + } + } + + e.Handled = true; + } + private void OnSHAPressed(object sender, PointerPressedEventArgs e) { if (DataContext is ViewModels.CommitDetail detail && sender is Control { DataContext: string sha }) From b0a5a033c6a4183829b5df918dd3c439caafdab8 Mon Sep 17 00:00:00 2001 From: Nils van Rijsinge Date: Tue, 12 Nov 2024 11:09:28 +0100 Subject: [PATCH 0174/1283] Add missing de_DE keys (#687) * localization: add missing de_DE keys - SaveAsPatch: 6486095 - VisualLine: 1a8acbf - Hotkeys (Fetch, Pull, Push, CreateBranchOnCommit): d50b2c0 - IssueLinkCM: 163e8cc - Appearance.FontSize: 774ec65 * doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 14 ++------------ src/Resources/Locales/de_DE.axaml | 11 +++++++++++ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index a0fe4147..85e3ae64 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.41%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.31%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-100.00%25-brightgreen)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.31%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index b85511df..59b496f7 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,20 +1,10 @@ -### de_DE.axaml: 98.41% +### de_DE.axaml: 100.00%
Missing Keys -- Text.Diff.SaveAsPatch -- Text.Diff.VisualLines.All -- Text.Hotkeys.Repo.CreateBranchOnCommit -- Text.Hotkeys.Repo.Fetch -- Text.Hotkeys.Repo.Pull -- Text.Hotkeys.Repo.Push -- Text.IssueLinkCM.OpenInBrowser -- Text.IssueLinkCM.CopyLink -- Text.Preference.Appearance.FontSize -- Text.Preference.Appearance.FontSize.Default -- Text.Preference.Appearance.FontSize.Editor +
diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index c7cd3200..ae2e89d7 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -240,6 +240,7 @@ Nächste Änderung KEINE ÄNDERUNG ODER NUR ZEILEN-ENDE ÄNDERUNGEN Vorherige Änderung + Als Patch speichern Zeige versteckte Symbole Nebeneinander SUBMODUL @@ -248,6 +249,7 @@ Syntax Hervorhebung Zeilenumbruch Öffne in Merge Tool + Alle Zeilen anzeigen Weniger Zeilen anzeigen Mehr Zeilen anzeigen WÄHLE EINE DATEI AUS UM ÄNDERUNGEN ANZUZEIGEN @@ -364,8 +366,12 @@ Gestagte Änderungen committen Gestagte Änderungen committen und pushen Alle Änderungen stagen und committen + Neuen Branch basierend auf ausgewählten Commit erstellen Ausgewählte Änderungen verwerfen + Fetch, wird direkt ausgeführt Dashboard Modus (Standard) + Pull, wird direkt ausgeführt + Push, wird direkt ausgeführt Erzwinge Neuladen des Repositorys Ausgewählte Änderungen stagen/unstagen Commit-Suchmodus @@ -389,6 +395,8 @@ Interaktiver Rebase Ziel Branch: Auf: + In Browser öffnen + Link kopieren FEHLER INFO Branch mergen @@ -429,6 +437,9 @@ Modell DARSTELLUNG Standardschriftart + Schriftgröße + Standard + Texteditor Monospace-Schriftart Verwende die Monospace-Schriftart nur im Texteditor Design From f66e9c828a5ac1c760beb5ce2bbc28b63dfe5bdb Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 12 Nov 2024 18:14:00 +0800 Subject: [PATCH 0175/1283] ux: layout for parent commit tooltip Signed-off-by: leo --- src/Views/CommitBaseInfo.axaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index 3eece45f..d8b77a18 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -121,7 +121,7 @@ PointerPressed="OnSHAPressed"> @@ -134,7 +134,7 @@
- +
From 5e60780c9f6377ec37bf10e7510918126e941f42 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 12 Nov 2024 18:28:35 +0800 Subject: [PATCH 0176/1283] ux: new tooltip style Signed-off-by: leo --- src/Resources/Styles.axaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index 50f4d830..88aca6b0 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -168,12 +168,13 @@ - + From 146f383aae214bec7877ac9d803ebd6efcf60e1a Mon Sep 17 00:00:00 2001 From: aikawayataro Date: Tue, 12 Nov 2024 11:50:16 +0000 Subject: [PATCH 0177/1283] enhance: depend on SO in rpm package (#688) * enhance: ensure LF line endings used with package manifests * enhance: depend on shared object instead of package Back in 211c263, I changed the dependencies to depend on package instead of shared object. This worked well, but introduced some problems for distros other than Fedora (81f76f0). I did this because of problems with the arm64 package, but now I think `__isa_bits` is a reasonable workaround. * refactor: remove pointless variable checks `set -u` was introduced in 6461765 --- .editorconfig | 4 ++++ .gitattributes | 4 +++- build/resources/rpm/SPECS/build.spec | 4 ++-- build/scripts/package.linux.sh | 10 ---------- build/scripts/package.osx-app.sh | 10 ---------- build/scripts/package.windows-portable.sh | 10 ---------- 6 files changed, 9 insertions(+), 33 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3ad9d05b..83b15884 100644 --- a/.editorconfig +++ b/.editorconfig @@ -293,6 +293,10 @@ end_of_line = lf [*.{cmd,bat}] end_of_line = crlf +# Package manifests +[{*.spec,control}] +end_of_line = lf + # YAML files [*.{yml,yaml}] indent_size = 2 diff --git a/.gitattributes b/.gitattributes index 7410eb08..bd1dfea9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,10 +3,12 @@ *.png binary *.ico binary *.sh text eol=lf +*.spec text eol=lf +control text eol=lf *.bat text eol=crlf *.cmd text eol=crlf *.ps1 text eol=crlf *.json text .gitattributes export-ignore -.gitignore export-ignore \ No newline at end of file +.gitignore export-ignore diff --git a/build/resources/rpm/SPECS/build.spec b/build/resources/rpm/SPECS/build.spec index 9dda5f96..d31b6587 100644 --- a/build/resources/rpm/SPECS/build.spec +++ b/build/resources/rpm/SPECS/build.spec @@ -5,8 +5,8 @@ Summary: Open-source & Free Git Gui Client License: MIT URL: https://sourcegit-scm.github.io/ Source: https://github.com/sourcegit-scm/sourcegit/archive/refs/tags/v%_version.tar.gz -Requires: (libX11 or libX11-6) -Requires: (libSM or libSM6) +Requires: libX11.so.6()(%{__isa_bits}bit) +Requires: libSM.so.6()(%{__isa_bits}bit) %define _build_id_links none diff --git a/build/scripts/package.linux.sh b/build/scripts/package.linux.sh index 5ffd5a27..5abb058b 100755 --- a/build/scripts/package.linux.sh +++ b/build/scripts/package.linux.sh @@ -5,16 +5,6 @@ set -o set -u set pipefail -if [[ -z "$VERSION" ]]; then - echo "Provide the version as environment variable VERSION" - exit 1 -fi - -if [[ -z "$RUNTIME" ]]; then - echo "Provide the runtime as environment variable RUNTIME" - exit 1 -fi - arch= appimage_arch= target= diff --git a/build/scripts/package.osx-app.sh b/build/scripts/package.osx-app.sh index 4a50a860..2d43e24a 100755 --- a/build/scripts/package.osx-app.sh +++ b/build/scripts/package.osx-app.sh @@ -5,16 +5,6 @@ set -o set -u set pipefail -if [[ -z "$VERSION" ]]; then - echo "Provide the version as environment variable VERSION" - exit 1 -fi - -if [[ -z "$RUNTIME" ]]; then - echo "Provide the runtime as environment variable RUNTIME" - exit 1 -fi - cd build mkdir -p SourceGit.app/Contents/Resources diff --git a/build/scripts/package.windows-portable.sh b/build/scripts/package.windows-portable.sh index 9ba29216..6bd3879b 100755 --- a/build/scripts/package.windows-portable.sh +++ b/build/scripts/package.windows-portable.sh @@ -5,16 +5,6 @@ set -o set -u set pipefail -if [[ -z "$VERSION" ]]; then - echo "Provide the version as environment variable VERSION" - exit 1 -fi - -if [[ -z "$RUNTIME" ]]; then - echo "Provide the runtime as environment variable RUNTIME" - exit 1 -fi - cd build rm -rf SourceGit/*.pdb From c16a412aa388684ce1e0d2217820abc8ad7c267b Mon Sep 17 00:00:00 2001 From: aikawayataro Date: Tue, 12 Nov 2024 11:55:42 +0000 Subject: [PATCH 0178/1283] fix: SourceGit misspelled as "Source Git" (#689) --- .github/workflows/package.yml | 2 +- build/resources/_common/applications/sourcegit.desktop | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 53affe3d..e973c1ab 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -3,7 +3,7 @@ on: workflow_call: inputs: version: - description: Source Git package version + description: SourceGit package version required: true type: string jobs: diff --git a/build/resources/_common/applications/sourcegit.desktop b/build/resources/_common/applications/sourcegit.desktop index ff7ef135..bcf9c813 100644 --- a/build/resources/_common/applications/sourcegit.desktop +++ b/build/resources/_common/applications/sourcegit.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Name=Source Git +Name=SourceGit Comment=Open-source & Free Git GUI Client Exec=/opt/sourcegit/sourcegit Icon=/usr/share/icons/sourcegit.png From 8935bdd4c94b9aa1111affd29fdb1668a9e04051 Mon Sep 17 00:00:00 2001 From: Alberto de la Cruz <32411964+albertodlc@users.noreply.github.com> Date: Wed, 13 Nov 2024 02:33:35 +0100 Subject: [PATCH 0179/1283] feat: delete orphan remote tracking branches (#692) * feat: remove orphan remote-tracking branches - Allow user remove local remote-tracking branches without remotes (ie. remote was removed on merge request). - Included 'DeleteRemoteTracking' and 'HasRemote' util methods to handle this case. * fix: delete both case (local & remote-tracking) - We have local and remote-tracking but not a remote branch. We need to remove both or only the tracking based on the checkbox and on the 'hasRemote' condition --- src/Commands/Branch.cs | 22 ++++++++++++++++++++++ src/ViewModels/DeleteBranch.cs | 31 +++++++++++++++++++++++++++---- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/Commands/Branch.cs b/src/Commands/Branch.cs index 890b54ee..30e216e4 100644 --- a/src/Commands/Branch.cs +++ b/src/Commands/Branch.cs @@ -52,5 +52,27 @@ cmd.Args = $"push {remote} --delete {name}"; return cmd.Exec(); } + + public static bool DeleteRemoteTracking(string repo, string name) + { + var cmd = new Command(); + cmd.WorkingDirectory = repo; + cmd.Context = repo; + cmd.Args = $"branch -D -r {name}"; + return cmd.Exec(); + } + + public static bool HasRemote(string repo, string remote, string name) + { + var cmd = new Command(); + cmd.WorkingDirectory = repo; + cmd.Context = repo; + cmd.SSHKey = new Config(repo).Get($"remote.{remote}.sshkey"); + cmd.Args = $"ls-remote {remote} {name}"; + + var rs = cmd.ReadToEnd(); + + return rs.StdOut.Length > 0; + } } } diff --git a/src/ViewModels/DeleteBranch.cs b/src/ViewModels/DeleteBranch.cs index ba1aa839..27e60bbd 100644 --- a/src/ViewModels/DeleteBranch.cs +++ b/src/ViewModels/DeleteBranch.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; namespace SourceGit.ViewModels { @@ -56,12 +57,34 @@ namespace SourceGit.ViewModels if (_alsoDeleteTrackingRemote && TrackingRemoteBranch != null) { - SetProgressDescription("Deleting tracking remote branch..."); - Commands.Branch.DeleteRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name); + + if (Commands.Branch.HasRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name)) + { + SetProgressDescription("Deleting remote-tracking branch and remote branch..."); + + Commands.Branch.DeleteRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name); + } + else + { + SetProgressDescription("Deleting remote-tracking branch..."); + + var remoteTrackingBranch = $"{TrackingRemoteBranch.Remote}/{TrackingRemoteBranch.Name}"; + + Commands.Branch.DeleteRemoteTracking(_repo.FullPath, remoteTrackingBranch); + } + } } - else + else if(!Commands.Branch.HasRemote(_repo.FullPath, Target.Remote, Target.Name)) { + SetProgressDescription("Remote branch not found. Deleting remote-tracking branch..."); + var remoteTrackingBranch = $"{Target.Remote}/{Target.Name}"; + + Commands.Branch.DeleteRemoteTracking(_repo.FullPath, remoteTrackingBranch); + } + else + { + SetProgressDescription("Deleting remote-tracking branch..."); Commands.Branch.DeleteRemote(_repo.FullPath, Target.Remote, Target.Name); } From fd5c1f5105f4bf5ccccc3c4f928c707d01a66655 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 13 Nov 2024 10:04:28 +0800 Subject: [PATCH 0180/1283] code_review: PR #692 * remove unnecessary namespace using * move `Commands.Branch.HasRemote` to `Commands.Remote.HasBranch` * remove `Commands.Branch.DeleteRemoteTracking` and check branch in `Commands.Branch.DeleteRemote` directly Signed-off-by: leo --- src/Commands/Branch.cs | 34 +++++++++++----------------------- src/Commands/Remote.cs | 9 +++++++++ src/ViewModels/DeleteBranch.cs | 31 ++++--------------------------- 3 files changed, 24 insertions(+), 50 deletions(-) diff --git a/src/Commands/Branch.cs b/src/Commands/Branch.cs index 30e216e4..4ec8da82 100644 --- a/src/Commands/Branch.cs +++ b/src/Commands/Branch.cs @@ -48,31 +48,19 @@ var cmd = new Command(); cmd.WorkingDirectory = repo; cmd.Context = repo; - cmd.SSHKey = new Config(repo).Get($"remote.{remote}.sshkey"); - cmd.Args = $"push {remote} --delete {name}"; - return cmd.Exec(); - } - public static bool DeleteRemoteTracking(string repo, string name) - { - var cmd = new Command(); - cmd.WorkingDirectory = repo; - cmd.Context = repo; - cmd.Args = $"branch -D -r {name}"; - return cmd.Exec(); - } + bool exists = new Remote(repo).HasBranch(remote, name); + if (exists) + { + cmd.SSHKey = new Config(repo).Get($"remote.{remote}.sshkey"); + cmd.Args = $"push {remote} --delete {name}"; + } + else + { + cmd.Args = $"branch -D -r {remote}/{name}"; + } - public static bool HasRemote(string repo, string remote, string name) - { - var cmd = new Command(); - cmd.WorkingDirectory = repo; - cmd.Context = repo; - cmd.SSHKey = new Config(repo).Get($"remote.{remote}.sshkey"); - cmd.Args = $"ls-remote {remote} {name}"; - - var rs = cmd.ReadToEnd(); - - return rs.StdOut.Length > 0; + return cmd.Exec(); } } } diff --git a/src/Commands/Remote.cs b/src/Commands/Remote.cs index f2e8d09e..beaf412b 100644 --- a/src/Commands/Remote.cs +++ b/src/Commands/Remote.cs @@ -45,5 +45,14 @@ Args = "remote set-url" + (isPush ? " --push " : " ") + $"{name} {url}"; return Exec(); } + + public bool HasBranch(string remote, string branch) + { + SSHKey = new Config(WorkingDirectory).Get($"remote.{remote}.sshkey"); + Args = $"ls-remote {remote} {branch}"; + + var rs = ReadToEnd(); + return rs.IsSuccess && rs.StdOut.Trim().Length > 0; + } } } diff --git a/src/ViewModels/DeleteBranch.cs b/src/ViewModels/DeleteBranch.cs index 27e60bbd..e7136a0d 100644 --- a/src/ViewModels/DeleteBranch.cs +++ b/src/ViewModels/DeleteBranch.cs @@ -1,5 +1,4 @@ -using System; -using System.Threading.Tasks; +using System.Threading.Tasks; namespace SourceGit.ViewModels { @@ -57,34 +56,12 @@ namespace SourceGit.ViewModels if (_alsoDeleteTrackingRemote && TrackingRemoteBranch != null) { - - if (Commands.Branch.HasRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name)) - { - SetProgressDescription("Deleting remote-tracking branch and remote branch..."); - - Commands.Branch.DeleteRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name); - } - else - { - SetProgressDescription("Deleting remote-tracking branch..."); - - var remoteTrackingBranch = $"{TrackingRemoteBranch.Remote}/{TrackingRemoteBranch.Name}"; - - Commands.Branch.DeleteRemoteTracking(_repo.FullPath, remoteTrackingBranch); - } - + SetProgressDescription("Deleting remote-tracking branch..."); + Commands.Branch.DeleteRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name); } } - else if(!Commands.Branch.HasRemote(_repo.FullPath, Target.Remote, Target.Name)) + else { - SetProgressDescription("Remote branch not found. Deleting remote-tracking branch..."); - var remoteTrackingBranch = $"{Target.Remote}/{Target.Name}"; - - Commands.Branch.DeleteRemoteTracking(_repo.FullPath, remoteTrackingBranch); - } - else - { - SetProgressDescription("Deleting remote-tracking branch..."); Commands.Branch.DeleteRemote(_repo.FullPath, Target.Remote, Target.Name); } From ea4e968404577dd82ef3da31bd84e6e8a7dcabb9 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 13 Nov 2024 11:35:48 +0800 Subject: [PATCH 0181/1283] ux: repository left panel layout Signed-off-by: leo --- src/Views/Repository.axaml | 4 ++-- src/Views/TagsView.axaml | 5 +++-- src/Views/TagsView.axaml.cs | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Views/Repository.axaml b/src/Views/Repository.axaml index bb34a821..eab0d28a 100644 --- a/src/Views/Repository.axaml +++ b/src/Views/Repository.axaml @@ -256,7 +256,7 @@ @@ -70,8 +71,8 @@ ContextRequested="OnRowContextRequested" ToolTip.Tip="{Binding Message}"> Date: Thu, 14 Nov 2024 02:18:09 +0100 Subject: [PATCH 0182/1283] Add missing fr_FR keys (#696) * localization: add missing fr_FR keys --------- Co-authored-by: Theo GAUTHIER --- TRANSLATION.md | 95 -------- src/Resources/Locales/fr_FR.axaml | 349 +++++++++++++++++++----------- 2 files changed, 221 insertions(+), 223 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 59b496f7..812a117b 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -26,101 +26,6 @@
Missing Keys -- Text.About.Chart -- Text.AIAssistant -- Text.AIAssistant.Tip -- Text.BranchCM.FetchInto -- Text.ChangeCM.GenerateCommitMessage -- Text.CherryPick.AppendSourceToMessage -- Text.CherryPick.Mainline -- Text.CherryPick.Mainline.Tips -- Text.CommitCM.CherryPickMultiple -- Text.CommitCM.CustomAction -- Text.CommitCM.SquashCommitsSinceThis -- Text.CommitDetail.Info.WebLinks -- Text.Configure.CustomAction -- Text.Configure.CustomAction.Arguments -- Text.Configure.CustomAction.Arguments.Tip -- Text.Configure.CustomAction.Executable -- Text.Configure.CustomAction.Name -- Text.Configure.CustomAction.Scope -- Text.Configure.CustomAction.Scope.Commit -- Text.Configure.CustomAction.Scope.Repository -- Text.Configure.Git.DefaultRemote -- Text.Configure.Git.EnablePruneOnFetch -- Text.Configure.Git.EnableSignOff -- Text.Configure.IssueTracker.AddSampleGitLabIssue -- Text.Configure.IssueTracker.AddSampleGitLabMergeRequest -- Text.Configure.OpenAI -- Text.Configure.OpenAI.Prefered -- Text.Configure.OpenAI.Prefered.Tip -- Text.ConfigureWorkspace -- Text.ConfigureWorkspace.Color -- Text.ConfigureWorkspace.Restore -- Text.ConventionalCommit -- Text.ConventionalCommit.BreakingChanges -- Text.ConventionalCommit.ClosedIssue -- Text.ConventionalCommit.Detail -- Text.ConventionalCommit.Scope -- Text.ConventionalCommit.ShortDescription -- Text.ConventionalCommit.Type -- Text.Diff.IgnoreWhitespace -- Text.Diff.SaveAsPatch -- Text.Diff.VisualLines.All -- Text.Discard.IncludeIgnored -- Text.ExecuteCustomAction -- Text.ExecuteCustomAction.Name -- Text.FileHistory.FileChange -- Text.GitLFS.Locks.OnlyMine -- Text.Histories.Header.AuthorTime -- Text.Histories.Tips -- Text.Histories.Tips.MacOS -- Text.Histories.Tips.Prefix -- Text.Hotkeys.Repo.CommitWithAutoStage -- Text.Hotkeys.Repo.CreateBranchOnCommit -- Text.Hotkeys.Repo.DiscardSelected -- Text.Hotkeys.Repo.Fetch -- Text.Hotkeys.Repo.Pull -- Text.Hotkeys.Repo.Push -- Text.IssueLinkCM.OpenInBrowser -- Text.IssueLinkCM.CopyLink -- Text.MoveRepositoryNode -- Text.MoveRepositoryNode.Target -- Text.Preference.AI -- Text.Preference.AI.AnalyzeDiffPrompt -- Text.Preference.AI.ApiKey -- Text.Preference.AI.GenerateSubjectPrompt -- Text.Preference.AI.Model -- Text.Preference.AI.Name -- Text.Preference.AI.Server -- Text.Preference.Appearance.FontSize -- Text.Preference.Appearance.FontSize.Default -- Text.Preference.Appearance.FontSize.Editor -- Text.Preference.General.ShowAuthorTime -- Text.Preference.Integration -- Text.Preference.Shell -- Text.Preference.Shell.Type -- Text.Preference.Shell.Path -- Text.Repository.AutoFetching -- Text.Repository.CustomActions -- Text.Repository.CustomActions.Empty -- Text.Repository.EnableReflog -- Text.Repository.Search.InCurrentBranch -- Text.ScanRepositories -- Text.ScanRepositories.RootDir -- Text.Squash.Into -- Text.Stash.KeepIndex -- Text.Stash.OnlyStagedChanges -- Text.Stash.TipForSelectedFiles -- Text.Statistics.Overview -- Text.TagCM.CopyMessage -- Text.Welcome.Move -- Text.Welcome.ScanDefaultCloneDir -- Text.WorkingCopy.CommitTip -- Text.WorkingCopy.CommitWithAutoStage -- Text.WorkingCopy.ConfirmCommitWithoutFiles -- Text.Workspace -- Text.Workspace.Configure
diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 5668db44..e1562523 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -3,23 +3,26 @@ À propos + À propos de SourceGit • Compilé avec + • Le graphique est rendu par © 2024 sourcegit-scm • TextEditor de • Les polices Monospace proviennent de - À propos de SourceGit • Le code source est disponible sur Client Git Open Source et Gratuit Ajouter un Worktree + What to Checkout: + Créer une nouvelle branche + Branche existante Emplacement : Chemin vers ce worktree. Relatif supporté. Nom de branche: Optionnel. Nom du dossier de destination par défaut. Suivre la branche : Suivi de la branche distante - What to Checkout: - Créer une nouvelle branche - Branche existante + Assistant IA + Utiliser l'IA pour générer un message de commit Appliquer Erreur Soulever les erreurs et refuser d'appliquer le patch @@ -55,6 +58,7 @@ Supprimer {0} branches sélectionnées Rejeter tous les changements Fast-Forward vers ${0}$ + Fetch ${0}$ vers ${1}$... Git Flow - Terminer ${0}$ Fusionner ${0}$ dans ${1}$... Tirer ${0}$ @@ -69,6 +73,7 @@ ANNULER Réinitialiser à la révision parente Réinitialiser à cette révision + Générer un message de commit CHANGER LE MODE D'AFFICHAGE Afficher comme liste de dossiers/fichiers Afficher comme liste de chemins @@ -77,6 +82,7 @@ Checkout ce commit Commit : Avertissement: un checkout vers un commit aboutiera vers un HEAD détaché + Branche: Changements locaux : Annuler Ne rien faire @@ -85,9 +91,11 @@ Cherry-Pick de ce commit Commit : Commit tous les changements + Ligne principale : Cherry Pick Supprimer les stashes Vous essayez de supprimer tous les stashes. Êtes-vous sûr de vouloir continuer ? + Cloner repository distant Paramètres supplémentaires : Arguments additionnels au clônage. Optionnel. Nom local : @@ -103,6 +111,7 @@ Comparer avec le worktree Copier les informations Copier le SHA + Action personnalisée Rebase interactif de ${0}$ ici Rebaser ${0}$ ici Réinitialiser ${0}$ ici @@ -110,6 +119,7 @@ Reformuler Enregistrer en tant que patch... Squash dans le parent + Squash les commits enfants ici CHANGEMENTS Rechercher les changements... FICHIERS @@ -126,29 +136,56 @@ PARENTS REFS SHA - Description + Ouvrir dans le navigateur Entrez le message du commit + Description Configurer le dépôt MODÈLE DE COMMIT - Contenu de modèle: Nom de modèle: + Contenu de modèle: + ACTION PERSONNALISÉE + Arguments : + ${REPO} - Chemin du repository; ${SHA} - SHA du commit sélectionné + Fichier exécutable : + Nom : + Portée : + Commit + Repository Adresse e-mail Adresse e-mail GIT Fetch les dépôts distants automatiquement minute(s) + Dépôt par défaut + Activer --prune pour fetch + Activer --signoff pour commit SUIVI DES PROBLÈMES Ajouter une règle d'exemple Github Ajouter une règle d'exemple Jira + Ajouter une règle d'exemple pour Incidents GitLab + Ajouter une règle d'exemple pour Merge Request GitLab Nouvelle règle Issue Regex Expression: Nom de règle : - Veuillez utiliser $1, $2 pour accéder aux valeurs des groupes regex. URL résultant: + Veuillez utiliser $1, $2 pour accéder aux valeurs des groupes regex. + IA + Service préféré: + Si le 'Service préféré' est défini, SourceGit l'utilisera seulement dans ce repository. Sinon, si plus d'un service est disponible, un menu contextuel permettant de choisir l'un d'eux sera affiché. Proxy HTTP Proxy HTTP utilisé par ce dépôt Nom d'utilisateur Nom d'utilisateur pour ce dépôt + Espaces de travail + Couleur + Restaurer les onglets au démarrage + Assistant Commits Conventionnels + Changement Radical : + Incident Clos : + Détail des Modifications : + Portée : + Courte Description : + Type de Changement : Copier Copier tout le texte Copier le nom de fichier @@ -198,10 +235,12 @@ ANCIEN Copier Mode de fichier changé + Ignorer les changements d'espaces CHANGEMENT D'OBJET LFS Différence suivante PAS DE CHANGEMENT OU SEULEMENT EN FIN DE LIGNE Différence précédente + Enregistrer en tant que patch Afficher les caractères invisibles Diff côte-à-côte SOUS-MODULE @@ -210,6 +249,7 @@ Coloration syntaxique Retour à la ligne Ouvrir dans l'outil de fusion + Voir toutes les lignes Réduit le nombre de ligne visibles Augmente le nombre de ligne visibles SÉLECTIONNEZ UN FICHIER POUR VOIR LES CHANGEMENTS @@ -217,6 +257,7 @@ Rejeter les changements Tous les changements dans la copie de travail. Changements : + Inclure les fichiers ignorés {0} changements seront rejetés Vous ne pouvez pas annuler cette action !!! Signet : @@ -224,6 +265,8 @@ Cible : Éditer le groupe sélectionné Éditer le dépôt sélectionné + Lancer action personnalisée + Nom de l'action : Fast-Forward (sans checkout) Fetch Fetch toutes les branches distantes @@ -248,63 +291,69 @@ Utiliser les leurs (checkout --theirs) Historique du fichier CONTENU + MODIFICATION FILTRER Git-Flow - Development Branch: + Branche de développement : Feature: Feature Prefix: - FLOW - Finish Feature - FLOW - Finish Hotfix - FLOW - Finish Release - Target: + FLOW - Terminer Feature + FLOW - Terminer Hotfix + FLOW - Terminer Release + Cible: Hotfix: Hotfix Prefix: - Initialize Git-Flow - Keep branch - Production Branch: - Release: - Release Prefix: - Start Feature... - FLOW - Start Feature - Start Hotfix... - FLOW - Start Hotfix - Enter name - Start Release... - FLOW - Start Release - Version Tag Prefix: + Initialiser Git-Flow + Garder la branche + Branche de production : + Release : + Release Prefix : + Commencer Feature... + FLOW - Commencer Feature + Commencer Hotfix... + FLOW - Commencer Hotfix + Saisir le nom + Commencer Release... + FLOW - Commencer Release + Préfixe Tag de Version : Git LFS - Add Track Pattern... - Pattern is file name - Custom Pattern: - Add Track Pattern to Git LFS + Ajouter un pattern de suivi... + Le pattern est un nom de fichier + Pattern personnalisé : + Ajouter un pattern de suivi à Git LFS Fetch - Fetch LFS Objects - Run `git lfs fetch` to download Git LFS objects. This does not update the working copy. - Install Git LFS hooks - Show Locks - No Locked Files - Lock - LFS Locks - Unlock - Force Unlock + Fetch les objets LFS + Lancer `git lfs fetch` pour télécharger les objets Git LFS. Cela ne met pas à jour la copie de travail. + Installer les hooks Git LFS + Afficher les verrous + Pas de fichiers verrouillés + Verrouiller + Afficher seulement mes verrous + Verrous LFS + Déverouiller + Forcer le déverouillage Prune - Run `git lfs prune` to delete old LFS files from local storage + Lancer `git lfs prune` pour supprimer les anciens fichier LFS du stockage local Pull - Pull LFS Objects - Run `git lfs pull` to download all Git LFS files for current ref & checkout + Pull les objets LFS + Lancer `git lfs pull` pour télécharger tous les fichier Git LFS de la référence actuelle & checkout Push - Push LFS Objects - Push queued large files to the Git LFS endpoint - Remote: - Track files named '{0}' - Track all *{0} files + Push les objets LFS + Transférer les fichiers volumineux en file d'attente vers le point de terminaison Git LFS + Dépôt : + Suivre les fichiers appelés '{0}' + Suivre tous les fichiers *{0} Historique Basculer entre dispositions Horizontal/Vertical AUTEUR + HEURE DE L'AUTEUR GRAPHE & SUJET SHA HEURE DE COMMIT {0} COMMITS SÉLECTIONNÉS + Maintenir 'Ctrl' ou 'Shift' enfoncée pour sélectionner plusieurs commits. + Maintenir ⌘ ou ⇧ enfoncée pour sélectionner plusieurs commits. + CONSEILS: Référence des raccourcis clavier GLOBAL Annuler le popup en cours @@ -316,7 +365,13 @@ DÉPÔT Commit les changements de l'index Commit et pousser les changements de l'index + Ajouter tous les changements et commit + Créer une nouvelle branche basée sur le commit actuel + Rejeter les changements sélectionnés + Fetch, démarre directement Mode tableau de bord (Défaut) + Pull, démarre directement + Push, démarre directement Forcer le rechargement du dépôt Ajouter/Retirer les changements sélectionnés de l'index Recherche de commit @@ -331,26 +386,30 @@ Stage Retirer de l'index Rejeter - Initialize Repository - Path: - Cherry-Pick in progress. Press 'Abort' to restore original HEAD. - Merge request in progress. Press 'Abort' to restore original HEAD. - Rebase in progress. Press 'Abort' to restore original HEAD. - Revert in progress. Press 'Abort' to restore original HEAD. - Interactive Rebase - Target Branch: - On: - ERROR + Initialiser le repository + Chemin : + Cherry-Pick en cours. Appuyer sur 'Abort' pour restaurer le HEAD d'origine. + Merge request in progress. Appuyer sur 'Abort' pour restaurer le HEAD d'origine. + Rebase in progress. Appuyer sur 'Abort' pour restaurer le HEAD d'origine. + Revert in progress. Appuyer sur 'Abort' pour restaurer le HEAD d'origine. + Rebase interactif + Branche cible : + Sur : + Ouvrir dans le navigateur + Copier le lien + ERREUR NOTICE - Merge Branch - Into: - Merge Option: - Source Branch: + Merger la branche + Dans : + Option de merge: + Branche source : + Déplacer le noeud du repository + Sélectionnier le noeud parent pour : Nom : Git n'a PAS été configuré. Veuillez d'abord le faire dans le menu Préférence. Ouvrir le dossier AppData - Open With... - Optional. + Ouvrir avec... + Optionnel. Créer un nouvel onglet Bookmark Fermer l'onglet @@ -369,8 +428,17 @@ L'an dernier il y a {0} ans Préférences + IA + Analyser Diff Prompt + Clé d'API + Générer le sujet de Prompt + Modèle + Nom + Serveur APPARENCE Police par défaut + Taille de police par défaut + Taille de police de l'éditeur Police monospace N'utiliser que des polices monospace pour l'éditeur de texte Thème @@ -385,6 +453,7 @@ Vérifier les mises à jour au démarrage Language Historique de commits + Afficher l'heure de l'auteur au lieu de l'heure de validation dans le graphique Guide de longueur du sujet GIT Activer auto CRLF @@ -404,6 +473,10 @@ Saisir le chemin d'installation vers le programme GPG Clé de signature de l'utilisateur Clé de signature GPG de l'utilisateur + INTEGRATION + SHELL/TERMINAL + Shell/Terminal + Chemin Élaguer une branche distant Cible : Élaguer les Worktrees @@ -417,87 +490,92 @@ Ne rien faire Stash & Réappliquer Fetch sans les tags - Distant : + Dépôt distant : Pull (Fetch & Merge) - Use rebase instead of merge + Utiliser rebase au lieu de merge Push - Make sure submodules have been pushed + Assurez-vous que les submodules ont été poussés Force push - Local Branch: - Remote: - Push Changes To Remote - Remote Branch: - Set as tracking branch - Push all tags + Branche locale : + Dépôt distant : + Pousser les changements vers le dépôt distant + Branche distante : + Définir comme branche de suivi + Push tous les tags Push Tag To Remote - Push to all remotes - Remote: - Tag: - Quit - Rebase Current Branch - Stash & reapply local changes - On: - Rebase: - Refresh - Add Remote - Edit Remote - Name: - Remote name - Repository URL: - Remote git repository URL - Copy URL - Delete... - Edit... + Push tous les dépôts distants + Dépôt distant : + Tag : + Quitter + Rebase la branche actuelle + Stash & réappliquer changements locaux + Sur : + Rebase : + Rafraîchir + Ajouter dépôt distant + Modifier dépôt distant + Nom : + Nom du dépôt distant + URL du repository : + URL du dépôt distant + Copier l'URL + Supprimer... + Editer... Fetch - Open In Browser + Ouvrir dans le navigateur Prune - Confirm to Remove Worktree - Enable `--force` Option - Target: - Rename Branch - New Name: - Unique name for this branch - Branch: + Confirmer la suppression du Worktree + Activer l'option `--force` + Cible : + la branche + Nouveau nom : + Nom unique pour cette branche + Branche : ABORT - Cleanup(GC & Prune) - Run `git gc` command for this repository. - Clear all - Configure this repository - CONTINUE + Fetch automatique des changements depuis les dépôts... + Nettoyage(GC & Prune) + Lancer `git gc` pour ce repository. + Tout effacer + Configurer ce repository + CONTINUER Ouvrir dans l'explorateur Windows - Search Branches/Tags/Submodules - FILTERED BY: - LOCAL BRANCHES - Navigate To HEAD - Enable '--first-parent' Option - Create Branch - Open In {0} - Open In External Tools - Refresh - REMOTES - ADD REMOTE - RESOLVE - Search Commit - File + Pas d'actions personnalisées + Activer l'option '--reflog' + Ouvrir dans l'explorateur de fichiers + Rechercher Branches/Tags/Submodules + FILTRE PAR : + BRANCHES LOCALES + Naviguer vers le HEAD + Activer l'option '--first-parent' + Créer une branche + Ouvrir dans {0} + Ouvrir dans un outil externe + Rafraîchir + DEPOTS DISTANTS + AJOUTER DEPOT DISTANT + RESOUDRE + Rechercher un commit + Fichier Message SHA - Author & Committer - Show Tags as Tree - Statistics + Auteur & Committer + Branche actuelle + Voir les Tags en tant qu'arbre + Statistiques SUBMODULES - ADD SUBMODULE - UPDATE SUBMODULE + AJOUTER SUBMODULE + METTRE A JOUR SUBMODULE TAGS - NEW TAG + NOUVEAU TAG Ouvrir dans un terminal WORKTREES - ADD WORKTREE + AJOUTER WORKTREE PRUNE - Git Repository URL - Reset Current Branch To Revision + URL du repository Git + Reset branche actuelle à la révision Reset Mode: - Move To: - Current Branch: + Déplacer vers : + Branche actuelle : Ouvrir dans l'explorateur de fichier Revert le Commit Commit : @@ -509,6 +587,8 @@ Sauvegarder en tant que... Le patch a été sauvegardé ! Vérifier les mises à jour... + Dossier racine : + Rechercher des mises à jour... Une nouvelle version du logiciel est disponible : La vérification de mise à jour à échouée ! Télécharger @@ -516,13 +596,17 @@ Mise à jour du logiciel Il n'y a pas de mise à jour pour le moment. Squash Commits + Dans : SSH Private Key: Private SSH key store path START Stash Include untracked files - Message: + Garder les fichiers staged + Message : Optionnel. Nom de ce stash + Seulement les changements staged + Les modifications staged et unstaged des fichiers sélectionnés seront stockées!!! Stash les changements locaux Appliquer Effacer @@ -539,6 +623,7 @@ WEEK COMMITS: AUTHORS: + APERCU SUBMODULES Add Submodule Copy Relative Path @@ -549,6 +634,7 @@ Delete Submodule OK Copy Tag Name + Copier le message du tag Delete ${0}$... Fusionner ${0}$ dans ${1}$... Push ${0}$... @@ -567,9 +653,11 @@ Supprimer GLISSER / DEPOSER DE DOSSIER SUPPORTÉ. GROUPAGE PERSONNALISÉ SUPPORTÉ. Éditer + Déplacer vers un autre groupe Ouvrir tous les dépôts Ouvrir un dépôt Ouvrir le terminal + Réanalyser les repositories dans le dossier de clonage par défaut Chercher des dépôts... Trier Changements @@ -583,6 +671,9 @@ COMMIT COMMIT & PUSH Modèles/Historiques + Trigger click event + Stage tous les changements et commit + Un commit vide a été détecté ! Voulez-vous continuer (--allow-empty) ? CONFLITS DÉTECTÉS LES CONFLITS DE FICHIER SONT RÉSOLUS INCLURE LES FICHIERS NON-SUIVIS @@ -597,6 +688,8 @@ VOIR LES FICHIERS PRÉSUMÉS INCHANGÉS Modèle: ${0}$ Faites un clique droit sur les fichiers sélectionnés et faites vos choix pour la résoluion des conflits. + ESPACE DE TRAVAIL : + Configurer les espaces de travail... WORKTREE Copier le chemin Verrouiller From 3c5a4741bfb67e4583b1f2c36ec2e59f0f835406 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 14 Nov 2024 01:18:29 +0000 Subject: [PATCH 0183/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 85e3ae64..71643636 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-100.00%25-brightgreen)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.31%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-100.00%25-brightgreen)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-98.85%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 812a117b..93ee2875 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -20,12 +20,20 @@ -### fr_FR.axaml: 86.31% +### fr_FR.axaml: 98.85%
Missing Keys +- Text.CherryPick.AppendSourceToMessage +- Text.CherryPick.Mainline.Tips +- Text.CommitCM.CherryPickMultiple +- Text.Preference.Appearance.FontSize +- Text.Preference.Appearance.FontSize.Default +- Text.Preference.Appearance.FontSize.Editor +- Text.Repository.CustomActions +- Text.ScanRepositories
From e3ffe3ef6cb69d761e026772c42e15abb803d121 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 14 Nov 2024 14:56:21 +0800 Subject: [PATCH 0184/1283] enhance: supports Azure OpenAI REST API (#695) Signed-off-by: leo --- src/Models/OpenAI.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Models/OpenAI.cs b/src/Models/OpenAI.cs index e9c7b5ed..0a83d8dc 100644 --- a/src/Models/OpenAI.cs +++ b/src/Models/OpenAI.cs @@ -155,7 +155,12 @@ namespace SourceGit.Models var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(60) }; if (!string.IsNullOrEmpty(ApiKey)) - client.DefaultRequestHeaders.Add("Authorization", $"Bearer {ApiKey}"); + { + if (Server.Contains("openai.azure.com/", StringComparison.Ordinal)) + client.DefaultRequestHeaders.Add("api-key", ApiKey); + else + client.DefaultRequestHeaders.Add("Authorization", $"Bearer {ApiKey}"); + } var req = new StringContent(JsonSerializer.Serialize(chat, JsonCodeGen.Default.OpenAIChatRequest), Encoding.UTF8, "application/json"); try From ca5bc4b4dfec6a6e210bb28d02422f3b354abc01 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 13 Nov 2024 21:45:28 +0800 Subject: [PATCH 0185/1283] refactor: rewrite the histories filter function to supports both `include` and `exclude` modes (#690) Signed-off-by: leo --- src/Converters/FilterModeConverters.cs | 22 ++ src/Models/Filter.cs | 60 +++++ src/Models/RepositorySettings.cs | 184 ++++++++++++- src/Models/Tag.cs | 21 +- src/Models/Watcher.cs | 17 +- src/Resources/Locales/de_DE.axaml | 3 +- src/Resources/Locales/en_US.axaml | 6 +- src/Resources/Locales/es_ES.axaml | 3 +- src/Resources/Locales/fr_FR.axaml | 3 +- src/Resources/Locales/pt_BR.axaml | 3 +- src/Resources/Locales/ru_RU.axaml | 3 +- src/Resources/Locales/zh_CN.axaml | 6 +- src/Resources/Locales/zh_TW.axaml | 6 +- src/Resources/Styles.axaml | 29 --- src/ViewModels/BranchTreeNode.cs | 62 ++--- src/ViewModels/Checkout.cs | 2 +- src/ViewModels/CreateBranch.cs | 2 +- src/ViewModels/RenameBranch.cs | 16 +- src/ViewModels/Repository.cs | 156 ++++------- src/ViewModels/TagCollection.cs | 10 - src/Views/BranchTree.axaml | 17 +- src/Views/BranchTree.axaml.cs | 39 --- src/Views/FilterModeSwitchButton.axaml | 32 +++ src/Views/FilterModeSwitchButton.axaml.cs | 299 ++++++++++++++++++++++ src/Views/Repository.axaml | 20 +- src/Views/TagsView.axaml | 38 ++- src/Views/TagsView.axaml.cs | 17 -- 27 files changed, 767 insertions(+), 309 deletions(-) create mode 100644 src/Converters/FilterModeConverters.cs create mode 100644 src/Models/Filter.cs create mode 100644 src/Views/FilterModeSwitchButton.axaml create mode 100644 src/Views/FilterModeSwitchButton.axaml.cs diff --git a/src/Converters/FilterModeConverters.cs b/src/Converters/FilterModeConverters.cs new file mode 100644 index 00000000..402a287d --- /dev/null +++ b/src/Converters/FilterModeConverters.cs @@ -0,0 +1,22 @@ +using Avalonia.Data.Converters; +using Avalonia.Media; + +namespace SourceGit.Converters +{ + public static class FilterModeConverters + { + public static readonly FuncValueConverter ToBorderBrush = + new FuncValueConverter(v => + { + switch (v) + { + case Models.FilterMode.Included: + return Brushes.Green; + case Models.FilterMode.Excluded: + return Brushes.Red; + default: + return Brushes.Transparent; + } + }); + } +} diff --git a/src/Models/Filter.cs b/src/Models/Filter.cs new file mode 100644 index 00000000..8ffd27c7 --- /dev/null +++ b/src/Models/Filter.cs @@ -0,0 +1,60 @@ +using CommunityToolkit.Mvvm.ComponentModel; + +namespace SourceGit.Models +{ + public enum FilterType + { + LocalBranch = 0, + LocalBranchFolder, + RemoteBranch, + RemoteBranchFolder, + Tag, + } + + public enum FilterMode + { + None = 0, + Included, + Excluded, + } + + public class Filter : ObservableObject + { + public string Pattern + { + get => _pattern; + set => SetProperty(ref _pattern, value); + } + + public FilterType Type + { + get; + set; + } = FilterType.LocalBranch; + + public FilterMode Mode + { + get => _mode; + set => SetProperty(ref _mode, value); + } + + public bool IsBranch + { + get => Type != FilterType.Tag; + } + + public Filter() + { + } + + public Filter(string pattern, FilterType type, FilterMode mode) + { + _pattern = pattern; + _mode = mode; + Type = type; + } + + private string _pattern = string.Empty; + private FilterMode _mode = FilterMode.None; + } +} diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs index 77c58ee7..f5f02e46 100644 --- a/src/Models/RepositorySettings.cs +++ b/src/Models/RepositorySettings.cs @@ -1,4 +1,9 @@ -using Avalonia.Collections; +using System; +using System.Collections.Generic; +using System.Text; + +using Avalonia.Collections; +using Avalonia.Threading; namespace SourceGit.Models { @@ -76,11 +81,11 @@ namespace SourceGit.Models set; } = true; - public AvaloniaList Filters + public AvaloniaList HistoriesFilters { get; set; - } = new AvaloniaList(); + } = new AvaloniaList(); public AvaloniaList CommitTemplates { @@ -148,6 +153,179 @@ namespace SourceGit.Models set; } = "---"; + public FilterMode GetHistoriesFilterMode(string pattern, FilterType type) + { + foreach (var filter in HistoriesFilters) + { + if (filter.Type != type) + continue; + + if (filter.Pattern.Equals(pattern, StringComparison.Ordinal)) + return filter.Mode; + } + + return FilterMode.None; + } + + public bool UpdateHistoriesFilter(string pattern, FilterType type, FilterMode mode) + { + for (int i = 0; i < HistoriesFilters.Count; i++) + { + var filter = HistoriesFilters[i]; + if (filter.Type != type) + continue; + + if (filter.Pattern.Equals(pattern, StringComparison.Ordinal)) + { + if (mode == FilterMode.None) + { + HistoriesFilters.RemoveAt(i); + return true; + } + + if (mode != filter.Mode) + { + filter.Mode = mode; + return true; + } + } + } + + if (mode != FilterMode.None) + { + HistoriesFilters.Add(new Filter(pattern, type, mode)); + return true; + } + + return false; + } + + public string BuildHistoriesFilter() + { + var builder = new StringBuilder(); + + var excludedBranches = new List(); + var excludedRemotes = new List(); + var excludedTags = new List(); + var includedBranches = new List(); + var includedRemotes = new List(); + var includedTags = new List(); + foreach (var filter in HistoriesFilters) + { + if (filter.Type == FilterType.LocalBranch) + { + var name = filter.Pattern.Substring(11); + var b = $"{name.Substring(0, name.Length - 1)}[{name[^1]}]"; + + if (filter.Mode == FilterMode.Included) + includedBranches.Add(b); + else if (filter.Mode == FilterMode.Excluded) + excludedBranches.Add(b); + } + else if (filter.Type == FilterType.LocalBranchFolder) + { + if (filter.Mode == FilterMode.Included) + includedBranches.Add($"{filter.Pattern.Substring(11)}/*"); + else if (filter.Mode == FilterMode.Excluded) + excludedBranches.Add($"{filter.Pattern.Substring(11)}/*"); + } + else if (filter.Type == FilterType.RemoteBranch) + { + var name = filter.Pattern.Substring(13); + var r = $"{name.Substring(0, name.Length - 1)}[{name[^1]}]"; + + if (filter.Mode == FilterMode.Included) + includedRemotes.Add(r); + else if (filter.Mode == FilterMode.Excluded) + excludedRemotes.Add(r); + } + else if (filter.Type == FilterType.RemoteBranchFolder) + { + if (filter.Mode == FilterMode.Included) + includedRemotes.Add($"{filter.Pattern.Substring(13)}/*"); + else if (filter.Mode == FilterMode.Excluded) + excludedRemotes.Add($"{filter.Pattern.Substring(13)}/*"); + } + else if (filter.Type == FilterType.Tag) + { + var name = filter.Pattern; + var t = $"{name.Substring(0, name.Length - 1)}[{name[^1]}]"; + + if (filter.Mode == FilterMode.Included) + includedTags.Add(t); + else if (filter.Mode == FilterMode.Excluded) + excludedTags.Add(t); + } + } + + foreach (var b in excludedBranches) + { + builder.Append("--exclude="); + builder.Append(b); + builder.Append(' '); + } + + if (includedBranches.Count > 0) + { + foreach (var b in includedBranches) + { + builder.Append("--branches="); + builder.Append(b); + builder.Append(' '); + } + } + else if (excludedBranches.Count > 0 || (includedRemotes.Count == 0 && includedTags.Count == 0)) + { + builder.Append("--exclude=HEA[D] "); + builder.Append("--branches "); + } + + foreach (var r in excludedRemotes) + { + builder.Append("--exclude="); + builder.Append(r); + builder.Append(' '); + } + + if (includedRemotes.Count > 0) + { + foreach (var r in includedRemotes) + { + builder.Append("--remotes="); + builder.Append(r); + builder.Append(' '); + } + } + else if (excludedRemotes.Count > 0 || (includedBranches.Count == 0 && includedTags.Count == 0)) + { + builder.Append("--exclude=origin/HEA[D] "); + builder.Append("--remotes "); + } + + foreach (var t in excludedTags) + { + builder.Append("--exclude="); + builder.Append(t); + builder.Append(' '); + } + + if (includedTags.Count > 0) + { + foreach (var t in includedTags) + { + builder.Append("--tags="); + builder.Append(t); + builder.Append(' '); + } + } + else if (excludedTags.Count > 0 || (includedBranches.Count == 0 && includedRemotes.Count == 0)) + { + builder.Append("--tags "); + } + + return builder.ToString(); + } + public void PushCommitMessage(string message) { var existIdx = CommitMessages.IndexOf(message); diff --git a/src/Models/Tag.cs b/src/Models/Tag.cs index 2ec9e093..2e8f2c8e 100644 --- a/src/Models/Tag.cs +++ b/src/Models/Tag.cs @@ -1,10 +1,19 @@ -namespace SourceGit.Models +using CommunityToolkit.Mvvm.ComponentModel; + +namespace SourceGit.Models { - public class Tag + public class Tag : ObservableObject { - public string Name { get; set; } - public string SHA { get; set; } - public string Message { get; set; } - public bool IsFiltered { get; set; } + public string Name { get; set; } = string.Empty; + public string SHA { get; set; } = string.Empty; + public string Message { get; set; } = string.Empty; + + public FilterMode FilterMode + { + get => _filterMode; + set => SetProperty(ref _filterMode, value); + } + + private FilterMode _filterMode = FilterMode.None; } } diff --git a/src/Models/Watcher.cs b/src/Models/Watcher.cs index 6665250c..710b307d 100644 --- a/src/Models/Watcher.cs +++ b/src/Models/Watcher.cs @@ -113,22 +113,11 @@ namespace SourceGit.Models if (_updateTags > 0) { _updateTags = 0; - Task.Run(() => - { - _repo.RefreshTags(); - _repo.RefreshBranches(); - _repo.RefreshCommits(); - }); - } - else - { - Task.Run(() => - { - _repo.RefreshBranches(); - _repo.RefreshCommits(); - }); + Task.Run(_repo.RefreshTags); } + Task.Run(_repo.RefreshBranches); + Task.Run(_repo.RefreshCommits); Task.Run(_repo.RefreshWorkingCopyChanges); Task.Run(_repo.RefreshWorktrees); } diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index ae2e89d7..4e94bb67 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -292,7 +292,6 @@ Datei Historie INHALT ÄNDERUNGEN - FILTER Git-Flow Development-Branch: Feature: @@ -544,7 +543,7 @@ Aktiviere '--reflog' Option Öffne im Datei-Browser Suche Branches/Tags/Submodule - GEFILTERT: + GEFILTERT: LOKALE BRANCHES Zum HEAD wechseln Aktiviere '--first-parent' Option diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 281f13a3..da860d05 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -289,7 +289,6 @@ File History CONTENT CHANGE - FILTER Git-Flow Development Branch: Feature: @@ -541,7 +540,10 @@ Enable '--reflog' Option Open in File Browser Search Branches/Tags/Submodules - FILTERED BY: + Unset (Default) + Hide in commit graph + Filter in commit graph + FILTERED BY: LOCAL BRANCHES Navigate to HEAD Enable '--first-parent' Option diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 365cebfb..5e3ed9a9 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -294,7 +294,6 @@ Historial de Archivos CONTENIDO CAMBIO - FILTRO Git-Flow Rama de Desarrollo: Feature: @@ -542,7 +541,7 @@ Habilitar Opción '--reflog' Abrir en el Explorador Buscar Ramas/Etiquetas/Submódulos - FILTRAR POR: + FILTRAR POR: RAMAS LOCALES Navegar a HEAD Habilitar Opción '--first-parent' diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index e1562523..c07a6ee5 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -292,7 +292,6 @@ Historique du fichier CONTENU MODIFICATION - FILTRER Git-Flow Branche de développement : Feature: @@ -543,7 +542,7 @@ Activer l'option '--reflog' Ouvrir dans l'explorateur de fichiers Rechercher Branches/Tags/Submodules - FILTRE PAR : + FILTRE PAR : BRANCHES LOCALES Naviguer vers le HEAD Activer l'option '--first-parent' diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index ecd1654c..987b3398 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -317,7 +317,6 @@ Histórico de Arquivos CONTEUDO MUDANÇA - FILTRO Branch de Desenvolvimento: Feature: Prefixo da Feature: @@ -566,7 +565,7 @@ Habilitar opção '--reflog' Abrir no Navegador de Arquivos Pesquisar Branches/Tags/Submódulos - FILTRADO POR: + FILTRADO POR: Habilitar opção '--first-parent' BRANCHES LOCAIS Navegar para HEAD diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index ac94ee77..e86dbbe7 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -293,7 +293,6 @@ История файлов СОДЕРЖИМОЕ ИЗМЕНИТЬ - ФИЛЬТР Git-поток Ветка разработчика: Свойство: @@ -545,7 +544,7 @@ Разрешить опцию --reflog Открыть в файловом менеджере Поиск веток, меток и подмодулей - ОТФИЛЬТРОВАНО: + ОТФИЛЬТРОВАНО: ЛОКАЛЬНЫЕ ВЕТКИ Навигация по заголовку Включить опцию --first-parent diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 5b1f1403..4fd32a37 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -292,7 +292,6 @@ 文件历史 文件内容 文件变更 - 过滤 GIT工作流 开发分支 : 特性分支 : @@ -545,7 +544,10 @@ 启用 --reflog 选项 在文件浏览器中打开 快速查找分支/标签/子模块 - 过滤规则 : + 未指定(默认行为) + 在提交列表中隐藏 + 使用其对提交列表过滤 + 过滤规则 : 本地分支 定位HEAD 启用 --first-parent 过滤选项 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 0587f089..b5d9aea8 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -292,7 +292,6 @@ 檔案歷史 檔案内容 檔案變更 - 篩選 Git 工作流 開發分支: 功能分支: @@ -544,7 +543,10 @@ 啟用 [--reflog] 選項 在檔案瀏覽器中開啟 快速搜尋分支/標籤/子模組 - 篩選規則: + 未指定 (預設) + 在提交清單中隱藏 + 使用其來篩選提交清單 + 篩選規則: 本機分支 回到 HEAD 啟用 [--first-parent] 選項 diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index 88aca6b0..8fdfaa3c 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -1038,35 +1038,6 @@ - - - - + + @@ -67,15 +71,10 @@ Foreground="{DynamicResource Brush.BadgeFG}" Background="{DynamicResource Brush.Badge}"/> - - + +
diff --git a/src/Views/BranchTree.axaml.cs b/src/Views/BranchTree.axaml.cs index e96b2594..92c2b043 100644 --- a/src/Views/BranchTree.axaml.cs +++ b/src/Views/BranchTree.axaml.cs @@ -428,28 +428,6 @@ namespace SourceGit.Views } } - private void OnToggleFilterClicked(object sender, RoutedEventArgs e) - { - if (DataContext is ViewModels.Repository repo && - sender is ToggleButton toggle && - toggle.DataContext is ViewModels.BranchTreeNode { Backend: Models.Branch branch } node) - { - bool filtered = toggle.IsChecked == true; - List filters = [branch.FullName]; - if (branch.IsLocal && !string.IsNullOrEmpty(branch.Upstream)) - { - filters.Add(branch.Upstream); - - node.IsFiltered = filtered; - UpdateUpstreamFilterState(repo.RemoteBranchTrees, branch.Upstream, filtered); - } - - repo.UpdateFilters(filters, filtered); - } - - e.Handled = true; - } - private void MakeRows(List rows, List nodes, int depth) { foreach (var node in nodes) @@ -477,23 +455,6 @@ namespace SourceGit.Views CollectBranchesInNode(outs, sub); } - private bool UpdateUpstreamFilterState(List collection, string upstream, bool isFiltered) - { - foreach (var node in collection) - { - if (node.Backend is Models.Branch b && b.FullName == upstream) - { - node.IsFiltered = isFiltered; - return true; - } - - if (node.Backend is Models.Remote r && upstream.StartsWith($"refs/remotes/{r.Name}/", StringComparison.Ordinal)) - return UpdateUpstreamFilterState(node.Children, upstream, isFiltered); - } - - return false; - } - private bool _disableSelectionChangingEvent = false; } } diff --git a/src/Views/FilterModeSwitchButton.axaml b/src/Views/FilterModeSwitchButton.axaml new file mode 100644 index 00000000..0fbbbf8e --- /dev/null +++ b/src/Views/FilterModeSwitchButton.axaml @@ -0,0 +1,32 @@ + + + diff --git a/src/Views/FilterModeSwitchButton.axaml.cs b/src/Views/FilterModeSwitchButton.axaml.cs new file mode 100644 index 00000000..e8e4ad6a --- /dev/null +++ b/src/Views/FilterModeSwitchButton.axaml.cs @@ -0,0 +1,299 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +using Avalonia; +using Avalonia.Controls; +using Avalonia.Interactivity; +using Avalonia.VisualTree; + +namespace SourceGit.Views +{ + public partial class FilterModeSwitchButton : UserControl + { + public static readonly StyledProperty ModeProperty = + AvaloniaProperty.Register(nameof(Mode)); + + public Models.FilterMode Mode + { + get => GetValue(ModeProperty); + set => SetValue(ModeProperty, value); + } + + public static readonly StyledProperty IsNoneVisibleProperty = + AvaloniaProperty.Register(nameof(IsNoneVisible)); + + public bool IsNoneVisible + { + get => GetValue(IsNoneVisibleProperty); + set => SetValue(IsNoneVisibleProperty, value); + } + + public static readonly StyledProperty IsContextMenuOpeningProperty = + AvaloniaProperty.Register(nameof(IsContextMenuOpening)); + + public bool IsContextMenuOpening + { + get => GetValue(IsContextMenuOpeningProperty); + set => SetValue(IsContextMenuOpeningProperty, value); + } + + public FilterModeSwitchButton() + { + IsVisible = false; + InitializeComponent(); + } + + protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) + { + base.OnPropertyChanged(change); + + if (change.Property == ModeProperty || + change.Property == IsNoneVisibleProperty || + change.Property == IsContextMenuOpeningProperty) + { + var visible = (Mode != Models.FilterMode.None || IsNoneVisible || IsContextMenuOpening); + SetCurrentValue(IsVisibleProperty, visible); + } + } + + private void OnChangeFilterModeButtonClicked(object sender, RoutedEventArgs e) + { + var repoView = this.FindAncestorOfType(); + if (repoView == null) + return; + + var repo = repoView.DataContext as ViewModels.Repository; + if (repo == null) + return; + + var button = sender as Button; + if (button == null) + return; + + if (DataContext is Models.Tag tag) + { + var mode = tag.FilterMode; + + var none = new MenuItem(); + none.Icon = App.CreateMenuIcon("Icons.Eye"); + none.Header = App.Text("Repository.FilterCommits.Default"); + none.IsEnabled = mode != Models.FilterMode.None; + none.Click += (_, ev) => + { + UpdateTagFilterMode(repo, tag, Models.FilterMode.None); + ev.Handled = true; + }; + + var include = new MenuItem(); + include.Icon = App.CreateMenuIcon("Icons.Filter"); + include.Header = App.Text("Repository.FilterCommits.Include"); + include.IsEnabled = mode != Models.FilterMode.Included; + include.Click += (_, ev) => + { + UpdateTagFilterMode(repo, tag, Models.FilterMode.Included); + ev.Handled = true; + }; + + var exclude = new MenuItem(); + exclude.Icon = App.CreateMenuIcon("Icons.EyeClose"); + exclude.Header = App.Text("Repository.FilterCommits.Exclude"); + exclude.IsEnabled = mode != Models.FilterMode.Excluded; + exclude.Click += (_, ev) => + { + UpdateTagFilterMode(repo, tag, Models.FilterMode.Excluded); + ev.Handled = true; + }; + + var menu = new ContextMenu(); + menu.Items.Add(none); + menu.Items.Add(include); + menu.Items.Add(exclude); + + if (mode == Models.FilterMode.None) + { + IsContextMenuOpening = true; + menu.Closed += (_, _) => IsContextMenuOpening = false; + } + + menu.Open(button); + } + else if (DataContext is ViewModels.BranchTreeNode node) + { + var mode = node.FilterMode; + + var none = new MenuItem(); + none.Icon = App.CreateMenuIcon("Icons.Eye"); + none.Header = App.Text("Repository.FilterCommits.Default"); + none.IsEnabled = mode != Models.FilterMode.None; + none.Click += (_, ev) => + { + UpdateBranchFilterMode(repo, node, Models.FilterMode.None); + ev.Handled = true; + }; + + var include = new MenuItem(); + include.Icon = App.CreateMenuIcon("Icons.Filter"); + include.Header = App.Text("Repository.FilterCommits.Include"); + include.IsEnabled = mode != Models.FilterMode.Included; + include.Click += (_, ev) => + { + UpdateBranchFilterMode(repo, node, Models.FilterMode.Included); + ev.Handled = true; + }; + + var exclude = new MenuItem(); + exclude.Icon = App.CreateMenuIcon("Icons.EyeClose"); + exclude.Header = App.Text("Repository.FilterCommits.Exclude"); + exclude.IsEnabled = mode != Models.FilterMode.Excluded; + exclude.Click += (_, ev) => + { + UpdateBranchFilterMode(repo, node, Models.FilterMode.Excluded); + ev.Handled = true; + }; + + var menu = new ContextMenu(); + menu.Items.Add(none); + menu.Items.Add(include); + menu.Items.Add(exclude); + + if (mode == Models.FilterMode.None) + { + IsContextMenuOpening = true; + menu.Closed += (_, _) => IsContextMenuOpening = false; + } + + menu.Open(button); + } + + e.Handled = true; + } + + private void UpdateTagFilterMode(ViewModels.Repository repo, Models.Tag tag, Models.FilterMode mode) + { + var changed = repo.Settings.UpdateHistoriesFilter(tag.Name, Models.FilterType.Tag, mode); + if (changed) + { + tag.FilterMode = mode; + Task.Run(repo.RefreshCommits); + } + } + + private void UpdateBranchFilterMode(ViewModels.Repository repo, ViewModels.BranchTreeNode node, Models.FilterMode mode) + { + var isLocal = node.Path.StartsWith("refs/heads/", StringComparison.Ordinal); + var type = isLocal ? Models.FilterType.LocalBranch : Models.FilterType.RemoteBranch; + var tree = isLocal ? repo.LocalBranchTrees : repo.RemoteBranchTrees; + + if (node.Backend is Models.Branch branch) + { + var changed = repo.Settings.UpdateHistoriesFilter(node.Path, type, mode); + if (!changed) + return; + + node.FilterMode = mode; + + // Try to update its upstream. + if (isLocal && !string.IsNullOrEmpty(branch.Upstream) && mode != Models.FilterMode.Excluded) + { + var upstream = branch.Upstream; + var upstreamNode = FindBranchNode(repo.RemoteBranchTrees, upstream); + if (upstreamNode != null) + { + var canUpdateUpstream = true; + foreach (var filter in repo.Settings.HistoriesFilters) + { + bool matched = false; + if (filter.Type == Models.FilterType.RemoteBranch) + matched = filter.Pattern.Equals(upstream, StringComparison.Ordinal); + else if (filter.Type == Models.FilterType.RemoteBranchFolder) + matched = upstream.StartsWith(filter.Pattern, StringComparison.Ordinal); + + if (matched && filter.Mode == Models.FilterMode.Excluded) + { + canUpdateUpstream = false; + break; + } + } + + if (canUpdateUpstream) + { + changed = repo.Settings.UpdateHistoriesFilter(upstream, Models.FilterType.RemoteBranch, mode); + if (changed) + upstreamNode.FilterMode = mode; + } + } + } + } + else + { + var changed = repo.Settings.UpdateHistoriesFilter(node.Path, isLocal ? Models.FilterType.LocalBranchFolder : Models.FilterType.RemoteBranchFolder, mode); + if (!changed) + return; + + node.FilterMode = mode; + ResetChildrenBranchNodeFilterMode(repo, node, isLocal); + } + + var parentType = isLocal ? Models.FilterType.LocalBranchFolder : Models.FilterType.RemoteBranchFolder; + var cur = node; + do + { + var lastSepIdx = cur.Path.LastIndexOf('/'); + if (lastSepIdx <= 0) + break; + + var parentPath = cur.Path.Substring(0, lastSepIdx); + var parent = FindBranchNode(tree, parentPath); + if (parent == null) + break; + + repo.Settings.UpdateHistoriesFilter(parent.Path, parentType, Models.FilterMode.None); + parent.FilterMode = Models.FilterMode.None; + cur = parent; + } while (true); + + Task.Run(repo.RefreshCommits); + } + + private void ResetChildrenBranchNodeFilterMode(ViewModels.Repository repo, ViewModels.BranchTreeNode node, bool isLocal) + { + foreach (var child in node.Children) + { + child.FilterMode = Models.FilterMode.None; + + if (child.IsBranch) + { + var type = isLocal ? Models.FilterType.LocalBranch : Models.FilterType.RemoteBranch; + repo.Settings.UpdateHistoriesFilter(child.Path, type, Models.FilterMode.None); + } + else + { + var type = isLocal ? Models.FilterType.LocalBranchFolder : Models.FilterType.RemoteBranchFolder; + repo.Settings.UpdateHistoriesFilter(child.Path, type, Models.FilterMode.None); + ResetChildrenBranchNodeFilterMode(repo, child, isLocal); + } + } + } + + private ViewModels.BranchTreeNode FindBranchNode(List nodes, string path) + { + foreach (var node in nodes) + { + if (node.Path.Equals(path, StringComparison.Ordinal)) + return node; + + if (path.StartsWith(node.Path, StringComparison.Ordinal)) + { + var founded = FindBranchNode(node.Children, path); + if (founded != null) + return founded; + } + } + + return null; + } + } +} + + diff --git a/src/Views/Repository.axaml b/src/Views/Repository.axaml index eab0d28a..4ec328f5 100644 --- a/src/Views/Repository.axaml +++ b/src/Views/Repository.axaml @@ -577,14 +577,14 @@ - + - + - + @@ -592,9 +592,17 @@ - - - + + + + + + + diff --git a/src/Views/TagsView.axaml b/src/Views/TagsView.axaml index b50ef481..5dedb661 100644 --- a/src/Views/TagsView.axaml +++ b/src/Views/TagsView.axaml @@ -12,6 +12,10 @@ + + @@ -43,15 +47,14 @@ Classes="primary" Text="{Binding FullPath, Converter={x:Static c:PathConverters.PureFileName}}" Margin="8,0,0,0"/> - - + + + + + + + + @@ -60,33 +63,28 @@ - + Margin="8,0,0,0" + TextTrimming="CharacterEllipsis"/> - + diff --git a/src/Views/TagsView.axaml.cs b/src/Views/TagsView.axaml.cs index bde5ae32..c83cfd28 100644 --- a/src/Views/TagsView.axaml.cs +++ b/src/Views/TagsView.axaml.cs @@ -247,23 +247,6 @@ namespace SourceGit.Views } } - private void OnToggleFilterClicked(object sender, RoutedEventArgs e) - { - if (sender is ToggleButton toggle && DataContext is ViewModels.Repository repo) - { - var target = null as Models.Tag; - if (toggle.DataContext is ViewModels.TagTreeNode node) - target = node.Tag; - else if (toggle.DataContext is Models.Tag tag) - target = tag; - - if (target != null) - repo.UpdateFilters([target.Name], toggle.IsChecked == true); - } - - e.Handled = true; - } - private void MakeTreeRows(List rows, List nodes) { foreach (var node in nodes) From bb90c86649c1a6c0e43ac40f9915799c453b1571 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 14 Nov 2024 07:21:47 +0000 Subject: [PATCH 0186/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 27 ++++++++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 71643636..6a989d89 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-100.00%25-brightgreen)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-98.85%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.57%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.14%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-98.42%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.14%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.57%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 93ee2875..5d7385cf 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,14 +1,16 @@ -### de_DE.axaml: 100.00% +### de_DE.axaml: 99.57%
Missing Keys - +- Text.Repository.FilterCommits.Default +- Text.Repository.FilterCommits.Exclude +- Text.Repository.FilterCommits.Include
-### es_ES.axaml: 99.57% +### es_ES.axaml: 99.14%
@@ -17,10 +19,13 @@ - Text.Preference.Appearance.FontSize - Text.Preference.Appearance.FontSize.Default - Text.Preference.Appearance.FontSize.Editor +- Text.Repository.FilterCommits.Default +- Text.Repository.FilterCommits.Exclude +- Text.Repository.FilterCommits.Include
-### fr_FR.axaml: 98.85% +### fr_FR.axaml: 98.42%
@@ -33,11 +38,14 @@ - Text.Preference.Appearance.FontSize.Default - Text.Preference.Appearance.FontSize.Editor - Text.Repository.CustomActions +- Text.Repository.FilterCommits.Default +- Text.Repository.FilterCommits.Exclude +- Text.Repository.FilterCommits.Include - Text.ScanRepositories
-### pt_BR.axaml: 99.57% +### pt_BR.axaml: 99.14%
@@ -46,16 +54,21 @@ - Text.Preference.Appearance.FontSize - Text.Preference.Appearance.FontSize.Default - Text.Preference.Appearance.FontSize.Editor +- Text.Repository.FilterCommits.Default +- Text.Repository.FilterCommits.Exclude +- Text.Repository.FilterCommits.Include
-### ru_RU.axaml: 100.00% +### ru_RU.axaml: 99.57%
Missing Keys - +- Text.Repository.FilterCommits.Default +- Text.Repository.FilterCommits.Exclude +- Text.Repository.FilterCommits.Include
From a53787c754d2236cbd9203afeaf224e96dbae00c Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 14 Nov 2024 19:19:44 +0800 Subject: [PATCH 0187/1283] fix: `git rebase --continue` fail (#693) * fix the exit code when start `SourceGit` as core editor (rebasing). * redesign the layout of working copy page for in-progress states. Signed-off-by: leo --- src/App.axaml.cs | 8 +-- src/Resources/Styles.axaml | 6 +++ src/ViewModels/Repository.cs | 65 ++---------------------- src/ViewModels/WorkingCopy.cs | 94 +++++++++++++++++++++++++++++++++-- src/Views/Repository.axaml | 10 +--- src/Views/WorkingCopy.axaml | 12 +++++ 6 files changed, 119 insertions(+), 76 deletions(-) diff --git a/src/App.axaml.cs b/src/App.axaml.cs index dfec763b..0615724a 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -478,17 +478,20 @@ namespace SourceGit if (args.Length <= 1 || !args[0].Equals("--rebase-message-editor", StringComparison.Ordinal)) return false; + exitCode = 0; + var file = args[1]; var filename = Path.GetFileName(file); if (!filename.Equals("COMMIT_EDITMSG", StringComparison.OrdinalIgnoreCase)) return true; - var jobsFile = Path.Combine(Path.GetDirectoryName(file)!, "sourcegit_rebase_jobs.json"); + var gitDir = Path.GetDirectoryName(file)!; + var jobsFile = Path.Combine(gitDir, "sourcegit_rebase_jobs.json"); if (!File.Exists(jobsFile)) return true; var collection = JsonSerializer.Deserialize(File.ReadAllText(jobsFile), JsonCodeGen.Default.InteractiveRebaseJobCollection); - var doneFile = Path.Combine(Path.GetDirectoryName(file)!, "rebase-merge", "done"); + var doneFile = Path.Combine(gitDir, "rebase-merge", "done"); if (!File.Exists(doneFile)) return true; @@ -499,7 +502,6 @@ namespace SourceGit var job = collection.Jobs[done.Length - 1]; File.WriteAllText(file, job.Message); - exitCode = 0; return true; } diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index 8fdfaa3c..82970549 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -512,6 +512,12 @@ + + - + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + SetValue(IssueTrackerRulesProperty, value); } + public static readonly StyledProperty> ChildrenProperty = + AvaloniaProperty.Register>(nameof(Children)); + + public AvaloniaList Children + { + get => GetValue(ChildrenProperty); + set => SetValue(ChildrenProperty, value); + } + public CommitBaseInfo() { InitializeComponent(); diff --git a/src/Views/CommitDetail.axaml b/src/Views/CommitDetail.axaml index cb99b3d9..4c6fd5dc 100644 --- a/src/Views/CommitDetail.axaml +++ b/src/Views/CommitDetail.axaml @@ -24,6 +24,7 @@ SignInfo="{Binding SignInfo}" SupportsContainsIn="True" WebLinks="{Binding WebLinks}" + Children="{Binding Children}" IssueTrackerRules="{Binding IssueTrackerRules}"/> diff --git a/src/Views/Preference.axaml b/src/Views/Preference.axaml index 9b84604a..0c7986ab 100644 --- a/src/Views/Preference.axaml +++ b/src/Views/Preference.axaml @@ -45,7 +45,7 @@ - + + + @@ -188,7 +193,7 @@ -
+
Date: Wed, 20 Nov 2024 01:17:50 +0000 Subject: [PATCH 0229/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 30 ++++++++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ecb4e40b..5e9f9ae8 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.57%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.71%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.99%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-100.00%25-brightgreen)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.57%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.29%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.43%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.86%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.71%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.29%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.71%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.71%25-yellow)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 83ba7f13..5425520f 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,24 +1,28 @@ -### de_DE.axaml: 99.57% +### de_DE.axaml: 99.29%
Missing Keys +- Text.CommitDetail.Info.Children +- Text.Preference.General.ShowChildren - Text.Repository.HistoriesOrder - Text.Repository.HistoriesOrder.ByDate - Text.Repository.HistoriesOrder.Topo
-### es_ES.axaml: 98.71% +### es_ES.axaml: 98.43%
Missing Keys +- Text.CommitDetail.Info.Children - Text.Preference.Appearance.FontSize - Text.Preference.Appearance.FontSize.Default - Text.Preference.Appearance.FontSize.Editor +- Text.Preference.General.ShowChildren - Text.Repository.FilterCommits.Default - Text.Repository.FilterCommits.Exclude - Text.Repository.FilterCommits.Include @@ -28,7 +32,7 @@
-### fr_FR.axaml: 97.99% +### fr_FR.axaml: 97.86%
@@ -40,6 +44,7 @@ - Text.Preference.Appearance.FontSize - Text.Preference.Appearance.FontSize.Default - Text.Preference.Appearance.FontSize.Editor +- Text.Preference.General.ShowChildren - Text.Repository.CustomActions - Text.Repository.FilterCommits.Default - Text.Repository.FilterCommits.Exclude @@ -51,44 +56,49 @@
-### pt_BR.axaml: 100.00% +### pt_BR.axaml: 99.71%
Missing Keys - +- Text.CommitDetail.Info.Children +- Text.Preference.General.ShowChildren
-### ru_RU.axaml: 99.57% +### ru_RU.axaml: 99.29%
Missing Keys +- Text.CommitDetail.Info.Children +- Text.Preference.General.ShowChildren - Text.Repository.HistoriesOrder - Text.Repository.HistoriesOrder.ByDate - Text.Repository.HistoriesOrder.Topo
-### zh_CN.axaml: 100.00% +### zh_CN.axaml: 99.71%
Missing Keys - +- Text.CommitDetail.Info.Children +- Text.Preference.General.ShowChildren
-### zh_TW.axaml: 100.00% +### zh_TW.axaml: 99.71%
Missing Keys - +- Text.CommitDetail.Info.Children +- Text.Preference.General.ShowChildren
From ab2156bfc21a1fe6d9404e6ee332c200447db212 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 20 Nov 2024 09:42:48 +0800 Subject: [PATCH 0230/1283] code_review: PR #710 * SourceGit.Commands.* should not reference SourceGit.ViewModels.* * remove unused namespace using * update translations for zh_CN and zh_TW * use WrapPanel instead of inner ScrollViewer * some other UI/UX changes Signed-off-by: leo --- src/Commands/QueryCommitChildren.cs | 22 ++-- src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 3 +- src/ViewModels/CommitDetail.cs | 4 +- src/ViewModels/Preference.cs | 15 ++- src/Views/CommitBaseInfo.axaml | 164 ++++++++++++++-------------- src/Views/Preference.axaml | 8 +- 7 files changed, 107 insertions(+), 110 deletions(-) diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs index c110ef94..293de912 100644 --- a/src/Commands/QueryCommitChildren.cs +++ b/src/Commands/QueryCommitChildren.cs @@ -1,25 +1,17 @@ -using System; -using System.Collections.Generic; -using SourceGit.ViewModels; +using System.Collections.Generic; namespace SourceGit.Commands { public class QueryCommitChildren : Command { - public QueryCommitChildren(string repo, string commit, string filters) + public QueryCommitChildren(string repo, string commit, int max, string filters) { WorkingDirectory = repo; Context = repo; _commit = commit; if (string.IsNullOrEmpty(filters)) - filters = "--all"; - Args = $"rev-list -{Preference.Instance.MaxHistoryCommits} --parents {filters} ^{commit}"; - } - - protected override void OnReadline(string line) - { - if (line.Contains(_commit)) - _lines.Add(line.Substring(0, 40)); + filters = "--branches --remotes --tags"; + Args = $"rev-list -{max} --parents {filters} ^{commit}"; } public IEnumerable Result() @@ -28,6 +20,12 @@ namespace SourceGit.Commands return _lines; } + protected override void OnReadline(string line) + { + if (line.Contains(_commit)) + _lines.Add(line.Substring(0, 40)); + } + private string _commit; private List _lines = new List(); } diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index a1779a36..1e6fca06 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -128,6 +128,7 @@ 基本信息 修改者 变更列表 + 子提交 提交者 查看包含此提交的分支/标签 本提交已被以下分支/标签包含 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index c821679b..06ee4b37 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -128,7 +128,8 @@ 基本資訊 作者 變更列表 - 提交者 + 後續提交 + 提交 檢視包含此提交的分支或標籤 本提交包含於以下分支或標籤 僅顯示前 100 項變更。請前往 [變更對比] 頁面以瀏覽所有變更。 diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 6d819300..e874b09b 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -547,7 +547,9 @@ namespace SourceGit.ViewModels { Task.Run(() => { - var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, _repo.Settings.BuildHistoriesFilter()) { Cancel = _cancelToken }; + var max = Preference.Instance.MaxHistoryCommits; + var filter = _repo.Settings.BuildHistoriesFilter(); + var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, max, filter) { Cancel = _cancelToken }; var children = cmdChildren.Result(); if (!cmdChildren.Cancel.Requested) Dispatcher.UIThread.Post(() => Children.AddRange(children)); diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index 9d3de526..70f0041f 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -144,6 +144,12 @@ namespace SourceGit.ViewModels set => SetProperty(ref _showAuthorTimeInGraph, value); } + public bool ShowChildren + { + get => _showChildren; + set => SetProperty(ref _showChildren, value); + } + public string IgnoreUpdateTag { get => _ignoreUpdateTag; @@ -294,12 +300,6 @@ namespace SourceGit.ViewModels set => SetProperty(ref _statisticsSampleColor, value); } - public bool ShowChildren - { - get => _showChildren; - set => SetProperty(ref _showChildren, value); - } - public List RepositoryNodes { get; @@ -598,6 +598,7 @@ namespace SourceGit.ViewModels private int _subjectGuideLength = 50; private bool _useFixedTabWidth = true; private bool _showAuthorTimeInGraph = false; + private bool _showChildren = false; private bool _check4UpdatesOnStartup = true; private double _lastCheckUpdateTime = 0; @@ -623,7 +624,5 @@ namespace SourceGit.ViewModels private string _externalMergeToolPath = string.Empty; private uint _statisticsSampleColor = 0xFF00FF00; - - private bool _showChildren = false; } } diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index d3d3bb0e..b58c3daf 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -53,8 +53,8 @@ - - + + - - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + - + - + + Content="{DynamicResource Text.Preference.General.ShowChildren}" + IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowChildren, Mode=TwoWay}"/> + Content="{DynamicResource Text.Preference.General.Check4UpdatesOnStartup}" + IsChecked="{Binding Source={x:Static vm:Preference.Instance}, Path=Check4UpdatesOnStartup, Mode=TwoWay}"/> From 15eaa9eeab01e94851268f5da51211a7917e8e35 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 20 Nov 2024 01:43:12 +0000 Subject: [PATCH 0231/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5e9f9ae8..9a611dd0 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.29%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.43%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.86%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.71%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.29%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.71%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.71%25-yellow)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.29%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.43%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.86%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.71%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.29%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.86%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.86%25-yellow)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 5425520f..a53d423a 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -81,24 +81,22 @@ -### zh_CN.axaml: 99.71% +### zh_CN.axaml: 99.86%
Missing Keys -- Text.CommitDetail.Info.Children - Text.Preference.General.ShowChildren
-### zh_TW.axaml: 99.71% +### zh_TW.axaml: 99.86%
Missing Keys -- Text.CommitDetail.Info.Children - Text.Preference.General.ShowChildren
From 71e09ee045c513d3faa77fdd72fa5f7dfac8616e Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 20 Nov 2024 09:56:38 +0800 Subject: [PATCH 0232/1283] localization: add missing translations for zh_CN and zh_TW (#710) Signed-off-by: leo --- src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 1e6fca06..0c0ccf14 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -456,6 +456,7 @@ 显示语言 最大历史提交数 在提交路线图中显示修改时间而非提交时间 + 在提交详情页中显示子提交列表 SUBJECT字数检测 GIT配置 自动换行转换 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 06ee4b37..c21f471f 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -455,6 +455,7 @@ 顯示語言 最大歷史提交數 在提交路線圖中顯示修改時間而非提交時間 + 在提交詳細面板中顯示後續提交 提交標題字數偵測 Git 設定 自動換行轉換 From 892c74406f7ce7316eeca3fbad17f502a7f0dd84 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 20 Nov 2024 01:57:08 +0000 Subject: [PATCH 0233/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9a611dd0..74cc6e3e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.29%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.43%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.86%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.71%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.29%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.86%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.86%25-yellow)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.29%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.43%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.86%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.71%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.29%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index a53d423a..d5061a30 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -81,22 +81,22 @@ -### zh_CN.axaml: 99.86% +### zh_CN.axaml: 100.00%
Missing Keys -- Text.Preference.General.ShowChildren +
-### zh_TW.axaml: 99.86% +### zh_TW.axaml: 100.00%
Missing Keys -- Text.Preference.General.ShowChildren +
From 4796024483962d66530ac2452732b5eabfee1fd0 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 20 Nov 2024 10:21:59 +0800 Subject: [PATCH 0234/1283] fix: modified the translation of Text.CommitDetail.Info.Committer by mistake Signed-off-by: leo --- src/Resources/Locales/zh_TW.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index c21f471f..31015ae7 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -129,7 +129,7 @@ 作者 變更列表 後續提交 - 提交 + 提交者 檢視包含此提交的分支或標籤 本提交包含於以下分支或標籤 僅顯示前 100 項變更。請前往 [變更對比] 頁面以瀏覽所有變更。 From 86d7541a7ce62b988aabea69816dcb2747ad8837 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 20 Nov 2024 11:27:43 +0800 Subject: [PATCH 0235/1283] enhance: histories filter * set upstream branch using the same filter mode when change the filter mode of local branch * also excludes the decorators when current filter mode is excluding. Signed-off-by: leo --- src/Models/RepositorySettings.cs | 6 ++++++ src/ViewModels/Repository.cs | 24 ++---------------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs index f6796198..5b3aa331 100644 --- a/src/Models/RepositorySettings.cs +++ b/src/Models/RepositorySettings.cs @@ -320,6 +320,8 @@ namespace SourceGit.Models { builder.Append("--exclude="); builder.Append(b); + builder.Append(" --decorate-refs-exclude=refs/heads/"); + builder.Append(b); builder.Append(' '); } } @@ -332,6 +334,8 @@ namespace SourceGit.Models { builder.Append("--exclude="); builder.Append(r); + builder.Append(" --decorate-refs-exclude=refs/remotes/"); + builder.Append(r); builder.Append(' '); } } @@ -344,6 +348,8 @@ namespace SourceGit.Models { builder.Append("--exclude="); builder.Append(t); + builder.Append(" --decorate-refs-exclude=refs/tags/"); + builder.Append(t); builder.Append(' '); } } diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index c87fea6b..2a87cb15 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -724,28 +724,8 @@ namespace SourceGit.ViewModels if (!changed) return; - if (isLocal && !string.IsNullOrEmpty(branch.Upstream) && mode != Models.FilterMode.Excluded) - { - var upstream = branch.Upstream; - var canUpdateUpstream = true; - foreach (var filter in _settings.HistoriesFilters) - { - bool matched = false; - if (filter.Type == Models.FilterType.RemoteBranch) - matched = filter.Pattern.Equals(upstream, StringComparison.Ordinal); - else if (filter.Type == Models.FilterType.RemoteBranchFolder) - matched = upstream.StartsWith(filter.Pattern, StringComparison.Ordinal); - - if (matched && filter.Mode == Models.FilterMode.Excluded) - { - canUpdateUpstream = false; - break; - } - } - - if (canUpdateUpstream) - _settings.UpdateHistoriesFilter(upstream, Models.FilterType.RemoteBranch, mode); - } + if (isLocal && !string.IsNullOrEmpty(branch.Upstream)) + _settings.UpdateHistoriesFilter(branch.Upstream, Models.FilterType.RemoteBranch, mode); } else { From 839dab494ba215a18c5e1209e7c42fc476d12df6 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 20 Nov 2024 14:39:53 +0800 Subject: [PATCH 0236/1283] ux: expand height of commit message box in commit template settings (#720) Signed-off-by: leo --- src/Views/RepositoryConfigure.axaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml index f1deca3a..c596f9e7 100644 --- a/src/Views/RepositoryConfigure.axaml +++ b/src/Views/RepositoryConfigure.axaml @@ -155,7 +155,7 @@ - + @@ -227,7 +227,7 @@ - + Date: Wed, 20 Nov 2024 16:52:30 +0800 Subject: [PATCH 0237/1283] refactor: update `Repository.HistoriesFilterMode` in `Repository.RefreshHistoriesFilters` Signed-off-by: leo --- src/ViewModels/Repository.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 2a87cb15..ab7924d5 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -704,12 +704,7 @@ namespace SourceGit.ViewModels { var changed = _settings.UpdateHistoriesFilter(tag.Name, Models.FilterType.Tag, mode); if (changed) - { - if (mode != Models.FilterMode.None || _settings.HistoriesFilters.Count == 0) - HistoriesFilterMode = mode; - RefreshHistoriesFilters(); - } } public void SetBranchFilterMode(BranchTreeNode node, Models.FilterMode mode) @@ -754,9 +749,6 @@ namespace SourceGit.ViewModels cur = parent; } while (true); - if (mode != Models.FilterMode.None || _settings.HistoriesFilters.Count == 0) - HistoriesFilterMode = mode; - RefreshHistoriesFilters(); } @@ -2073,6 +2065,12 @@ namespace SourceGit.ViewModels UpdateBranchTreeFilterMode(LocalBranchTrees, filters); UpdateBranchTreeFilterMode(RemoteBranchTrees, filters); UpdateTagFilterMode(filters); + + if (_settings.HistoriesFilters.Count > 0) + HistoriesFilterMode = _settings.HistoriesFilters[0].Mode; + else + HistoriesFilterMode = Models.FilterMode.None; + Task.Run(RefreshCommits); } From b3ebd84af54ff9d770bc3766fe74b55b25181360 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 20 Nov 2024 19:44:58 +0800 Subject: [PATCH 0238/1283] enhance: outputs the response body if OpenAI fails Signed-off-by: leo --- src/Models/OpenAI.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Models/OpenAI.cs b/src/Models/OpenAI.cs index c5ca7449..58f26792 100644 --- a/src/Models/OpenAI.cs +++ b/src/Models/OpenAI.cs @@ -169,12 +169,15 @@ namespace SourceGit.Models task.Wait(cancellation); var rsp = task.Result; - if (!rsp.IsSuccessStatusCode) - throw new Exception($"AI service returns error code {rsp.StatusCode}"); - var reader = rsp.Content.ReadAsStringAsync(cancellation); reader.Wait(cancellation); + var body = reader.Result; + if (!rsp.IsSuccessStatusCode) + { + throw new Exception($"AI service returns error code {rsp.StatusCode}. Body: {body??string.Empty}"); + } + return JsonSerializer.Deserialize(reader.Result, JsonCodeGen.Default.OpenAIChatResponse); } catch From 142987f73d19c2878b15807889af3427df6dbb48 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 09:31:38 +0800 Subject: [PATCH 0239/1283] enhance: use `user` instead of `system` to supports OpenAI's o1-preview and o1-mini model (#725) Signed-off-by: leo --- src/Models/OpenAI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/OpenAI.cs b/src/Models/OpenAI.cs index 58f26792..516a9423 100644 --- a/src/Models/OpenAI.cs +++ b/src/Models/OpenAI.cs @@ -150,7 +150,7 @@ namespace SourceGit.Models public OpenAIChatResponse Chat(string prompt, string question, CancellationToken cancellation) { var chat = new OpenAIChatRequest() { Model = Model }; - chat.AddMessage("system", prompt); + chat.AddMessage("user", prompt); chat.AddMessage("user", question); var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(60) }; From a980cc987d60c038e0ce92eee8fb972fb4737ac6 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 09:57:43 +0800 Subject: [PATCH 0240/1283] fix: wired ordering when cherry-pick multiple commits (#726) Since the items in `ListBox.SelectedItems` are not ordered by their position in the list, but in the order user selected, it need be sorted before `cherry-pick` Signed-off-by: leo --- src/ViewModels/Histories.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 55b04713..2f597849 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -243,6 +243,12 @@ namespace SourceGit.ViewModels if (canCherryPick) { + // Sort selected commits in order. + selected.Sort((l, r) => + { + return _commits.IndexOf(r) - _commits.IndexOf(l); + }); + var cherryPickMultiple = new MenuItem(); cherryPickMultiple.Header = App.Text("CommitCM.CherryPickMultiple"); cherryPickMultiple.Icon = App.CreateMenuIcon("Icons.CherryPick"); From 22157a5c98bee2121ff20b87787ba1b1063bdf5e Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 10:04:44 +0800 Subject: [PATCH 0241/1283] fix: tooltip of parent SHA textblock is not closed properly (#727) Signed-off-by: leo --- src/Views/CommitBaseInfo.axaml.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Views/CommitBaseInfo.axaml.cs b/src/Views/CommitBaseInfo.axaml.cs index 6a4af344..64fb4189 100644 --- a/src/Views/CommitBaseInfo.axaml.cs +++ b/src/Views/CommitBaseInfo.axaml.cs @@ -136,10 +136,12 @@ namespace SourceGit.Views else { var c = await Task.Run(() => detail.GetParent(sha)); - if (c != null) + if (c != null && ctl.IsVisible && ctl.DataContext is string newSHA && newSHA == sha) { ToolTip.SetTip(ctl, c); - ToolTip.SetIsOpen(ctl, ctl.IsPointerOver); + + if (ctl.IsPointerOver) + ToolTip.SetIsOpen(ctl, true); } } } From 8342702103477917f78c92d37755873fc29c30fd Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 10:19:00 +0800 Subject: [PATCH 0242/1283] feature: add save as path menu item for commit change (#724) Signed-off-by: leo --- src/ViewModels/CommitDetail.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index e874b09b..05b60e2f 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -315,12 +315,40 @@ namespace SourceGit.ViewModels ev.Handled = true; }; + var patch = new MenuItem(); + patch.Header = App.Text("FileCM.SaveAsPatch"); + patch.Icon = App.CreateMenuIcon("Icons.Diff"); + patch.Click += async (_, e) => + { + var storageProvider = App.GetStorageProvider(); + if (storageProvider == null) + return; + + var options = new FilePickerSaveOptions(); + options.Title = App.Text("FileCM.SaveAsPatch"); + options.DefaultExtension = ".patch"; + options.FileTypeChoices = [new FilePickerFileType("Patch File") { Patterns = ["*.patch"] }]; + + var baseRevision = _commit.Parents.Count == 0 ? "4b825dc642cb6eb9a060e54bf8d69288fbee4904" : _commit.Parents[0]; + var storageFile = await storageProvider.SaveFilePickerAsync(options); + if (storageFile != null) + { + var saveTo = storageFile.Path.LocalPath; + var succ = await Task.Run(() => Commands.SaveChangesAsPatch.ProcessRevisionCompareChanges(_repo.FullPath, [change], baseRevision, _commit.SHA, saveTo)); + if (succ) + App.SendNotification(_repo.FullPath, App.Text("SaveAsPatchSuccess")); + } + + e.Handled = true; + }; + var menu = new ContextMenu(); menu.Items.Add(diffWithMerger); menu.Items.Add(explore); menu.Items.Add(new MenuItem { Header = "-" }); menu.Items.Add(history); menu.Items.Add(blame); + menu.Items.Add(patch); menu.Items.Add(new MenuItem { Header = "-" }); var resetToThisRevision = new MenuItem(); From d3eca59036b118e22d0b8fabc7fffcaa235497ab Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 12:14:11 +0800 Subject: [PATCH 0243/1283] refactor: rewrite the way to make sure scan repositories panel shows at least 0.5s (#728) Signed-off-by: leo --- src/ViewModels/ScanRepositories.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/ScanRepositories.cs b/src/ViewModels/ScanRepositories.cs index 115edf2d..7b52c670 100644 --- a/src/ViewModels/ScanRepositories.cs +++ b/src/ViewModels/ScanRepositories.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Threading.Tasks; + using Avalonia.Threading; namespace SourceGit.ViewModels @@ -28,8 +30,8 @@ namespace SourceGit.ViewModels return Task.Run(() => { - // If it is too fast, the panel will disappear very quickly, then we'll have a bad experience. - Task.Delay(500).Wait(); + var watch = new Stopwatch(); + watch.Start(); var rootDir = new DirectoryInfo(RootDir); var founded = new List(); @@ -62,6 +64,12 @@ namespace SourceGit.ViewModels Welcome.Instance.Refresh(); }); + // Make sure this task takes at least 0.5s to avoid that the popup panel do not disappear very quickly. + var remain = 500 - (int)watch.Elapsed.TotalMilliseconds; + watch.Stop(); + if (remain > 0) + Task.Delay(remain).Wait(); + return true; }); } From 069dc255d1d9892cb1a3cef35bab5af18091f09f Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 12:56:12 +0800 Subject: [PATCH 0244/1283] enhance: skip scanning sub folders if current is not a git repository but has `.git` subfolder/file (#728) Signed-off-by: leo --- src/ViewModels/ScanRepositories.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ViewModels/ScanRepositories.cs b/src/ViewModels/ScanRepositories.cs index 7b52c670..923413a3 100644 --- a/src/ViewModels/ScanRepositories.cs +++ b/src/ViewModels/ScanRepositories.cs @@ -103,11 +103,11 @@ namespace SourceGit.ViewModels if (test.IsSuccess && !string.IsNullOrEmpty(test.StdOut)) { var normalized = test.StdOut.Trim().Replace("\\", "/"); - if (!_managed.Contains(normalizedSelf)) + if (!_managed.Contains(normalized)) outs.Add(normalized); - - continue; } + + continue; } if (depth < 8) From b407dd97a176d7d8eaa9acfc5dc4f04b8b7d8bf3 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 14:18:41 +0800 Subject: [PATCH 0245/1283] enhance: reduce repository scanning time (#728) * skip special folders, such as `node_modules`, `.svn`, `.vs` .etc. * change max scanning depth to 5 Signed-off-by: leo --- src/ViewModels/ScanRepositories.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ViewModels/ScanRepositories.cs b/src/ViewModels/ScanRepositories.cs index 923413a3..be8af5ab 100644 --- a/src/ViewModels/ScanRepositories.cs +++ b/src/ViewModels/ScanRepositories.cs @@ -90,6 +90,13 @@ namespace SourceGit.ViewModels var subdirs = dir.GetDirectories("*", opts); foreach (var subdir in subdirs) { + if (subdir.Name.Equals("node_modules", StringComparison.Ordinal) || + subdir.Name.Equals(".svn", StringComparison.Ordinal) || + subdir.Name.Equals(".vs", StringComparison.Ordinal) || + subdir.Name.Equals(".vscode", StringComparison.Ordinal) || + subdir.Name.Equals(".idea", StringComparison.Ordinal)) + continue; + SetProgressDescription($"Scanning {subdir.FullName}..."); var normalizedSelf = subdir.FullName.Replace("\\", "/"); @@ -110,7 +117,7 @@ namespace SourceGit.ViewModels continue; } - if (depth < 8) + if (depth < 5) GetUnmanagedRepositories(subdir, outs, opts, depth + 1); } } From d98765364d2c81bab1891c01504ff7381c43a573 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 14:49:32 +0800 Subject: [PATCH 0246/1283] feature: supports using local repository as remote (#706) Signed-off-by: leo --- src/Models/Remote.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Models/Remote.cs b/src/Models/Remote.cs index dcf30ddc..98749c51 100644 --- a/src/Models/Remote.cs +++ b/src/Models/Remote.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Text.RegularExpressions; namespace SourceGit.Models @@ -49,7 +50,7 @@ namespace SourceGit.Models return true; } - return false; + return Directory.Exists(url); } public bool TryGetVisitURL(out string url) From f0d82854165519133b4d35298e00bfe2f8e97d8e Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 14:53:43 +0800 Subject: [PATCH 0247/1283] enhance: only supports using local bare repository as remote (#706) Signed-off-by: leo --- src/Models/Remote.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Remote.cs b/src/Models/Remote.cs index 98749c51..a65fa345 100644 --- a/src/Models/Remote.cs +++ b/src/Models/Remote.cs @@ -50,7 +50,7 @@ namespace SourceGit.Models return true; } - return Directory.Exists(url); + return url.EndsWith(".git", StringComparison.Ordinal) && Directory.Exists(url); } public bool TryGetVisitURL(out string url) From e6e1e4e82ebd6fd883612a71c2000bbe39db181d Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 19:23:59 +0800 Subject: [PATCH 0248/1283] fix: can not type characters with accent (#716) Leaves the `X11PlatformOptions.EnableIme` unsetted, since Avalonia will auto enable it when `LANG` contains `zh`/`ja`/`vi`/`ko` Signed-off-by: leo --- src/Native/Linux.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Native/Linux.cs b/src/Native/Linux.cs index 55b7b43b..76711bf2 100644 --- a/src/Native/Linux.cs +++ b/src/Native/Linux.cs @@ -13,10 +13,7 @@ namespace SourceGit.Native { public void SetupApp(AppBuilder builder) { - builder.With(new X11PlatformOptions() - { - EnableIme = true, - }); + builder.With(new X11PlatformOptions()); } public string FindGitExecutable() From 8bd5bd864e7b90cf8f2539b55fb72838bd446e69 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 20:50:51 +0800 Subject: [PATCH 0249/1283] feature: add context menu to switch histories filter mode to selected commit Signed-off-by: leo --- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/ViewModels/Histories.cs | 111 ++++++++++++++++++++++++++++++ src/ViewModels/Repository.cs | 7 ++ 5 files changed, 121 insertions(+) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 462cdf90..705d7c6f 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -542,6 +542,7 @@ Enable '--reflog' Option Open in File Browser Search Branches/Tags/Submodules + Visibility in Graph Unset Hide in commit graph Filter in commit graph diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 0c0ccf14..21837119 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -546,6 +546,7 @@ 启用 --reflog 选项 在文件浏览器中打开 快速查找分支/标签/子模块 + 设置在列表中的可见性 不指定 在提交列表中隐藏 使用其对提交列表过滤 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 31015ae7..59b0afe0 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -545,6 +545,7 @@ 啟用 [--reflog] 選項 在檔案瀏覽器中開啟 快速搜尋分支/標籤/子模組 + 設定在列表中的可視性 不指定 在提交清單中隱藏 使用其來篩選提交清單 diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 2f597849..92524f62 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -703,12 +703,117 @@ namespace SourceGit.ViewModels return menu; } + private Models.FilterMode GetFilterMode(string pattern) + { + foreach (var filter in _repo.Settings.HistoriesFilters) + { + if (filter.Pattern.Equals(pattern, StringComparison.Ordinal)) + return filter.Mode; + } + + return Models.FilterMode.None; + } + + private void FillBranchVisibilityMenu(MenuItem submenu, Models.Branch branch) + { + var visibility = new MenuItem(); + visibility.Icon = App.CreateMenuIcon("Icons.Eye"); + visibility.Header = App.Text("Repository.FilterCommits"); + + var exclude = new MenuItem(); + exclude.Icon = App.CreateMenuIcon("Icons.EyeClose"); + exclude.Header = App.Text("Repository.FilterCommits.Exclude"); + exclude.Click += (_, e) => + { + _repo.SetBranchFilterMode(branch, Models.FilterMode.Excluded); + e.Handled = true; + }; + + var filterMode = GetFilterMode(branch.FullName); + if (filterMode == Models.FilterMode.None) + { + var include = new MenuItem(); + include.Icon = App.CreateMenuIcon("Icons.Filter"); + include.Header = App.Text("Repository.FilterCommits.Include"); + include.Click += (_, e) => + { + _repo.SetBranchFilterMode(branch, Models.FilterMode.Included); + e.Handled = true; + }; + visibility.Items.Add(include); + visibility.Items.Add(exclude); + } + else + { + var unset = new MenuItem(); + unset.Header = App.Text("Repository.FilterCommits.Default"); + unset.Click += (_, e) => + { + _repo.SetBranchFilterMode(branch, Models.FilterMode.None); + e.Handled = true; + }; + visibility.Items.Add(exclude); + visibility.Items.Add(unset); + } + + submenu.Items.Add(visibility); + submenu.Items.Add(new MenuItem() { Header = "-" }); + } + + private void FillTagVisibilityMenu(MenuItem submenu, Models.Tag tag) + { + var visibility = new MenuItem(); + visibility.Icon = App.CreateMenuIcon("Icons.Eye"); + visibility.Header = App.Text("Repository.FilterCommits"); + + var exclude = new MenuItem(); + exclude.Icon = App.CreateMenuIcon("Icons.EyeClose"); + exclude.Header = App.Text("Repository.FilterCommits.Exclude"); + exclude.Click += (_, e) => + { + _repo.SetTagFilterMode(tag, Models.FilterMode.Excluded); + e.Handled = true; + }; + + var filterMode = GetFilterMode(tag.Name); + if (filterMode == Models.FilterMode.None) + { + var include = new MenuItem(); + include.Icon = App.CreateMenuIcon("Icons.Filter"); + include.Header = App.Text("Repository.FilterCommits.Include"); + include.Click += (_, e) => + { + _repo.SetTagFilterMode(tag, Models.FilterMode.Included); + e.Handled = true; + }; + visibility.Items.Add(include); + visibility.Items.Add(exclude); + } + else + { + var unset = new MenuItem(); + unset.Header = App.Text("Repository.FilterCommits.Default"); + unset.Click += (_, e) => + { + _repo.SetTagFilterMode(tag, Models.FilterMode.None); + e.Handled = true; + }; + visibility.Items.Add(exclude); + visibility.Items.Add(unset); + } + + submenu.Items.Add(visibility); + submenu.Items.Add(new MenuItem() { Header = "-" }); + } + private void FillCurrentBranchMenu(ContextMenu menu, Models.Branch current) { var submenu = new MenuItem(); submenu.Icon = App.CreateMenuIcon("Icons.Branch"); submenu.Header = current.Name; + FillBranchVisibilityMenu(submenu, current); + if (!string.IsNullOrEmpty(current.Upstream)) { var upstream = current.Upstream.Substring(13); @@ -786,6 +891,8 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Branch"); submenu.Header = branch.Name; + FillBranchVisibilityMenu(submenu, branch); + var checkout = new MenuItem(); checkout.Header = new Views.NameHighlightedTextBlock("BranchCM.Checkout", branch.Name); checkout.Icon = App.CreateMenuIcon("Icons.Check"); @@ -858,6 +965,8 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Branch"); submenu.Header = name; + FillBranchVisibilityMenu(submenu, branch); + var checkout = new MenuItem(); checkout.Header = new Views.NameHighlightedTextBlock("BranchCM.Checkout", name); checkout.Icon = App.CreateMenuIcon("Icons.Check"); @@ -903,6 +1012,8 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Tag"); submenu.MinWidth = 200; + FillTagVisibilityMenu(submenu, tag); + var push = new MenuItem(); push.Header = new Views.NameHighlightedTextBlock("TagCM.Push", tag.Name); push.Icon = App.CreateMenuIcon("Icons.Push"); diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index ab7924d5..3182ab6f 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -707,6 +707,13 @@ namespace SourceGit.ViewModels RefreshHistoriesFilters(); } + public void SetBranchFilterMode(Models.Branch branch, Models.FilterMode mode) + { + var node = FindBranchNode(branch.IsLocal ? _localBranchTrees : _remoteBranchTrees, branch.FullName); + if (node != null) + SetBranchFilterMode(node, mode); + } + public void SetBranchFilterMode(BranchTreeNode node, Models.FilterMode mode) { var isLocal = node.Path.StartsWith("refs/heads/", StringComparison.Ordinal); From f545ceeb709acc55215525c3c87afeaee66053a9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 21 Nov 2024 12:51:19 +0000 Subject: [PATCH 0250/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 74cc6e3e..e2a613f3 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.29%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.43%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.86%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.71%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.29%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.14%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.29%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.72%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.14%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index d5061a30..6997f12a 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 99.29% +### de_DE.axaml: 99.14%
@@ -6,13 +6,14 @@ - Text.CommitDetail.Info.Children - Text.Preference.General.ShowChildren +- Text.Repository.FilterCommits - Text.Repository.HistoriesOrder - Text.Repository.HistoriesOrder.ByDate - Text.Repository.HistoriesOrder.Topo
-### es_ES.axaml: 98.43% +### es_ES.axaml: 98.29%
@@ -23,6 +24,7 @@ - Text.Preference.Appearance.FontSize.Default - Text.Preference.Appearance.FontSize.Editor - Text.Preference.General.ShowChildren +- Text.Repository.FilterCommits - Text.Repository.FilterCommits.Default - Text.Repository.FilterCommits.Exclude - Text.Repository.FilterCommits.Include @@ -32,7 +34,7 @@
-### fr_FR.axaml: 97.86% +### fr_FR.axaml: 97.72%
@@ -46,6 +48,7 @@ - Text.Preference.Appearance.FontSize.Editor - Text.Preference.General.ShowChildren - Text.Repository.CustomActions +- Text.Repository.FilterCommits - Text.Repository.FilterCommits.Default - Text.Repository.FilterCommits.Exclude - Text.Repository.FilterCommits.Include @@ -56,7 +59,7 @@
-### pt_BR.axaml: 99.71% +### pt_BR.axaml: 99.57%
@@ -64,10 +67,11 @@ - Text.CommitDetail.Info.Children - Text.Preference.General.ShowChildren +- Text.Repository.FilterCommits
-### ru_RU.axaml: 99.29% +### ru_RU.axaml: 99.14%
@@ -75,6 +79,7 @@ - Text.CommitDetail.Info.Children - Text.Preference.General.ShowChildren +- Text.Repository.FilterCommits - Text.Repository.HistoriesOrder - Text.Repository.HistoriesOrder.ByDate - Text.Repository.HistoriesOrder.Topo From 8a95a17b0eeaa2fdf76bd8344be42dc0168f215b Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 20:55:59 +0800 Subject: [PATCH 0251/1283] ux: re-order menu items Signed-off-by: leo --- src/Resources/Locales/en_US.axaml | 2 +- src/ViewModels/Histories.cs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 705d7c6f..6ff69ba9 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -542,7 +542,7 @@ Enable '--reflog' Option Open in File Browser Search Branches/Tags/Submodules - Visibility in Graph + Set visibility Unset Hide in commit graph Filter in commit graph diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 92524f62..2bbe83bb 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -812,8 +812,6 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Branch"); submenu.Header = current.Name; - FillBranchVisibilityMenu(submenu, current); - if (!string.IsNullOrEmpty(current.Upstream)) { var upstream = current.Upstream.Substring(13); @@ -871,6 +869,8 @@ namespace SourceGit.ViewModels submenu.Items.Add(new MenuItem() { Header = "-" }); } + FillBranchVisibilityMenu(submenu, current); + var rename = new MenuItem(); rename.Header = new Views.NameHighlightedTextBlock("BranchCM.Rename", current.Name); rename.Icon = App.CreateMenuIcon("Icons.Rename"); @@ -891,8 +891,6 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Branch"); submenu.Header = branch.Name; - FillBranchVisibilityMenu(submenu, branch); - var checkout = new MenuItem(); checkout.Header = new Views.NameHighlightedTextBlock("BranchCM.Checkout", branch.Name); checkout.Icon = App.CreateMenuIcon("Icons.Check"); @@ -932,6 +930,8 @@ namespace SourceGit.ViewModels submenu.Items.Add(new MenuItem() { Header = "-" }); } + FillBranchVisibilityMenu(submenu, branch); + var rename = new MenuItem(); rename.Header = new Views.NameHighlightedTextBlock("BranchCM.Rename", branch.Name); rename.Icon = App.CreateMenuIcon("Icons.Rename"); @@ -965,8 +965,6 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Branch"); submenu.Header = name; - FillBranchVisibilityMenu(submenu, branch); - var checkout = new MenuItem(); checkout.Header = new Views.NameHighlightedTextBlock("BranchCM.Checkout", name); checkout.Icon = App.CreateMenuIcon("Icons.Check"); @@ -991,6 +989,8 @@ namespace SourceGit.ViewModels submenu.Items.Add(merge); submenu.Items.Add(new MenuItem() { Header = "-" }); + FillBranchVisibilityMenu(submenu, branch); + var delete = new MenuItem(); delete.Header = new Views.NameHighlightedTextBlock("BranchCM.Delete", name); delete.Icon = App.CreateMenuIcon("Icons.Clear"); @@ -1012,8 +1012,6 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Tag"); submenu.MinWidth = 200; - FillTagVisibilityMenu(submenu, tag); - var push = new MenuItem(); push.Header = new Views.NameHighlightedTextBlock("TagCM.Push", tag.Name); push.Icon = App.CreateMenuIcon("Icons.Push"); @@ -1039,6 +1037,8 @@ namespace SourceGit.ViewModels submenu.Items.Add(merge); submenu.Items.Add(new MenuItem() { Header = "-" }); + FillTagVisibilityMenu(submenu, tag); + var delete = new MenuItem(); delete.Header = new Views.NameHighlightedTextBlock("TagCM.Delete", tag.Name); delete.Icon = App.CreateMenuIcon("Icons.Clear"); From 13504d18318e2a3bf721b276c157bb6c50af868d Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 21:01:06 +0800 Subject: [PATCH 0252/1283] ux: make sure Icons.Eye center aligned Signed-off-by: leo --- src/Resources/Icons.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml index 413d2df9..8d66a250 100644 --- a/src/Resources/Icons.axaml +++ b/src/Resources/Icons.axaml @@ -32,7 +32,7 @@ M469 235V107h85v128h-85zm-162-94 85 85-60 60-85-85 60-60zm469 60-85 85-60-60 85-85 60 60zm-549 183A85 85 0 01302 341H722a85 85 0 0174 42l131 225A85 85 0 01939 652V832a85 85 0 01-85 85H171a85 85 0 01-85-85v-180a85 85 0 0112-43l131-225zM722 427H302l-100 171h255l10 29a59 59 0 002 5c2 4 5 9 9 14 8 9 18 17 34 17 16 0 26-7 34-17a72 72 0 0011-18l0-0 10-29h255l-100-171zM853 683H624a155 155 0 01-12 17C593 722 560 747 512 747c-48 0-81-25-99-47a155 155 0 01-12-17H171v149h683v-149z M576 832C576 867 547 896 512 896 477 896 448 867 448 832 448 797 477 768 512 768 547 768 576 797 576 832ZM512 256C477 256 448 285 448 320L448 640C448 675 477 704 512 704 547 704 576 675 576 640L576 320C576 285 547 256 512 256ZM1024 896C1024 967 967 1024 896 1024L128 1024C57 1024 0 967 0 896 0 875 5 855 14 837L14 837 398 69 398 69C420 28 462 0 512 0 562 0 604 28 626 69L1008 835C1018 853 1024 874 1024 896ZM960 896C960 885 957 875 952 865L952 864 951 863 569 98C557 77 536 64 512 64 488 64 466 77 455 99L452 105 92 825 93 825 71 867C66 876 64 886 64 896 64 931 93 960 128 960L896 960C931 960 960 931 960 896Z M928 128l-416 0-32-64-352 0-64 128 896 0zM904 704l75 0 45-448-1024 0 64 640 484 0c-105-38-180-138-180-256 0-150 122-272 272-272s272 122 272 272c0 22-3 43-8 64zM1003 914l-198-175c17-29 27-63 27-99 0-106-86-192-192-192s-192 86-192 192 86 192 192 192c36 0 70-10 99-27l175 198c23 27 62 28 87 3l6-6c25-25 23-64-3-87zM640 764c-68 0-124-56-124-124s56-124 124-124 124 56 124 124-56 124-124 124z - M520 168C291 168 95 311 16 512c79 201 275 344 504 344 229 0 425-143 504-344-79-201-275-344-504-344zm0 573c-126 0-229-103-229-229s103-229 229-229c126 0 229 103 229 229s-103 229-229 229zm0-367c-76 0-137 62-137 137s62 137 137 137S657 588 657 512s-62-137-137-137z + M0 512M1024 512M512 0M512 1024M520 168C291 168 95 311 16 512c79 201 275 344 504 344 229 0 425-143 504-344-79-201-275-344-504-344zm0 573c-126 0-229-103-229-229s103-229 229-229c126 0 229 103 229 229s-103 229-229 229zm0-367c-76 0-137 62-137 137s62 137 137 137S657 588 657 512s-62-137-137-137z M734 128c-33-19-74-8-93 25l-41 70c-28-6-58-9-90-9-294 0-445 298-445 298s82 149 231 236l-31 54c-19 33-8 74 25 93 33 19 74 8 93-25L759 222C778 189 767 147 734 128zM305 512c0-115 93-208 207-208 14 0 27 1 40 4l-37 64c-1 0-2 0-2 0-77 0-140 63-140 140 0 26 7 51 20 71l-37 64C324 611 305 564 305 512zM771 301 700 423c13 27 20 57 20 89 0 110-84 200-192 208l-51 89c12 1 24 2 36 2 292 0 446-298 446-298S895 388 771 301z M826 498 538 250c-11-9-26-1-26 14v496c0 15 16 23 26 14L826 526c8-7 8-21 0-28zm-320 0L218 250c-11-9-26-1-26 14v496c0 15 16 23 26 14L506 526c4-4 6-9 6-14 0-5-2-10-6-14z M1024 896v128H0V704h128v192h768V704h128v192zM576 555 811 320 896 405l-384 384-384-384L213 320 448 555V0h128v555z From 1e148c032d2cccbe1d3ed91c8af259fd8dd01055 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 21 Nov 2024 21:10:15 +0800 Subject: [PATCH 0253/1283] localization: update English translations Signed-off-by: leo --- src/Resources/Locales/en_US.axaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 6ff69ba9..799288ef 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -115,7 +115,7 @@ Revert Commit Reword Save as Patch... - Squash Into Parent + Squash into Parent Squash Child Commits to Here CHANGES Search Changes... @@ -542,7 +542,7 @@ Enable '--reflog' Option Open in File Browser Search Branches/Tags/Submodules - Set visibility + Visibility in Graph Unset Hide in commit graph Filter in commit graph From c1c743f2ff92fb6a9362806baddc4bb47534ffc8 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 22 Nov 2024 09:17:56 +0800 Subject: [PATCH 0254/1283] readme: add tips for Linux users Signed-off-by: leo --- README.md | 1 + src/Native/Linux.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e2a613f3..cd5d869d 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ For **Linux** users: * `xdg-open` must be installed to support open native file manager. * Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your linux. * Maybe you need to set environment variable `AVALONIA_SCREEN_SCALE_FACTORS`. See https://github.com/AvaloniaUI/Avalonia/wiki/Configuring-X11-per-monitor-DPI. +* If you can NOT type accented characters, such as `ê`, `ó`, try to set the environment variable `AVALONIA_IM_MODULE` to `none`. ## OpenAI diff --git a/src/Native/Linux.cs b/src/Native/Linux.cs index 76711bf2..a24f1b65 100644 --- a/src/Native/Linux.cs +++ b/src/Native/Linux.cs @@ -13,7 +13,7 @@ namespace SourceGit.Native { public void SetupApp(AppBuilder builder) { - builder.With(new X11PlatformOptions()); + builder.With(new X11PlatformOptions() { EnableIme = true }); } public string FindGitExecutable() From 153a1f30b28bbc37ebf3e8851fa69cd042b9f3cf Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 22 Nov 2024 09:39:50 +0800 Subject: [PATCH 0255/1283] feature: supports toggle `--force` option for `git fetch` command (#721) * Background auto fetch will always disable this option * This option is not add to pull operation Signed-off-by: leo --- src/Commands/Fetch.cs | 5 ++++- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/ViewModels/AddRemote.cs | 2 +- src/ViewModels/Fetch.cs | 12 ++++++++++-- src/ViewModels/Pull.cs | 1 + src/ViewModels/Repository.cs | 2 +- src/Views/Fetch.axaml | 8 ++++++-- 9 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/Commands/Fetch.cs b/src/Commands/Fetch.cs index 834cd7fc..1c3e78cb 100644 --- a/src/Commands/Fetch.cs +++ b/src/Commands/Fetch.cs @@ -4,7 +4,7 @@ namespace SourceGit.Commands { public class Fetch : Command { - public Fetch(string repo, string remote, bool noTags, bool prune, Action outputHandler) + public Fetch(string repo, string remote, bool noTags, bool prune, bool force, Action outputHandler) { _outputHandler = outputHandler; WorkingDirectory = repo; @@ -18,6 +18,9 @@ namespace SourceGit.Commands else Args += "--tags "; + if (force) + Args += "--force "; + if (prune) Args += "--prune "; diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 799288ef..0a0af997 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -268,6 +268,7 @@ Fast-Forward (without checkout) Fetch Fetch all remotes + Enable '--force' option Fetch without tags Remote: Fetch Remote Changes diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 21837119..1b549c83 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -271,6 +271,7 @@ 快进(fast-forward,无需checkout) 拉取(fetch) 拉取所有的远程仓库 + 启用 --force 选项 不拉取远程标签 远程仓库 : 拉取远程仓库内容 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 59b0afe0..f4ec03ad 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -271,6 +271,7 @@ 快進 (fast-forward,無需 checkout) 提取 (fetch) 提取所有的遠端存放庫 + 啟用 [--force] 選項 不提取遠端標籤 遠端存放庫: 提取遠端存放庫內容 diff --git a/src/ViewModels/AddRemote.cs b/src/ViewModels/AddRemote.cs index d6424572..2ca7449f 100644 --- a/src/ViewModels/AddRemote.cs +++ b/src/ViewModels/AddRemote.cs @@ -100,7 +100,7 @@ namespace SourceGit.ViewModels { SetProgressDescription("Fetching from added remote ..."); new Commands.Config(_repo.FullPath).Set($"remote.{_name}.sshkey", _useSSH ? SSHKey : null); - new Commands.Fetch(_repo.FullPath, _name, false, false, SetProgressDescription).Exec(); + new Commands.Fetch(_repo.FullPath, _name, false, false, false, SetProgressDescription).Exec(); } CallUIThread(() => { diff --git a/src/ViewModels/Fetch.cs b/src/ViewModels/Fetch.cs index 7f54680d..a93304f7 100644 --- a/src/ViewModels/Fetch.cs +++ b/src/ViewModels/Fetch.cs @@ -28,10 +28,17 @@ namespace SourceGit.ViewModels set => _repo.Settings.FetchWithoutTags = value; } + public bool Force + { + get; + set; + } + public Fetch(Repository repo, Models.Remote preferedRemote = null) { _repo = repo; _fetchAllRemotes = preferedRemote == null; + Force = false; SelectedRemote = preferedRemote != null ? preferedRemote : _repo.Remotes[0]; View = new Views.Fetch() { DataContext = this }; } @@ -42,6 +49,7 @@ namespace SourceGit.ViewModels var notags = _repo.Settings.FetchWithoutTags; var prune = _repo.Settings.EnablePruneOnFetch; + var force = Force; return Task.Run(() => { if (FetchAllRemotes) @@ -49,13 +57,13 @@ namespace SourceGit.ViewModels foreach (var remote in _repo.Remotes) { SetProgressDescription($"Fetching remote: {remote.Name}"); - new Commands.Fetch(_repo.FullPath, remote.Name, notags, prune, SetProgressDescription).Exec(); + new Commands.Fetch(_repo.FullPath, remote.Name, notags, prune, force, SetProgressDescription).Exec(); } } else { SetProgressDescription($"Fetching remote: {SelectedRemote.Name}"); - new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, notags, prune, SetProgressDescription).Exec(); + new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, notags, prune, force, SetProgressDescription).Exec(); } CallUIThread(() => diff --git a/src/ViewModels/Pull.cs b/src/ViewModels/Pull.cs index 6c493449..e7c62980 100644 --- a/src/ViewModels/Pull.cs +++ b/src/ViewModels/Pull.cs @@ -152,6 +152,7 @@ namespace SourceGit.ViewModels _selectedRemote.Name, NoTags, _repo.Settings.EnablePruneOnFetch, + false, SetProgressDescription).Exec(); if (!rs) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 3182ab6f..a5d48648 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -2194,7 +2194,7 @@ namespace SourceGit.ViewModels IsAutoFetching = true; Dispatcher.UIThread.Invoke(() => OnPropertyChanged(nameof(IsAutoFetching))); - new Commands.Fetch(_fullpath, "--all", false, _settings.EnablePruneOnFetch, null) { RaiseError = false }.Exec(); + new Commands.Fetch(_fullpath, "--all", false, _settings.EnablePruneOnFetch, false, null) { RaiseError = false }.Exec(); _lastFetchTime = DateTime.Now; IsAutoFetching = false; Dispatcher.UIThread.Invoke(() => OnPropertyChanged(nameof(IsAutoFetching))); diff --git a/src/Views/Fetch.axaml b/src/Views/Fetch.axaml index a9c2fd90..f9380ab0 100644 --- a/src/Views/Fetch.axaml +++ b/src/Views/Fetch.axaml @@ -11,7 +11,7 @@ - + + + - From 378e8d3ea33051ec86eeb301fccc6e4e5c236e52 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 22 Nov 2024 01:40:15 +0000 Subject: [PATCH 0256/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cd5d869d..ffc15541 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.14%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.29%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.72%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.14%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.00%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.15%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.58%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.43%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.00%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 6997f12a..274f0341 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,10 +1,11 @@ -### de_DE.axaml: 99.14% +### de_DE.axaml: 99.00%
Missing Keys - Text.CommitDetail.Info.Children +- Text.Fetch.Force - Text.Preference.General.ShowChildren - Text.Repository.FilterCommits - Text.Repository.HistoriesOrder @@ -13,13 +14,14 @@
-### es_ES.axaml: 98.29% +### es_ES.axaml: 98.15%
Missing Keys - Text.CommitDetail.Info.Children +- Text.Fetch.Force - Text.Preference.Appearance.FontSize - Text.Preference.Appearance.FontSize.Default - Text.Preference.Appearance.FontSize.Editor @@ -34,7 +36,7 @@
-### fr_FR.axaml: 97.72% +### fr_FR.axaml: 97.58%
@@ -43,6 +45,7 @@ - Text.CherryPick.AppendSourceToMessage - Text.CherryPick.Mainline.Tips - Text.CommitCM.CherryPickMultiple +- Text.Fetch.Force - Text.Preference.Appearance.FontSize - Text.Preference.Appearance.FontSize.Default - Text.Preference.Appearance.FontSize.Editor @@ -59,25 +62,27 @@
-### pt_BR.axaml: 99.57% +### pt_BR.axaml: 99.43%
Missing Keys - Text.CommitDetail.Info.Children +- Text.Fetch.Force - Text.Preference.General.ShowChildren - Text.Repository.FilterCommits
-### ru_RU.axaml: 99.14% +### ru_RU.axaml: 99.00%
Missing Keys - Text.CommitDetail.Info.Children +- Text.Fetch.Force - Text.Preference.General.ShowChildren - Text.Repository.FilterCommits - Text.Repository.HistoriesOrder From c50508d4ac117a62c3596219ed88cfd857ed5096 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 22 Nov 2024 10:42:39 +0800 Subject: [PATCH 0257/1283] fix: try to fix the issue that the branch tree did not update after deleting multiple branches (#729) Signed-off-by: leo --- src/ViewModels/DeleteMultipleBranches.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ViewModels/DeleteMultipleBranches.cs b/src/ViewModels/DeleteMultipleBranches.cs index 6048ec68..87bb3122 100644 --- a/src/ViewModels/DeleteMultipleBranches.cs +++ b/src/ViewModels/DeleteMultipleBranches.cs @@ -42,7 +42,12 @@ namespace SourceGit.ViewModels } } - CallUIThread(() => _repo.SetWatcherEnabled(true)); + CallUIThread(() => + { + _repo.MarkBranchesDirtyManually(); + _repo.SetWatcherEnabled(true); + }); + return true; }); } From c78e2e59d91d5b4322b0b9c03dc698735cb5e775 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 22 Nov 2024 18:40:59 +0800 Subject: [PATCH 0258/1283] enhance: `git format-patch` * use `--output=` instead of `-o ` to avoid failure because the directory cannot be created * make generated patches in order when format multiple commits Signed-off-by: leo --- src/Commands/FormatPatch.cs | 2 +- src/ViewModels/Histories.cs | 50 +++++++++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/Commands/FormatPatch.cs b/src/Commands/FormatPatch.cs index 2c7359c0..b3ec2e4a 100644 --- a/src/Commands/FormatPatch.cs +++ b/src/Commands/FormatPatch.cs @@ -6,7 +6,7 @@ { WorkingDirectory = repo; Context = repo; - Args = $"format-patch {commit} -1 -o \"{saveTo}\""; + Args = $"format-patch {commit} -1 --output=\"{saveTo}\""; } } } diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 2bbe83bb..f77fc87b 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -239,16 +239,16 @@ namespace SourceGit.ViewModels } } + // Sort selected commits in order. + selected.Sort((l, r) => + { + return _commits.IndexOf(r) - _commits.IndexOf(l); + }); + var multipleMenu = new ContextMenu(); if (canCherryPick) { - // Sort selected commits in order. - selected.Sort((l, r) => - { - return _commits.IndexOf(r) - _commits.IndexOf(l); - }); - var cherryPickMultiple = new MenuItem(); cherryPickMultiple.Header = App.Text("CommitCM.CherryPickMultiple"); cherryPickMultiple.Icon = App.CreateMenuIcon("Icons.CherryPick"); @@ -277,11 +277,11 @@ namespace SourceGit.ViewModels var picker = await storageProvider.OpenFolderPickerAsync(options); if (picker.Count == 1) { - var saveTo = $"{picker[0].Path.LocalPath}/patches"; var succ = false; - foreach (var c in selected) + for (var i = 0; i < selected.Count; i++) { - succ = await Task.Run(() => new Commands.FormatPatch(_repo.FullPath, c.SHA, saveTo).Exec()); + var saveTo = GetPatchFileName(picker[0].Path.LocalPath, selected[i], i); + succ = await Task.Run(() => new Commands.FormatPatch(_repo.FullPath, selected[i].SHA, saveTo).Exec()); if (!succ) break; } @@ -621,7 +621,8 @@ namespace SourceGit.ViewModels var selected = await storageProvider.OpenFolderPickerAsync(options); if (selected.Count == 1) { - var succ = new Commands.FormatPatch(_repo.FullPath, commit.SHA, selected[0].Path.LocalPath).Exec(); + var saveTo = GetPatchFileName(selected[0].Path.LocalPath, commit); + var succ = new Commands.FormatPatch(_repo.FullPath, commit.SHA, saveTo).Exec(); if (succ) App.SendNotification(_repo.FullPath, App.Text("SaveAsPatchSuccess")); } @@ -1053,6 +1054,35 @@ namespace SourceGit.ViewModels menu.Items.Add(submenu); } + private string GetPatchFileName(string dir, Models.Commit commit, int index = 0) + { + var ignore_chars = new HashSet { '/', '\\', ':', ',', '*', '?', '\"', '<', '>', '|', '`', '$', '^', '%', '[', ']', '+', '-' }; + var builder = new StringBuilder(); + builder.Append(index.ToString("D4")); + builder.Append('-'); + + var chars = commit.Subject.ToCharArray(); + var len = 0; + foreach (var c in chars) + { + if (!ignore_chars.Contains(c)) + { + if (c == ' ' || c == '\t') + builder.Append('-'); + else + builder.Append(c); + + len++; + + if (len >= 48) + break; + } + } + builder.Append(".patch"); + + return System.IO.Path.Combine(dir, builder.ToString()); + } + private Repository _repo = null; private bool _isLoading = true; private List _commits = new List(); From 3ae3c587d8bc387a6fb5e755d8c61efdefc71131 Mon Sep 17 00:00:00 2001 From: Martin Garstenauer Date: Fri, 22 Nov 2024 11:43:45 +0100 Subject: [PATCH 0259/1283] fix: typo in English (#731) --- src/Resources/Locales/en_US.axaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 0a0af997..23c43692 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -168,8 +168,8 @@ Result URL: Please use $1, $2 to access regex groups values. AI - Prefered Service: - If the 'Prefered Service' is set, SourceGit will only use it in this repository. Otherwise, if there is more than one service available, a context menu to choose one of them will be shown. + Preferred Service: + If the 'Preferred Service' is set, SourceGit will only use it in this repository. Otherwise, if there is more than one service available, a context menu to choose one of them will be shown. HTTP Proxy HTTP proxy used by this repository User Name @@ -452,7 +452,7 @@ Check for updates on startup Language History Commits - Show author time intead of commit time in graph + Show author time instead of commit time in graph Show children in the comment details Subject Guide Length GIT From cd96a2854520ed7e7807abe688427642f1e21fa2 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 22 Nov 2024 18:47:06 +0800 Subject: [PATCH 0260/1283] fix: typo in English (#731) Signed-off-by: leo --- src/Resources/Locales/de_DE.axaml | 4 ++-- src/Resources/Locales/en_US.axaml | 4 ++-- src/Resources/Locales/es_ES.axaml | 4 ++-- src/Resources/Locales/fr_FR.axaml | 4 ++-- src/Resources/Locales/pt_BR.axaml | 4 ++-- src/Resources/Locales/ru_RU.axaml | 4 ++-- src/Resources/Locales/zh_CN.axaml | 4 ++-- src/Resources/Locales/zh_TW.axaml | 4 ++-- src/Views/RepositoryConfigure.axaml | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 200d3638..3b722aa8 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -170,8 +170,8 @@ Ergebnis-URL: Verwende bitte $1, $2 um auf Regex-Gruppenwerte zuzugreifen. OPEN AI - Bevorzugter Service: - Der ausgewählte 'Bevorzugte Service' wird nur in diesem Repository gesetzt und verwendet. Wenn keiner gesetzt ist und mehrere Servies verfügbar sind wird ein Kontextmenü zur Auswahl angezeigt. + Bevorzugter Service: + Der ausgewählte 'Bevorzugte Service' wird nur in diesem Repository gesetzt und verwendet. Wenn keiner gesetzt ist und mehrere Servies verfügbar sind wird ein Kontextmenü zur Auswahl angezeigt. HTTP Proxy HTTP Proxy für dieses Repository Benutzername diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 23c43692..444007c2 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -168,8 +168,8 @@ Result URL: Please use $1, $2 to access regex groups values. AI - Preferred Service: - If the 'Preferred Service' is set, SourceGit will only use it in this repository. Otherwise, if there is more than one service available, a context menu to choose one of them will be shown. + Preferred Service: + If the 'Preferred Service' is set, SourceGit will only use it in this repository. Otherwise, if there is more than one service available, a context menu to choose one of them will be shown. HTTP Proxy HTTP proxy used by this repository User Name diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index f69fc934..06f295d3 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -172,8 +172,8 @@ URL Resultante: Por favor, use $1, $2 para acceder a los valores de los grupos regex. OPEN AI - Servicio Preferido: - Si el 'Servicio Preferido' está establecido, SourceGit sólo lo usará en este repositorio. De lo contrario, si hay más de un servicio disponible, se mostrará un menú de contexto para elegir uno. + Servicio Preferido: + Si el 'Servicio Preferido' está establecido, SourceGit sólo lo usará en este repositorio. De lo contrario, si hay más de un servicio disponible, se mostrará un menú de contexto para elegir uno. Proxy HTTP Proxy HTTP utilizado por este repositorio Nombre de Usuario diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 5a1a8e7b..ef416e0b 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -169,8 +169,8 @@ URL résultant: Veuillez utiliser $1, $2 pour accéder aux valeurs des groupes regex. IA - Service préféré: - Si le 'Service préféré' est défini, SourceGit l'utilisera seulement dans ce repository. Sinon, si plus d'un service est disponible, un menu contextuel permettant de choisir l'un d'eux sera affiché. + Service préféré: + Si le 'Service préféré' est défini, SourceGit l'utilisera seulement dans ce repository. Sinon, si plus d'un service est disponible, un menu contextuel permettant de choisir l'un d'eux sera affiché. Proxy HTTP Proxy HTTP utilisé par ce dépôt Nom d'utilisateur diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index 744fc0cc..428579bd 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -195,8 +195,8 @@ URL de Resultado: Por favor, use $1, $2 para acessar os valores de grupos do regex. IA - Serviço desejado: - Se o 'Serviço desejado' for definido, SourceGit usará ele neste Repositório. Senão, caso haja mais de um serviço disponível, será exibido um menu para seleção. + Serviço desejado: + Se o 'Serviço desejado' for definido, SourceGit usará ele neste Repositório. Senão, caso haja mais de um serviço disponível, será exibido um menu para seleção. Proxy HTTP Proxy HTTP usado por este repositório Nome de Usuário diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 3d03e850..123c921f 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -170,8 +170,8 @@ Адрес результата: Пожалуйста, используйте $1, $2 для доступа к значениям групп регулярных выражений. ОТКРЫТЬ ИИ - Предпочитаемый сервис: - Если «Предпочитаемый сервис» установлен, SourceGit будет использовать только этот хранилище. В противном случае, если доступно более одной услуги, будет отображено контекстное меню для выбора одной из них. + Предпочитаемый сервис: + Если «Предпочитаемый сервис» установлен, SourceGit будет использовать только этот хранилище. В противном случае, если доступно более одной услуги, будет отображено контекстное меню для выбора одной из них. HTTP-прокси HTTP-прокси, используемый этим хранилищем Имя пользователя diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 1b549c83..fe71caa7 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -171,8 +171,8 @@ 为ISSUE生成的URL链接 : 可在URL中使用$1,$2等变量填入正则表达式匹配的内容 AI - 启用特定服务 : - 当【启用特定服务】被设置时,SourceGit将在本仓库中仅使用该服务。否则将弹出可用的AI服务列表供用户选择。 + 启用特定服务 : + 当【启用特定服务】被设置时,SourceGit将在本仓库中仅使用该服务。否则将弹出可用的AI服务列表供用户选择。 HTTP代理 HTTP网络代理 用户名 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index f4ec03ad..f1ba12a6 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -171,8 +171,8 @@ 為 Issue 產生的網址連結: 可在網址中使用 $1、$2 等變數填入正規表達式相符的內容 AI - 偏好服務: - 設定 [偏好服務] 後,SourceGit 將於此存放庫中使用該服務,否則會顯示 AI 服務列表供使用者選擇。 + 偏好服務: + 設定 [偏好服務] 後,SourceGit 將於此存放庫中使用該服務,否則會顯示 AI 服務列表供使用者選擇。 HTTP 代理 HTTP 網路代理 使用者名稱 diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml index c596f9e7..10603319 100644 --- a/src/Views/RepositoryConfigure.axaml +++ b/src/Views/RepositoryConfigure.axaml @@ -458,7 +458,7 @@ + Text="{DynamicResource Text.Configure.OpenAI.Preferred}"/> From 546f6284705cd9c8551812476cc64612e257dd36 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Sun, 24 Nov 2024 01:32:47 +0000 Subject: [PATCH 0261/1283] fix: don't reverse commit order when cherry-picking (#736) Fixes #726. Looks like a980cc987d60c038e0ce92eee8fb972fb4737ac6 isn't sufficient. It sorts the commits according to the ordering in history, but then CherryPick ViewModel reverses the order. This commit changes CherryPick ViewModel to use string.Join on the commit list without reordering, so that the ordering is controlled entirely by the caller. --- src/ViewModels/CherryPick.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ViewModels/CherryPick.cs b/src/ViewModels/CherryPick.cs index dde43662..ea601d5a 100644 --- a/src/ViewModels/CherryPick.cs +++ b/src/ViewModels/CherryPick.cs @@ -85,13 +85,9 @@ namespace SourceGit.ViewModels } else { - var builder = new StringBuilder(); - for (int i = Targets.Count - 1; i >= 0; i--) - builder.Append($"{Targets[i].SHA} "); - succ = new Commands.CherryPick( _repo.FullPath, - builder.ToString(), + string.Join(' ', Targets.ConvertAll(c => c.SHA)), !AutoCommit, AppendSourceToMessage, string.Empty).Exec(); From e3d6ee0f40e693da7f77ef8a10d2b679ca776632 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Sun, 24 Nov 2024 02:15:17 +0000 Subject: [PATCH 0262/1283] fix: better https regex (#735) Fixes #733 --- src/Models/Remote.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Remote.cs b/src/Models/Remote.cs index a65fa345..2b88c3be 100644 --- a/src/Models/Remote.cs +++ b/src/Models/Remote.cs @@ -6,7 +6,7 @@ namespace SourceGit.Models { public partial class Remote { - [GeneratedRegex(@"^http[s]?://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/~%]+/[\w\-\.%]+(\.git)?$")] + [GeneratedRegex(@"^https?://([-a-zA-Z0-9:%._\+~#=]+@)?[-a-zA-Z0-9:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}(:[0-9]{1,5})?\b(/[-a-zA-Z0-9()@:%_\+.~#?&=]*)*(\.git)?$")] private static partial Regex REG_HTTPS(); [GeneratedRegex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-/~%]+/[\w\-\.%]+(\.git)?$")] private static partial Regex REG_SSH1(); From 693940368b256f0251a1cb2cb6f6b52a3b5fe4c0 Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 24 Nov 2024 10:20:40 +0800 Subject: [PATCH 0263/1283] code_style: remove unused variable Signed-off-by: leo --- src/ViewModels/Repository.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index a5d48648..92bfb288 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -834,7 +834,6 @@ namespace SourceGit.ViewModels if (_enableFirstParentInHistories) builder.Append("--first-parent "); - var invalidFilters = new List(); var filters = _settings.BuildHistoriesFilter(); if (string.IsNullOrEmpty(filters)) builder.Append("--branches --remotes --tags"); @@ -2129,7 +2128,7 @@ namespace SourceGit.ViewModels if (node.Path.Equals(path, StringComparison.Ordinal)) return node; - if (path.StartsWith(node.Path, StringComparison.Ordinal)) + if (path!.StartsWith(node.Path, StringComparison.Ordinal)) { var founded = FindBranchNode(node.Children, path); if (founded != null) From 12f75315bd9174233d8c7010a30769ba3f86cc22 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Sun, 24 Nov 2024 02:53:16 +0000 Subject: [PATCH 0264/1283] feat: context menu for a commit in commit message (#734) * feat: context menu for a commit in commit message When a commit message happens to contain a commit link and the user elects to right-click it, instead of navigating them to the commit, present a menu with options to navigate to it or to copy SHA. * feat: show commit tooltip as well `_lastHover` in the `if` is also swapped for `match`for consistency with the block body --- src/Resources/Locales/de_DE.axaml | 1 + src/Resources/Locales/en_US.axaml | 2 ++ src/Resources/Locales/es_ES.axaml | 1 + src/Resources/Locales/fr_FR.axaml | 1 + src/Resources/Locales/pt_BR.axaml | 1 + src/Resources/Locales/ru_RU.axaml | 2 ++ src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/Views/CommitMessagePresenter.cs | 43 +++++++++++++++++++++++++++-- 9 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 3b722aa8..6293e5f0 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -597,6 +597,7 @@ Diese Version überspringen Software Update Es sind momentan kein Updates verfügbar. + SHA kopieren Squash Commits In: SSH privater Schlüssel: diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 444007c2..8a0ee04e 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -601,6 +601,8 @@ Skip This Version Software Update There are currently no updates available. + Copy SHA + Go to Squash Commits Into: SSH Private Key: diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 06f295d3..563419be 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -592,6 +592,7 @@ Omitir Esta Versión Actualización de Software Actualmente no hay actualizaciones disponibles. + Copiar SHA Squash Commits En: Clave Privada SSH: diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index ef416e0b..a9a18be3 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -590,6 +590,7 @@ Passer cette version Mise à jour du logiciel Il n'y a pas de mise à jour pour le moment. + Copier le SHA Squash Commits Dans : SSH Private Key: diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index 428579bd..4d011b32 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -625,6 +625,7 @@ Ignorar esta versão Atualização de Software Não há atualizações disponíveis no momento. + Copiar SHA Squash Commits Squash commits em: Chave SSH Privada: diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 123c921f..5b908a17 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -592,6 +592,8 @@ Исправление успешно сохранено! Сканирование хранилищ Корневой каталог: + Копировать SHA + Перейти Проверка для обновления... Доступна новая версия этого программного обеспечения: Не удалось проверить наличие обновлений! diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index fe71caa7..5493434c 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -605,6 +605,7 @@ 忽略此版本 软件更新 当前已是最新版本。 + 复制提交指纹 压缩为单个提交 合并入: SSH密钥 : diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index f1ba12a6..de431e16 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -604,6 +604,7 @@ 忽略此版本 軟體更新 目前已是最新版本。 + 複製提交編號 壓縮為單個提交 合併入: SSH 金鑰: diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index 862ce9e1..c4da7e94 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -7,6 +7,7 @@ using Avalonia.Collections; using Avalonia.Controls; using Avalonia.Controls.Documents; using Avalonia.Input; +using Avalonia.Platform.Storage; using Avalonia.VisualTree; namespace SourceGit.Views @@ -149,11 +150,16 @@ namespace SourceGit.Views SetCurrentValue(CursorProperty, Cursor.Parse("Hand")); _lastHover = match; - if (!_lastHover.IsCommitSHA) + if (!match.IsCommitSHA) { ToolTip.SetTip(this, match.Link); ToolTip.SetIsOpen(this, true); } + else if (this.FindAncestorOfType() is { DataContext: ViewModels.CommitDetail detail } && detail.GetParent(match.Link) is Models.Commit c) + { + ToolTip.SetTip(this, c); + ToolTip.SetIsOpen(this, true); + } return; } @@ -172,7 +178,40 @@ namespace SourceGit.Views { var parentView = this.FindAncestorOfType(); if (parentView is { DataContext: ViewModels.CommitDetail detail }) - detail.NavigateTo(_lastHover.Link); + { + var point = e.GetCurrentPoint(this); + var link = _lastHover.Link; + + if (point.Properties.IsLeftButtonPressed) + { + detail.NavigateTo(_lastHover.Link); + } + else if (point.Properties.IsRightButtonPressed) + { + var open = new MenuItem(); + open.Header = App.Text("SHALinkCM.NavigateTo"); + open.Icon = App.CreateMenuIcon("Icons.Commit"); + open.Click += (_, ev) => + { + detail.NavigateTo(_lastHover.Link); + ev.Handled = true; + }; + + var copy = new MenuItem(); + copy.Header = App.Text("SHALinkCM.CopySHA"); + copy.Icon = App.CreateMenuIcon("Icons.Copy"); + copy.Click += (_, ev) => + { + App.CopyText(link); + ev.Handled = true; + }; + + var menu = new ContextMenu(); + menu.Items.Add(open); + menu.Items.Add(copy); + menu.Open(this); + } + } } else { From 53220f9a3658a16499dbde96388072642c3543c3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 24 Nov 2024 02:53:30 +0000 Subject: [PATCH 0265/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ffc15541..0d8e53e6 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.00%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.15%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.58%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.43%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.00%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.86%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.01%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.44%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.29%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.01%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.86%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.86%25-yellow)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 274f0341..5b9f456a 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 99.00% +### de_DE.axaml: 98.86%
@@ -11,10 +11,11 @@ - Text.Repository.HistoriesOrder - Text.Repository.HistoriesOrder.ByDate - Text.Repository.HistoriesOrder.Topo +- Text.SHALinkCM.NavigateTo
-### es_ES.axaml: 98.15% +### es_ES.axaml: 98.01%
@@ -33,10 +34,11 @@ - Text.Repository.HistoriesOrder - Text.Repository.HistoriesOrder.ByDate - Text.Repository.HistoriesOrder.Topo +- Text.SHALinkCM.NavigateTo
-### fr_FR.axaml: 97.58% +### fr_FR.axaml: 97.44%
@@ -59,10 +61,11 @@ - Text.Repository.HistoriesOrder.ByDate - Text.Repository.HistoriesOrder.Topo - Text.ScanRepositories +- Text.SHALinkCM.NavigateTo
-### pt_BR.axaml: 99.43% +### pt_BR.axaml: 99.29%
@@ -72,10 +75,11 @@ - Text.Fetch.Force - Text.Preference.General.ShowChildren - Text.Repository.FilterCommits +- Text.SHALinkCM.NavigateTo
-### ru_RU.axaml: 99.00% +### ru_RU.axaml: 99.01%
@@ -91,22 +95,22 @@
-### zh_CN.axaml: 100.00% +### zh_CN.axaml: 99.86%
Missing Keys - +- Text.SHALinkCM.NavigateTo
-### zh_TW.axaml: 100.00% +### zh_TW.axaml: 99.86%
Missing Keys - +- Text.SHALinkCM.NavigateTo
From 457a1e79c7cf53263ad96e7d660bc4ed8e5eb289 Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 24 Nov 2024 11:04:59 +0800 Subject: [PATCH 0266/1283] code_review: PR #734 * remove unnecessary namespace using * do NOT set tooltip currently, because CommitDetail.GetParent may cause UI lags and the tooltip DataTemplate is not provided. * add translations for zh_CN and zh_TW Signed-off-by: leo --- src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/Views/CommitMessagePresenter.cs | 8 +------- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 5493434c..a5af3400 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -606,6 +606,7 @@ 软件更新 当前已是最新版本。 复制提交指纹 + 跳转到提交 压缩为单个提交 合并入: SSH密钥 : diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index de431e16..3989259d 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -605,6 +605,7 @@ 軟體更新 目前已是最新版本。 複製提交編號 + 導覽到提交 壓縮為單個提交 合併入: SSH 金鑰: diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index c4da7e94..a022ae99 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -7,7 +7,6 @@ using Avalonia.Collections; using Avalonia.Controls; using Avalonia.Controls.Documents; using Avalonia.Input; -using Avalonia.Platform.Storage; using Avalonia.VisualTree; namespace SourceGit.Views @@ -115,7 +114,7 @@ namespace SourceGit.Views { base.OnPointerMoved(e); - if (e.Pointer.Captured == this) + if (Equals(e.Pointer.Captured, this)) { var relativeSelfY = e.GetPosition(this).Y; if (relativeSelfY <= 0 || relativeSelfY > Bounds.Height) @@ -155,11 +154,6 @@ namespace SourceGit.Views ToolTip.SetTip(this, match.Link); ToolTip.SetIsOpen(this, true); } - else if (this.FindAncestorOfType() is { DataContext: ViewModels.CommitDetail detail } && detail.GetParent(match.Link) is Models.Commit c) - { - ToolTip.SetTip(this, c); - ToolTip.SetIsOpen(this, true); - } return; } From f820c0ccacf993cc9d7ee29c293fa1e830205d02 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 24 Nov 2024 03:06:15 +0000 Subject: [PATCH 0267/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0d8e53e6..587f722e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.86%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.01%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.44%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.29%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.01%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-99.86%25-yellow)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-99.86%25-yellow)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.86%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.01%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.44%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.29%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.01%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 5b9f456a..76eff2ff 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -95,22 +95,22 @@
-### zh_CN.axaml: 99.86% +### zh_CN.axaml: 100.00%
Missing Keys -- Text.SHALinkCM.NavigateTo +
-### zh_TW.axaml: 99.86% +### zh_TW.axaml: 100.00%
Missing Keys -- Text.SHALinkCM.NavigateTo +
From 637f138d6393968efba176d1a74b5d9725e1a98c Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 24 Nov 2024 20:28:12 +0800 Subject: [PATCH 0268/1283] code_style: remove Rider warning Signed-off-by: leo --- src/Views/CommitBaseInfo.axaml | 2 +- src/Views/CommitBaseInfo.axaml.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index b58c3daf..fdccbf99 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -199,7 +199,7 @@ - Date: Sun, 24 Nov 2024 21:22:04 +0800 Subject: [PATCH 0269/1283] feature: add tooltip for SHA in commit message presenter (#734) Signed-off-by: leo --- src/Models/OpenAI.cs | 2 +- src/Views/CommitBaseInfo.axaml | 14 ++++++++ src/Views/CommitMessagePresenter.cs | 55 +++++++++++++++++++++++++++++ src/Views/TextDiffView.axaml.cs | 20 +++++------ 4 files changed, 80 insertions(+), 11 deletions(-) diff --git a/src/Models/OpenAI.cs b/src/Models/OpenAI.cs index 516a9423..df67ff66 100644 --- a/src/Models/OpenAI.cs +++ b/src/Models/OpenAI.cs @@ -175,7 +175,7 @@ namespace SourceGit.Models var body = reader.Result; if (!rsp.IsSuccessStatusCode) { - throw new Exception($"AI service returns error code {rsp.StatusCode}. Body: {body??string.Empty}"); + throw new Exception($"AI service returns error code {rsp.StatusCode}. Body: {body ?? string.Empty}"); } return JsonSerializer.Deserialize(reader.Result, JsonCodeGen.Default.OpenAIChatResponse); diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index fdccbf99..d850932c 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -211,6 +211,20 @@ + + + + + + + + + + + + + +
diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index a022ae99..59543af8 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -1,12 +1,14 @@ using System; using System.Collections.Generic; using System.Text.RegularExpressions; +using System.Threading.Tasks; using Avalonia; using Avalonia.Collections; using Avalonia.Controls; using Avalonia.Controls.Documents; using Avalonia.Input; +using Avalonia.Threading; using Avalonia.VisualTree; namespace SourceGit.Views @@ -43,7 +45,9 @@ namespace SourceGit.Views if (change.Property == MessageProperty || change.Property == IssueTrackerRulesProperty) { Inlines!.Clear(); + _inlineCommits.Clear(); _matches = null; + _lastHover = null; ClearHoveredIssueLink(); var message = Message; @@ -154,6 +158,10 @@ namespace SourceGit.Views ToolTip.SetTip(this, match.Link); ToolTip.SetIsOpen(this, true); } + else + { + ProcessHoverCommitLink(match); + } return; } @@ -256,6 +264,52 @@ namespace SourceGit.Views ClearHoveredIssueLink(); } + private void ProcessHoverCommitLink(Models.Hyperlink link) + { + var sha = link.Link; + + // If we have already queried this SHA, just use it. + if (_inlineCommits.TryGetValue(sha, out var exist)) + { + if (exist != null) + { + ToolTip.SetTip(this, exist); + ToolTip.SetIsOpen(this, true); + } + + return; + } + + var parentView = this.FindAncestorOfType(); + if (parentView is { DataContext: ViewModels.CommitDetail detail }) + { + // Record the SHA of current viewing commit in the CommitDetail panel to determine if it is changed after + // asynchronous queries. + var lastDetailCommit = detail.Commit.SHA; + Task.Run(() => + { + var c = detail.GetParent(sha); + Dispatcher.UIThread.Invoke(() => + { + // Make sure the DataContext of CommitBaseInfo is not changed. + var currentParent = this.FindAncestorOfType(); + if (currentParent is { DataContext: ViewModels.CommitDetail currentDetail } && + currentDetail.Commit.SHA == lastDetailCommit) + { + _inlineCommits.Add(sha, c); + + // Make sure user still hovers the target SHA. + if (_lastHover == link) + { + ToolTip.SetTip(this, c); + ToolTip.SetIsOpen(this, true); + } + } + }); + }); + } + } + private void ClearHoveredIssueLink() { if (_lastHover != null) @@ -268,5 +322,6 @@ namespace SourceGit.Views private List _matches = null; private Models.Hyperlink _lastHover = null; + private Dictionary _inlineCommits = new(); } } diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 544453f5..da2d9ed1 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -476,7 +476,7 @@ namespace SourceGit.Views get => GetValue(SelectedChunkProperty); set => SetValue(SelectedChunkProperty, value); } - + public static readonly StyledProperty DisplayRangeProperty = AvaloniaProperty.Register(nameof(DisplayRange), new TextDiffViewRange(0, 0)); @@ -523,7 +523,7 @@ namespace SourceGit.Views var firstLineIdx = DisplayRange.StartIdx; if (firstLineIdx <= 1) return; - + var lines = GetLines(); var firstLineType = lines[firstLineIdx].Type; var prevLineType = lines[firstLineIdx - 1].Type; @@ -761,7 +761,7 @@ namespace SourceGit.Views if (start > index) start = index; } - + SetCurrentValue(DisplayRangeProperty, new TextDiffViewRange(start, start + count)); } @@ -1313,9 +1313,9 @@ namespace SourceGit.Views private ScrollViewer _scrollViewer = null; } - + public class TextDiffViewMinimap : Control - { + { public static readonly StyledProperty AddedLineBrushProperty = AvaloniaProperty.Register(nameof(AddedLineBrush), new SolidColorBrush(Color.FromArgb(60, 0, 255, 0))); @@ -1333,7 +1333,7 @@ namespace SourceGit.Views get => GetValue(DeletedLineBrushProperty); set => SetValue(DeletedLineBrushProperty, value); } - + public static readonly StyledProperty DisplayRangeProperty = AvaloniaProperty.Register(nameof(DisplayRange), new TextDiffViewRange(0, 0)); @@ -1342,7 +1342,7 @@ namespace SourceGit.Views get => GetValue(DisplayRangeProperty); set => SetValue(DisplayRangeProperty, value); } - + public static readonly StyledProperty DisplayRangeColorProperty = AvaloniaProperty.Register(nameof(DisplayRangeColor), Colors.RoyalBlue); @@ -1376,7 +1376,7 @@ namespace SourceGit.Views total = diff.Lines.Count; RenderSingleSide(context, diff.Lines, 0, Bounds.Width); } - + var range = DisplayRange; if (range.EndIdx == 0) return; @@ -1416,7 +1416,7 @@ namespace SourceGit.Views lastLineTypeStart = i; } } - + RenderBlock(context, lastLineType, lastLineTypeStart, total - lastLineTypeStart, total, x, width); } @@ -1431,7 +1431,7 @@ namespace SourceGit.Views } } } - + public partial class TextDiffView : UserControl { public static readonly StyledProperty UseSideBySideDiffProperty = From 4160f8ab9c9de0a7798122a2bf40bfe4e674d91a Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 24 Nov 2024 21:43:31 +0800 Subject: [PATCH 0270/1283] fix: only set tooltip if commit exists Signed-off-by: leo --- src/Views/CommitMessagePresenter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index 59543af8..281cb38c 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -299,7 +299,7 @@ namespace SourceGit.Views _inlineCommits.Add(sha, c); // Make sure user still hovers the target SHA. - if (_lastHover == link) + if (_lastHover == link && c != null) { ToolTip.SetTip(this, c); ToolTip.SetIsOpen(this, true); From bf4080b77303d12ae0126e9a15dd190b441c372e Mon Sep 17 00:00:00 2001 From: Nils van Rijsinge Date: Mon, 25 Nov 2024 02:24:16 +0100 Subject: [PATCH 0271/1283] fix: crash on goto to SHA, NullReferenceException (#741) --- src/Views/CommitMessagePresenter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index 281cb38c..7ca823dc 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -195,7 +195,7 @@ namespace SourceGit.Views open.Icon = App.CreateMenuIcon("Icons.Commit"); open.Click += (_, ev) => { - detail.NavigateTo(_lastHover.Link); + detail.NavigateTo(link); ev.Handled = true; }; From 831462b5946871e9a7534fb6dac32056555c69da Mon Sep 17 00:00:00 2001 From: Nils van Rijsinge Date: Mon, 25 Nov 2024 02:28:09 +0100 Subject: [PATCH 0272/1283] Add missing de_DE keys (#737) * localization: add missing de_DE keys - CommitDetail.Info.Children, General.ShowChildren were added in cc5bb5f - Text.Fetch.Force was added in 153a1f3 - Repository.HistoriesOrder... were added in b25f9bd - SHALinkCM.NavigateTo was added in 12f7531 * localization: fix invalid XAML --- src/Resources/Locales/de_DE.axaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 6293e5f0..4714a652 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -128,6 +128,7 @@ INFORMATION AUTOR GEÄNDERT + NACHFOLGER COMMITTER Prüfe Refs, die diesen Commit enthalten COMMIT ENTHALTEN IN @@ -270,6 +271,7 @@ Fast-Forward (ohne Auschecken) Fetch Alle Remotes fetchen + Aktiviere '--force' Option Ohne Tags fetchen Remote: Remote-Änderungen fetchen @@ -454,6 +456,7 @@ Sprache Commit-Historie Zeige Autor Zeitpunkt anstatt Commit Zeitpunkt + Zeige Nachfolger in den Commit Details Längenvorgabe für Commit-Nachrichten GIT Aktiviere Auto-CRLF @@ -546,6 +549,9 @@ Aufheben Im Graph ausblenden Im Graph filtern + Sortierungsmodus wechseln + Commit Zeitpunkt (--date-order) + Topologie (--topo-order) LOKALE BRANCHES Zum HEAD wechseln Aktiviere '--first-parent' Option @@ -598,6 +604,7 @@ Software Update Es sind momentan kein Updates verfügbar. SHA kopieren + Zum Commit wechseln Squash Commits In: SSH privater Schlüssel: From 55e3bfa2d41a040faa2bdf61a1d4104f66f60fa9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Nov 2024 01:28:22 +0000 Subject: [PATCH 0273/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 587f722e..affe87e6 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.86%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.01%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.44%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.29%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.01%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.86%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.01%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.44%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.29%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.01%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 76eff2ff..719f5b65 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,17 +1,10 @@ -### de_DE.axaml: 98.86% +### de_DE.axaml: 99.86%
Missing Keys -- Text.CommitDetail.Info.Children -- Text.Fetch.Force -- Text.Preference.General.ShowChildren - Text.Repository.FilterCommits -- Text.Repository.HistoriesOrder -- Text.Repository.HistoriesOrder.ByDate -- Text.Repository.HistoriesOrder.Topo -- Text.SHALinkCM.NavigateTo
From 772f1a93b43ebd4964fc3885f486a4227841ffeb Mon Sep 17 00:00:00 2001 From: AquariusStar <48148723+AquariusStar@users.noreply.github.com> Date: Mon, 25 Nov 2024 04:28:36 +0300 Subject: [PATCH 0274/1283] localiztion: update (#738) --- src/Resources/Locales/ru_RU.axaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 5b908a17..a9de62e7 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -128,6 +128,7 @@ ИНФОРМАЦИЯ АВТОР ИЗМЕНЁННЫЙ + ДОЧЕРНИЙ ИСПОЛНИТЕЛЬ Проверить ссылки, содержащие эту фиксацию ФИКСАЦИЯ СОДЕРЖИТСЯ В @@ -271,6 +272,7 @@ Быстрая перемотка вперёд (без проверки) Извлечь Извлечь все внешние хранилища + Разрешить опцию '--force' Извлечь без меток Внешнее хранилище: Извлечь внешние изменения @@ -455,6 +457,7 @@ Язык История фиксаций Показывать время автора вместо времени фиксации на графике + Показать наследника в деталях комментария Длина темы фиксации GIT Включить автозавершение CRLF @@ -544,10 +547,14 @@ Разрешить опцию --reflog Открыть в файловом менеджере Поиск веток, меток и подмодулей + Видимость на графике Не установлен (По-умолчанию) Скрыть в графе фиксации Фильтр в графе фиксации ОТФИЛЬТРОВАНО: + Переключить режим запроса + Дата фиксации (--date-order) + Топологически (--topo-order) ЛОКАЛЬНЫЕ ВЕТКИ Навигация по заголовку Включить опцию --first-parent From d0f9e994bbbe8ba89efdacb9b43c68a11ef25c70 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Nov 2024 01:28:48 +0000 Subject: [PATCH 0275/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index affe87e6..45d6bbf5 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.86%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.01%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.44%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.29%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.01%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.86%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.01%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.44%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.29%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index 719f5b65..03b26e1b 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -72,19 +72,13 @@
-### ru_RU.axaml: 99.01% +### ru_RU.axaml: 100.00%
Missing Keys -- Text.CommitDetail.Info.Children -- Text.Fetch.Force -- Text.Preference.General.ShowChildren -- Text.Repository.FilterCommits -- Text.Repository.HistoriesOrder -- Text.Repository.HistoriesOrder.ByDate -- Text.Repository.HistoriesOrder.Topo +
From 57d4842435ef1a332326de674fbafa887f970af7 Mon Sep 17 00:00:00 2001 From: Chiahong <36815907+ChiahongHong@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:28:55 +0800 Subject: [PATCH 0276/1283] localization: update zh_TW.axaml (#739) --- src/Resources/Locales/zh_TW.axaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 3989259d..bf8b32e1 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -241,7 +241,7 @@ 下一個差異 沒有變更或僅有換行字元差異 上一個差異 - 另存為修補檔 + 另存為修補檔 (patch) 顯示隱藏符號 並排對比 子模組 @@ -367,12 +367,12 @@ 提交暫存區變更 提交暫存區變更並推送 自動暫存全部變更並提交 - 根據選取的提交建立新的分支 + 基於選取的提交建立新分支 捨棄選取的變更 提取 (fetch) 遠端的變更 切換左邊欄為分支/標籤等顯示模式 (預設) 拉取 (pull) 遠端的變更 - 推送 (push) 本地變更到遠端存放庫 + 推送 (push) 本機變更到遠端存放庫 強制重新載入存放庫 暫存或取消暫存選取的變更 切換左邊欄為歷史搜尋模式 @@ -396,8 +396,8 @@ 互動式重定基底 目標分支: 起始提交: - 在瀏覽器中存取網址 - 複製網址 + 在瀏覽器中開啟連結 + 複製連結 發生錯誤 系統提示 合併分支 @@ -456,7 +456,7 @@ 顯示語言 最大歷史提交數 在提交路線圖中顯示修改時間而非提交時間 - 在提交詳細面板中顯示後續提交 + 在提交詳細資訊中顯示後續提交 提交標題字數偵測 Git 設定 自動換行轉換 @@ -546,13 +546,13 @@ 啟用 [--reflog] 選項 在檔案瀏覽器中開啟 快速搜尋分支/標籤/子模組 - 設定在列表中的可視性 - 不指定 - 在提交清單中隱藏 - 使用其來篩選提交清單 + 篩選以顯示或隱藏 + 取消指定 + 在提交列表中隱藏 + 以其篩選提交列表 切換排序方式 - 按提交时间排序 (--date-order) - 按拓扑排序 (--topo-order) + 依提交時間排序 (--date-order) + 依拓撲排序 (--topo-order) 本機分支 回到 HEAD 啟用 [--first-parent] 選項 @@ -605,7 +605,7 @@ 軟體更新 目前已是最新版本。 複製提交編號 - 導覽到提交 + 前往此提交 壓縮為單個提交 合併入: SSH 金鑰: From 12deb1d2c399a3664b35afc23f480d894f1aaad4 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 25 Nov 2024 09:37:02 +0800 Subject: [PATCH 0277/1283] version: Release 8.40 Signed-off-by: leo --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index fb6559a3..081fd762 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.39 \ No newline at end of file +8.40 \ No newline at end of file From 78fcc0117e6ef661289ee368425ad39a5ac1e198 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 25 Nov 2024 11:42:48 +0800 Subject: [PATCH 0278/1283] ux: style for tooltip Signed-off-by: leo --- src/Resources/Styles.axaml | 1 + src/Views/CommitBaseInfo.axaml | 26 +------------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index 82970549..fd4cac0c 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -164,6 +164,7 @@ - - @@ -119,12 +113,6 @@ Margin="0,0,16,0" PointerEntered="OnSHAPointerEntered" PointerPressed="OnSHAPressed"> - - - - @@ -162,12 +150,6 @@ Margin="0,0,16,0" PointerEntered="OnSHAPointerEntered" PointerPressed="OnSHAPressed"> - - - - @@ -205,13 +187,7 @@ Message="{Binding #ThisControl.Message}" IssueTrackerRules="{Binding #ThisControl.IssueTrackerRules}" HorizontalAlignment="Stretch" - TextWrapping="Wrap"> - - - - + TextWrapping="Wrap"> From a1c48dd11b00832c99590558d6c9c19306d3e5d1 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 26 Nov 2024 14:39:58 +0800 Subject: [PATCH 0279/1283] project: upgrade AvaloniaUI to 11.2.2 --- src/SourceGit.csproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SourceGit.csproj b/src/SourceGit.csproj index a5a97df9..32f68d03 100644 --- a/src/SourceGit.csproj +++ b/src/SourceGit.csproj @@ -37,11 +37,11 @@ - - - - - + + + + + From bb41fcea3eaa071ef2d1d23b55b73ccda68235e0 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 26 Nov 2024 19:52:13 +0800 Subject: [PATCH 0280/1283] fix: `DisplayRange` is not updated when text diff view is opened for the first time --- src/Views/TextDiffView.axaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index da2d9ed1..ea70ac93 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -619,6 +619,7 @@ namespace SourceGit.Views TextArea.TextView.VisualLinesChanged += OnTextViewVisualLinesChanged; UpdateTextMate(); + OnTextViewVisualLinesChanged(null, null); } protected override void OnUnloaded(RoutedEventArgs e) From 4fc32b2b59f414d508941a01777b6b74a733115e Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Nov 2024 09:17:18 +0800 Subject: [PATCH 0281/1283] fix: crash due to font family name is an empty space (#745) --- src/ViewModels/Preference.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index 70f0041f..1ccee4cd 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -65,7 +65,8 @@ namespace SourceGit.ViewModels get => _defaultFontFamily; set { - if (SetProperty(ref _defaultFontFamily, value) && !_isLoading) + var trimmed = value.Trim(); + if (SetProperty(ref _defaultFontFamily, trimmed) && !_isLoading) App.SetFonts(_defaultFontFamily, _monospaceFontFamily, _onlyUseMonoFontInEditor); } } @@ -75,7 +76,8 @@ namespace SourceGit.ViewModels get => _monospaceFontFamily; set { - if (SetProperty(ref _monospaceFontFamily, value) && !_isLoading) + var trimmed = value.Trim(); + if (SetProperty(ref _monospaceFontFamily, trimmed) && !_isLoading) App.SetFonts(_defaultFontFamily, _monospaceFontFamily, _onlyUseMonoFontInEditor); } } From cb9110baef8cd7efb96a3ab262ff4608a4188035 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Nov 2024 10:02:26 +0800 Subject: [PATCH 0282/1283] ux: new style for repository sub-view switcher --- src/Resources/Locales/en_US.axaml | 6 +++--- src/Views/Repository.axaml | 34 +++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 8a0ee04e..e814d671 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -341,7 +341,7 @@ Remote: Track files named '{0}' Track all *{0} files - Histories + HISTORY Switch Horizontal/Vertical Layout AUTHOR AUTHOR TIME @@ -621,7 +621,7 @@ Pop Drop Stash Drop: - Stashes + STASHES CHANGES STASHES Statistics @@ -668,7 +668,7 @@ Rescan Repositories in Default Clone Dir Search Repositories... Sort - Changes + LOCAL CHANGES Git Ignore Ignore all *{0} files Ignore *{0} files in the same folder diff --git a/src/Views/Repository.axaml b/src/Views/Repository.axaml index 079af6ab..1f5c0706 100644 --- a/src/Views/Repository.axaml +++ b/src/Views/Repository.axaml @@ -42,6 +42,16 @@ + + + + @@ -67,9 +83,9 @@ - - - + + + - - - + + + - - - + + + Date: Wed, 27 Nov 2024 10:08:20 +0800 Subject: [PATCH 0283/1283] ux: change `Height` of repository search bar --- src/Views/Repository.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/Repository.axaml b/src/Views/Repository.axaml index 1f5c0706..a0e83046 100644 --- a/src/Views/Repository.axaml +++ b/src/Views/Repository.axaml @@ -152,7 +152,7 @@ Date: Wed, 27 Nov 2024 11:10:44 +0800 Subject: [PATCH 0284/1283] ux: new style for ToggleButton.toggle_untracked --- src/Resources/Styles.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index fd4cac0c..6ea2af10 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -1182,7 +1182,7 @@ From d38d1b11e8e330c23d9f28d35753d2d5dd10260f Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Nov 2024 15:27:57 +0800 Subject: [PATCH 0285/1283] fix: typo in `Text.Preference.General.ShowChildren` --- src/Resources/Locales/en_US.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index e814d671..fd42b0f5 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -453,7 +453,7 @@ Language History Commits Show author time instead of commit time in graph - Show children in the comment details + Show children in the commit details Subject Guide Length GIT Enable Auto CRLF From 1c0d8a26972d9b70f53fc0b4e02d4a4e13b6d51c Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Nov 2024 17:06:44 +0800 Subject: [PATCH 0286/1283] fix: `git rev-list` do not support `--decorate-refs-exclude` (#746) Do not use histories filters to query commit children --- src/Commands/QueryCommitChildren.cs | 6 ++---- src/ViewModels/CommitDetail.cs | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs index 293de912..bef09abb 100644 --- a/src/Commands/QueryCommitChildren.cs +++ b/src/Commands/QueryCommitChildren.cs @@ -4,14 +4,12 @@ namespace SourceGit.Commands { public class QueryCommitChildren : Command { - public QueryCommitChildren(string repo, string commit, int max, string filters) + public QueryCommitChildren(string repo, string commit, int max) { WorkingDirectory = repo; Context = repo; _commit = commit; - if (string.IsNullOrEmpty(filters)) - filters = "--branches --remotes --tags"; - Args = $"rev-list -{max} --parents {filters} ^{commit}"; + Args = $"rev-list -{max} --parents --branches --remotes ^{commit}"; } public IEnumerable Result() diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 05b60e2f..f14b0359 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -576,8 +576,7 @@ namespace SourceGit.ViewModels Task.Run(() => { var max = Preference.Instance.MaxHistoryCommits; - var filter = _repo.Settings.BuildHistoriesFilter(); - var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, max, filter) { Cancel = _cancelToken }; + var cmdChildren = new Commands.QueryCommitChildren(_repo.FullPath, _commit.SHA, max) { Cancel = _cancelToken }; var children = cmdChildren.Result(); if (!cmdChildren.Cancel.Requested) Dispatcher.UIThread.Post(() => Children.AddRange(children)); From 1872148d985515f3bd50938aacffec47cd2688ae Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 27 Nov 2024 18:31:50 +0800 Subject: [PATCH 0287/1283] fix: the way to deal with local changes did not update after radio toggle changed (#748) --- src/Views/Checkout.axaml | 15 +++++------ src/Views/Checkout.axaml.cs | 47 +++++++++++++++++++++++++++++++++ src/Views/CreateBranch.axaml | 13 +++++---- src/Views/CreateBranch.axaml.cs | 47 +++++++++++++++++++++++++++++++++ src/Views/Pull.axaml | 13 +++++---- src/Views/Pull.axaml.cs | 47 +++++++++++++++++++++++++++++++++ 6 files changed, 160 insertions(+), 22 deletions(-) diff --git a/src/Views/Checkout.axaml b/src/Views/Checkout.axaml index eaf2e79e..eb1c9de0 100644 --- a/src/Views/Checkout.axaml +++ b/src/Views/Checkout.axaml @@ -32,22 +32,21 @@ HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,8,0" Text="{DynamicResource Text.Checkout.LocalChanges}"/> - - - - - + + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> diff --git a/src/Views/Checkout.axaml.cs b/src/Views/Checkout.axaml.cs index f8398a1d..da6e6b31 100644 --- a/src/Views/Checkout.axaml.cs +++ b/src/Views/Checkout.axaml.cs @@ -1,4 +1,5 @@ using Avalonia.Controls; +using Avalonia.Interactivity; namespace SourceGit.Views { @@ -8,5 +9,51 @@ namespace SourceGit.Views { InitializeComponent(); } + + protected override void OnLoaded(RoutedEventArgs e) + { + base.OnLoaded(e); + + var vm = DataContext as ViewModels.Checkout; + if (vm == null) + return; + + switch (vm.PreAction) + { + case Models.DealWithLocalChanges.DoNothing: + RadioDoNothing.IsChecked = true; + break; + case Models.DealWithLocalChanges.StashAndReaply: + RadioStashAndReply.IsChecked = true; + break; + default: + RadioDiscard.IsChecked = true; + break; + } + } + + private void OnLocalChangeActionIsCheckedChanged(object sender, RoutedEventArgs e) + { + var vm = DataContext as ViewModels.Checkout; + if (vm == null) + return; + + if (RadioDoNothing.IsChecked == true) + { + if (vm.PreAction != Models.DealWithLocalChanges.DoNothing) + vm.PreAction = Models.DealWithLocalChanges.DoNothing; + return; + } + + if (RadioStashAndReply.IsChecked == true) + { + if (vm.PreAction != Models.DealWithLocalChanges.StashAndReaply) + vm.PreAction = Models.DealWithLocalChanges.StashAndReaply; + return; + } + + if (vm.PreAction != Models.DealWithLocalChanges.Discard) + vm.PreAction = Models.DealWithLocalChanges.Discard; + } } } diff --git a/src/Views/CreateBranch.axaml b/src/Views/CreateBranch.axaml index 3516c317..caea0be4 100644 --- a/src/Views/CreateBranch.axaml +++ b/src/Views/CreateBranch.axaml @@ -69,21 +69,20 @@ Margin="0,0,8,0" Text="{DynamicResource Text.CreateBranch.LocalChanges}"/> - - - - + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> - - - - + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> Date: Wed, 27 Nov 2024 20:21:01 +0800 Subject: [PATCH 0288/1283] enhance: clear unhandled key modifer before running command (#748) --- src/Views/Launcher.axaml.cs | 5 +++++ src/Views/RepositoryToolbar.axaml.cs | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index 29d90e09..4137579d 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -72,6 +72,11 @@ namespace SourceGit.Views return _unhandledModifiers.HasFlag(modifier); } + public void ClearKeyModifier() + { + _unhandledModifiers = KeyModifiers.None; + } + protected override void OnOpened(EventArgs e) { base.OnOpened(e); diff --git a/src/Views/RepositoryToolbar.axaml.cs b/src/Views/RepositoryToolbar.axaml.cs index afc8ac5a..1d9d634b 100644 --- a/src/Views/RepositoryToolbar.axaml.cs +++ b/src/Views/RepositoryToolbar.axaml.cs @@ -53,6 +53,7 @@ namespace SourceGit.Views if (!startDirectly && OperatingSystem.IsMacOS()) startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); + launcher.ClearKeyModifier(); repo.Fetch(startDirectly); e.Handled = true; } @@ -67,6 +68,7 @@ namespace SourceGit.Views if (!startDirectly && OperatingSystem.IsMacOS()) startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); + launcher.ClearKeyModifier(); repo.Pull(startDirectly); e.Handled = true; } @@ -81,6 +83,7 @@ namespace SourceGit.Views if (!startDirectly && OperatingSystem.IsMacOS()) startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); + launcher.ClearKeyModifier(); repo.Push(startDirectly); e.Handled = true; } @@ -89,8 +92,16 @@ namespace SourceGit.Views private void StashAll(object _, RoutedEventArgs e) { var launcher = this.FindAncestorOfType(); - (DataContext as ViewModels.Repository)?.StashAll(launcher?.HasKeyModifier(KeyModifiers.Control) ?? false); - e.Handled = true; + if (launcher is not null && DataContext is ViewModels.Repository repo) + { + var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); + if (!startDirectly && OperatingSystem.IsMacOS()) + startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); + + launcher.ClearKeyModifier(); + repo.StashAll(startDirectly); + e.Handled = true; + } } private void OpenGitFlowMenu(object sender, RoutedEventArgs e) From e66179aeb88060e04c6481395a8497efc5014981 Mon Sep 17 00:00:00 2001 From: Efrem Ropelato Date: Thu, 28 Nov 2024 02:44:59 +0100 Subject: [PATCH 0289/1283] Italian translation (#759) --- TRANSLATION.md | 9 + src/App.axaml | 1 + src/Models/Locales.cs | 1 + src/Resources/Locales/it_IT.axaml | 696 ++++++++++++++++++++++++++++++ 4 files changed, 707 insertions(+) create mode 100644 src/Resources/Locales/it_IT.axaml diff --git a/TRANSLATION.md b/TRANSLATION.md index 03b26e1b..af8f4938 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -56,6 +56,15 @@ - Text.ScanRepositories - Text.SHALinkCM.NavigateTo + + +### it_IT.axaml: 100.0% + + +
+Missing Keys + +
### pt_BR.axaml: 99.29% diff --git a/src/App.axaml b/src/App.axaml index fc55776e..0f40031d 100644 --- a/src/App.axaml +++ b/src/App.axaml @@ -14,6 +14,7 @@ + diff --git a/src/Models/Locales.cs b/src/Models/Locales.cs index 9d24f491..e30977bf 100644 --- a/src/Models/Locales.cs +++ b/src/Models/Locales.cs @@ -12,6 +12,7 @@ namespace SourceGit.Models new Locale("English", "en_US"), new Locale("Español", "es_ES"), new Locale("Français", "fr_FR"), + new Locale("Italiano", "it_IT"), new Locale("Português (Brasil)", "pt_BR"), new Locale("Русский", "ru_RU"), new Locale("简体中文", "zh_CN"), diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml new file mode 100644 index 00000000..432daa08 --- /dev/null +++ b/src/Resources/Locales/it_IT.axaml @@ -0,0 +1,696 @@ + + Informazioni + Informazioni su SourceGit + • Creato con + • Il grafico è reso da + © 2024 sourcegit-scm + • Editor di testo da + • I font monospaziati provengono da + • Il codice sorgente è disponibile su + Client GUI Git open source e gratuito + Aggiungi Worktree + Cosa fare il checkout: + Branch esistente + Crea nuovo branch + Posizione: + Percorso per questo worktree. Supportato il percorso relativo. + Nome Branch: + Facoltativo. Predefinito è il nome della cartella di destinazione. + Traccia Branch: + Traccia branch remoto + Assistente AI + Usa AI per generare il messaggio di commit + Applica + Errore + Genera errori e si rifiuta di applicare la patch + Tutti gli errori + Simile a 'errore', ma mostra di più + File Patch: + Seleziona file .patch da applicare + Ignora modifiche agli spazi + Nessun avviso + Disattiva l'avviso sugli spazi finali + Applica Patch + Avviso + Mostra avvisi per alcuni errori, ma applica comunque + Spazi: + Archivia... + Salva Archivio In: + Seleziona il percorso del file archivio + Revisione: + Archivia + Richiedi Password SourceGit + FILE ASSUNTI COME INVARIATI + NESSUN FILE ASSUNTO COME INVARIATO + RIMUOVI + FILE BINARIO NON SUPPORTATO!!! + Attribuisci + L'ATTRIBUZIONE SU QUESTO FILE NON È SUPPORTATA!!! + Checkout ${0}$... + Confronta con Branch + Confronta con HEAD + Confronta con Worktree + Copia Nome Branch + Elimina ${0}$... + Elimina i {0} branch selezionati + Scarta tutte le modifiche + Avanzamento Veloce a ${0}$ + Recupera ${0}$ in ${1}$... + Git Flow - Completa ${0}$ + Unisci ${0}$ in ${1}$... + Recupera ${0}$ + Recupera ${0}$ in ${1}$... + Invia ${0}$ + Riallinea ${0}$ su ${1}$... + Rinomina ${0}$... + Imposta Branch di Tracciamento + Rimuovi Tracciamento + Confronto Branch + Byte + ANNULLA + Ripristina Questa Revisione + Ripristina la Revisione Padre + Genera messaggio di commit + CAMBIA MODALITÀ DI VISUALIZZAZIONE + Mostra come elenco di file e directory + Mostra come elenco di percorsi + Mostra come albero del filesystem + Checkout Branch + Checkout Commit + Avviso: Effettuando un checkout del commit, la tua HEAD sarà separata + Commit: + Branch: + Modifiche Locali: + Scarta + Non fare nulla + Stash e Ripristina + Cherry Pick + Aggiungi sorgente al messaggio di commit + Commit(s): + Conferma tutte le modifiche + Mainline: + Di solito non è possibile cherry-pick su una fusione perché non si sa quale lato della fusione deve essere considerato il mainline. Questa opzione consente di riprodurre la modifica relativa al genitore specificato. + Cancella Stash + Stai per cancellare tutti gli stash. Sei sicuro di voler continuare? + Clona Repository Remoto + Parametri Extra: + Argomenti addizionali per clonare il repository. Facoltativo. + Nome Locale: + Nome del repository. Facoltativo. + Cartella Principale: + URL del Repository: + CHIUDI + Editor + Cherry-Pick Questo Commit + Cherry-Pick... + Checkout Commit + Confronta con HEAD + Confronta con Worktree + Copia Info + Copia SHA + Azione Personalizzata + Rebase Interattivo ${0}$ fino a Qui + Riallinea ${0}$ fino a Qui + Ripristina ${0}$ fino a Qui + Annulla Commit + Modifica + Salva come Patch... + Unisci al Genitore + Unisci Commit Figli fino a Qui + MODIFICHE + Cerca Modifiche... + FILE + File LFS + Sottomodulo + INFORMAZIONI + AUTORE + MODIFICATO + CHI HA COMMITTATO + Controlla i riferimenti che contengono questo commit + IL COMMIT È CONTENUTO DA + Mostra solo le prime 100 modifiche. Vedi tutte le modifiche nella scheda MODIFICHE. + MESSAGGIO + GENITORI + RIFERIMENTI + SHA + Apri nel Browser + Inserisci l'oggetto del commit + Descrizione + Configura Repository + TEMPLATE DI COMMIT + Nome Template: + Contenuto Template: + AZIONE PERSONALIZZATA + Argomenti: + ${REPO} - Percorso del repository; ${SHA} - SHA del commit selezionato + File Eseguibile: + Nome: + Ambito: + Commit + Repository + Indirizzo Email + Indirizzo email + GIT + Recupera automaticamente i remoti + Minuto/i + Remoto Predefinito + Abilita --prune durante il fetch + Abilita --signoff per i commit + TRACCIAMENTO ISSUE + Aggiungi Regola Esempio per GitHub + Aggiungi Regola Esempio per Jira + Aggiungi Regola Esempio per Issue GitLab + Aggiungi Regola Esempio per Merge Request GitLab + Nuova Regola + Espressione Regex Issue: + Nome Regola: + URL Risultato: + Utilizza $1, $2 per accedere ai valori dei gruppi regex. + AI + Servizio Preferito: + Se il 'Servizio Preferito' è impostato, SourceGit utilizzerà solo quello per questo repository. In caso contrario, se sono disponibili più servizi, verrà mostrato un menu contestuale per sceglierne uno. + Proxy HTTP + Proxy HTTP usato da questo repository + Nome Utente + Nome utente per questo repository + Spazi di Lavoro + Colore + Ripristina schede all'avvio + Guida Commit Convenzionali + Modifica Sostanziale: + Issue Chiusa: + Dettaglio Modifiche: + Ambito: + Descrizione Breve: + Tipo di Modifica: + Copia + Copia Tutto il Testo + Copia Percorso + Copia Nome File + Crea Branch... + Basato Su: + Checkout del Branch Creato + Modifiche Locali: + Scarta + Non Fare Nulla + Stash e Ripristina + Nome Nuovo Branch: + Inserisci il nome del branch. + Crea Branch Locale + Crea Tag... + Nuovo Tag Su: + Firma con GPG + Messaggio Tag: + Facoltativo. + Nome Tag: + Formato consigliato: v1.0.0-alpha + Invia a tutti i remoti dopo la creazione + Crea Nuovo Tag + Tipo: + annotato + leggero + Tieni premuto Ctrl per avviare direttamente + Taglia + Elimina Branch + Branch: + Stai per eliminare un branch remoto!!! + Elimina anche il branch remoto ${0}$ + Elimina Branch Multipli + Stai per eliminare più branch contemporaneamente. Controlla attentamente prima di procedere! + Elimina Remoto + Remoto: + Destinazione: + Conferma Eliminazione Gruppo + Conferma Eliminazione Repository + Elimina Sottomodulo + Percorso Sottomodulo: + Elimina Tag + Tag: + Elimina dai repository remoti + DIFF BINARIO + NUOVO + VECCHIO + Copia + Modalità File Modificata + Ignora Modifiche agli Spazi + MODIFICA OGGETTO LFS + Differenza Successiva + NESSUNA MODIFICA O SOLO CAMBIAMENTI DI FINE LINEA + Differenza Precedente + Salva come Patch + Mostra Simboli Nascosti + Diff Affiancato + SOTTOMODULO + NUOVO + Scambia + Evidenziazione Sintassi + Avvolgimento delle Parole + Apri nello Strumento di Merge + Mostra Tutte le Righe + Diminuisci Numero di Righe Visibili + Aumenta Numero di Righe Visibili + SELEZIONA UN FILE PER VISUALIZZARE LE MODIFICHE + Apri nello Strumento di Merge + Scarta Modifiche + Tutte le modifiche locali nella copia di lavoro. + Modifiche: + Includi file ignorati + Un totale di {0} modifiche saranno scartate + Questa azione non può essere annullata!!! + Segnalibro: + Nuovo Nome: + Destinazione: + Modifica Gruppo Selezionato + Modifica Repository Selezionato + Esegui Azione Personalizzata + Nome Azione: + Avanzamento Veloce (senza verifica) + Recupera + Recupera da tutti i remoti + Recupera senza tag + Remoto: + Recupera Modifiche Remote + Presumi invariato + Scarta... + Scarta {0} file... + Scarta Modifiche nelle Righe Selezionate + Apri Strumento di Merge Esterno + Salva come Patch... + Staging + Staging {0} file + Staging Modifiche nelle Righe Selezionate + Stash... + Stash {0} file... + Rimuovi dallo Staging + Rimuovi dallo Staging {0} file + Rimuovi dallo Staging Modifiche nelle Righe Selezionate + Usa Il Loro (checkout --theirs) + Usa Il Mio (checkout --ours) + Cronologia File + CONTENUTO + MODIFICA + FILTRO + Git-Flow + Branch di Sviluppo: + Feature: + Prefisso Feature: + FLOW - Completa Feature + FLOW - Completa Hotfix + FLOW - Completa Release + Target: + Hotfix: + Prefisso Hotfix: + Inizializza Git-Flow + Mantieni branch + Branch di Produzione: + Release: + Prefisso Release: + Inizia Feature... + FLOW - Inizia Feature + Inizia Hotfix... + FLOW - Inizia Hotfix + Inserisci nome + Inizia Release... + FLOW - Inizia Release + Prefisso Tag Versione: + Git LFS + Aggiungi Modello di Tracciamento... + Il modello è un nome file + Modello Personalizzato: + Aggiungi Modello di Tracciamento a Git LFS + Recupera + Recupera Oggetti LFS + Esegui `git lfs fetch` per scaricare gli oggetti Git LFS. Questo non aggiorna la copia di lavoro. + Installa hook di Git LFS + Mostra Bloccaggi + Nessun File Bloccato + Blocca + Mostra solo i miei bloccaggi + Bloccaggi LFS + Sblocca + Forza Sblocco + Elimina + Esegui `git lfs prune` per eliminare vecchi file LFS dallo storage locale + Pull + Pull Oggetti LFS + Esegui `git lfs pull` per scaricare tutti i file LFS per il ref corrente e fare il checkout + Push + Push Oggetti LFS + Invia grandi file in coda al punto finale di Git LFS + Remoto: + Traccia file con nome '{0}' + Traccia tutti i file *{0} + Storico + Passa Layout Orizzontale/Verticale + AUTORE + ORA AUTORE + GRAFICO & OGGETTO + SHA + ORA COMMIT + {0} COMMIT SELEZIONATI + Tieni premuto 'Ctrl' o 'Shift' per selezionare più commit. + Tieni premuto ⌘ o ⇧ per selezionare più commit. + SUGGERIMENTI: + Riferimento Scorciatoie da Tastiera + GLOBALE + Annulla il popup corrente + Chiudi la pagina corrente + Vai alla pagina precedente + Vai alla pagina successiva + Crea una nuova pagina + Apri la finestra di preferenze + REPOSITORY + Conferma le modifiche in fase + Conferma e invia le modifiche in fase + Aggiungi tutte le modifiche e conferma + Crea un nuovo branch dal commit selezionato + Scarta le modifiche selezionate + Recupera, avvia direttamente + Modalità Dashboard (Predefinita) + Recupera e integra, avvia direttamente + Invia, avvia direttamente + Forza il ricaricamento di questo repository + Aggiungi/Rimuovi le modifiche selezionate + Modalità ricerca commit + Passa a 'Modifiche' + Passa a 'Storico' + Passa a 'Stashes' + EDITOR TESTO + Chiudi il pannello di ricerca + Trova il prossimo risultato + Trova il risultato precedente + Apri il pannello di ricerca + Aggiungi + Rimuovi + Scarta + Inizializza Repository + Percorso: + Cherry-Pick in corso. Premi 'Annulla' per ripristinare l'HEAD originale. + Richiesta di merge in corso. Premi 'Annulla' per ripristinare l'HEAD originale. + Rebase in corso. Premi 'Annulla' per ripristinare l'HEAD originale. + Revert in corso. Premi 'Annulla' per ripristinare l'HEAD originale. + Rebase Interattivo + Branch di destinazione: + Su: + Apri nel Browser + Copia il Link + ERRORE + AVVISO + Unisci Branch + In: + Opzione di Merge: + Branch Sorgente: + Sposta Nodo Repository + Seleziona nodo padre per: + Nome: + Git NON è configurato. Vai su [Preferenze] e configurarlo prima. + Apri Cartella Dati App + Apri con... + Opzionale. + Crea Nuova Pagina + Segnalibro + Chiudi Tab + Chiudi Altri Tab + Chiudi i Tab a Destra + Copia Percorso Repository + Repository + Incolla + Proprio ora + {0} minuti fa + {0} ore fa + Ieri + {0} giorni fa + Il mese scorso + {0} mesi fa + L'anno scorso + {0} anni fa + Preferenze + AI + Analizza il Prompt Differenza + Chiave API + Genera Prompt Soggetto + Modello + Nome + Server + ASPETTO + Font Predefinito + Font Size + Dimensione Font Predefinita + Dimensione Font Editor + Font Monospaziato + Usa solo font monospaziato nell'editor + Tema + Sostituzioni Tema + Usa larghezza fissa per i tab nella barra del titolo + Usa cornice finestra nativa + STRUMENTO DI DIFFERENZA/UNIONE + Percorso Installazione + Inserisci il percorso per lo strumento di differenza/unione + Strumento + GENERALE + Controlla aggiornamenti all'avvio + Lingua + Numero massimo di commit nella cronologia + Mostra l'orario dell'autore anziché quello del commit nel grafico + Lunghezza Guida Soggetto + GIT + Abilita Auto CRLF + Cartella predefinita per cloni + Email Utente + Email globale utente Git + Percorso Installazione + Nome Utente + Nome globale utente Git + Versione di Git + Git (>= 2.23.0) è richiesto da questa applicazione + FIRMA GPG + Firma GPG per commit + Firma GPG per tag + Formato GPG + Percorso Programma Installato + Inserisci il percorso per il programma GPG installato + Chiave Firma Utente + Chiave GPG dell'utente per la firma + INTEGRAZIONE + SHELL/TERMINALE + Shell/Terminale + Percorso + Potatura Remota + Destinazione: + Potatura Worktrees + Potatura delle informazioni di worktree in `$GIT_DIR/worktrees` + Pull + Branch: + Recupera tutti i branch + In: + Modifiche Locali: + Scarta + Non fare nulla + Accantona e Riapplica + Recupera senza tag + Remoto: + Pull (Fetch & Merge) + Usa rebase anziché merge + Push + Assicurati che i submoduli siano stati spinti + Forza il push + Branch Locale: + Remoto: + Invia modifiche al remoto + Branch Remoto: + Imposta come branch di tracking + Invia tutti i tag + Invia Tag al Remoto + Invia a tutti i remoti + Remoto: + Tag: + Esci + Rebase Branch Corrente + Accantona & Riapplica modifiche locali + Su: + Rebase: + Aggiorna + Aggiungi Remoto + Modifica Remoto + Nome: + Nome del remoto + URL del Repository: + URL del repository Git remoto + Copia URL + Elimina... + Modifica... + Recupera + Apri nel Browser + Pota + Conferma Rimozione Worktree + Abilita opzione `--force` + Destinazione: + Rinomina Branch + Nuovo Nome: + Nome univoco per questo branch + Branch: + ANNULLA + Recupero automatico delle modifiche dai remoti... + Pulizia (GC & Potatura) + Esegui il comando `git gc` per questo repository. + Cancella tutto + Configura questo repository + CONTINUA + Azioni Personalizzate + Nessuna Azione Personalizzata + Abilita opzione '--reflog' + Apri nel Browser File + Cerca Branch/Tag/Submodule + FILTRATO DA: + BRANCH LOCALI + Vai a HEAD + Abilita opzione '--first-parent' + Crea Branch + Apri in {0} + Apri in Strumenti Esterni + Aggiorna + REMOTI + AGGIUNGI REMOTO + RISOLVI + Cerca Commit + File + Messaggio + SHA + Autore & Committente + Branch Corrente + Mostra Tag come Albero + Statistiche + SUBMODULE + AGGIUNGI SUBMODULE + AGGIORNA SUBMODULE + TAG + NUOVO TAG + Apri nel Terminale + WORKTREE + AGGIUNGI WORKTREE + POTATURA + URL del Repository Git + Reset Branch Corrente alla Revisione + Modalità Reset: + Sposta a: + Branch Corrente: + Mostra nel File Explorer + Revert Commit + Commit: + Commit delle modifiche di revert + Modifica Messaggio di Commit + Usa 'Shift+Enter' per inserire una nuova riga. 'Enter' è il tasto rapido per il pulsante OK + In esecuzione. Attendere... + SALVA + Salva come... + La patch è stata salvata con successo! + Scansiona Repository + Cartella Principale: + Controlla Aggiornamenti... + È disponibile una nuova versione del software: + Errore durante il controllo degli aggiornamenti! + Scarica + Salta questa versione + Aggiornamento Software + Non ci sono aggiornamenti disponibili. + Squash Commit + In: + Chiave Privata SSH: + Percorso per la chiave SSH privata + AVVIA + Accantona + Includi file non tracciati + Mantieni file indicizzati + Messaggio: + Opzionale. Nome di questo accantonamento + Solo modifiche indicizzate + Sia le modifiche indicizzate che quelle non indicizzate dei file selezionati saranno accantonate!!! + Accantona Modifiche Locali + Applica + Elimina + Estrai + Elimina Accantonamento + Elimina: + Accantonamenti + MODIFICHE + ACCANTONAMENTI + Statistiche + COMMIT + COMMITTER + MESE + SETTIMANA + COMMIT: + AUTORI: + PANORAMICA + SUBMODULE + Aggiungi Submodule + Copia Percorso Relativo + Recupera submodule annidati + Apri Repository Submodule + Percorso Relativo: + Cartella relativa per memorizzare questo modulo. + Elimina Submodule + OK + Copia Nome Tag + Copia Messaggio Tag + Elimina ${0}$... + Unisci ${0}$ in ${1}$... + Invia ${0}$... + URL: + Aggiorna Submodule + Tutti i submodule + Inizializza se necessario + Ricorsivamente + Submodule: + Usa opzione --remote + Avviso + Pagina di Benvenuto + Crea Gruppo + Crea Sottogruppo + Clona Repository + Elimina + TRASCINA & RILASCIA CARTELLA SUPPORTATO. RAGGRUPPAMENTI PERSONALIZZATI SUPPORTATI. + Modifica + Sposta in un Altro Gruppo + Apri Tutti i Repository + Apri Repository + Apri Terminale + Riscansiona Repository nella Cartella Clone Predefinita + Cerca Repository... + Ordina + Modifiche + Git Ignore + Ignora tutti i file *{0} + Ignora i file *{0} nella stessa cartella + Ignora i file nella stessa cartella + Ignora solo questo file + Modifica + Puoi indicizzare questo file ora. + COMMIT + COMMIT & PUSH + Template/Storico + Attiva evento click + Indica tutte le modifiche e fai il commit + Commit vuoto rilevato! Vuoi continuare (--allow-empty)? + CONFLITTI RILEVATI + CONFLITTI NEI FILE RISOLTI + INCLUDI FILE NON TRACCIATI + NESSUN MESSAGGIO RECENTE INSERITO + NESSUN TEMPLATE DI COMMIT + INDICIZZATI + RIMUOVI DALL'INDICIZZAZIONE + RIMUOVI TUTTO DALL'INDICIZZAZIONE + NON INDICIZZATI + INDICIZZA + INDICIZZA TUTTO + VISUALIZZA COME NON MODIFICATO + Template: ${0}$ + Clicca con il tasto destro sul file(i) selezionato, quindi scegli come risolvere i conflitti. + WORKSPACE: + Configura Workspaces... + WORKTREE + Copia Percorso + Blocca + Rimuovi + Sblocca + From ba0bb35ca6f6bc16f019505a14be951ffcbd675b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 28 Nov 2024 01:45:10 +0000 Subject: [PATCH 0290/1283] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 45d6bbf5..07cdc098 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.86%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.01%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.44%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.29%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.86%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.01%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.44%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-97.87%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.29%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/TRANSLATION.md b/TRANSLATION.md index af8f4938..c15fdcfb 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -58,12 +58,27 @@ -### it_IT.axaml: 100.0% +### it_IT.axaml: 97.87%
Missing Keys +- Text.CommitDetail.Info.Children +- Text.Configure.IssueTracker.AddSampleGitLabMergeRequest +- Text.Configure.OpenAI.Preferred +- Text.Configure.OpenAI.Preferred.Tip +- Text.Fetch.Force +- Text.Preference.General.ShowChildren +- Text.Repository.FilterCommits +- Text.Repository.FilterCommits.Default +- Text.Repository.FilterCommits.Exclude +- Text.Repository.FilterCommits.Include +- Text.Repository.HistoriesOrder +- Text.Repository.HistoriesOrder.ByDate +- Text.Repository.HistoriesOrder.Topo +- Text.SHALinkCM.CopySHA +- Text.SHALinkCM.NavigateTo
From 315a226365884eb68b6dc2f1e69e0a754c9cae9a Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 28 Nov 2024 09:48:07 +0800 Subject: [PATCH 0291/1283] code_review: PR #759 * code indent * update README.md --- README.md | 2 +- src/Models/Locales.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 07cdc098..d83642a5 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * Supports Windows/macOS/Linux * Opensource/Free * Fast -* Deutsch/English/Español/Français/Português/Русский/简体中文/繁體中文 +* Deutsch/English/Español/Français/Italiano/Português/Русский/简体中文/繁體中文 * Built-in light/dark themes * Customize theme * Visual commit graph diff --git a/src/Models/Locales.cs b/src/Models/Locales.cs index e30977bf..d5e1534c 100644 --- a/src/Models/Locales.cs +++ b/src/Models/Locales.cs @@ -12,7 +12,7 @@ namespace SourceGit.Models new Locale("English", "en_US"), new Locale("Español", "es_ES"), new Locale("Français", "fr_FR"), - new Locale("Italiano", "it_IT"), + new Locale("Italiano", "it_IT"), new Locale("Português (Brasil)", "pt_BR"), new Locale("Русский", "ru_RU"), new Locale("简体中文", "zh_CN"), From ccf03ce2de2921325d49c4ee30d09ab0ed2fe565 Mon Sep 17 00:00:00 2001 From: Efrem Ropelato Date: Thu, 28 Nov 2024 06:57:46 +0100 Subject: [PATCH 0292/1283] fix ita locale: add ResourceInclude en_US.axaml (#762) * Italian translation * fix ita locale: add ResourceInclude en_US.axaml --- TRANSLATION.md | 2 +- src/Resources/Locales/it_IT.axaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index c15fdcfb..31ab7efa 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -58,8 +58,8 @@ -### it_IT.axaml: 97.87% +### it_IT.axaml: 97.87%
Missing Keys diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index 432daa08..2e3acf3e 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -1,4 +1,7 @@ + + + Informazioni Informazioni su SourceGit • Creato con From 8f4d3fd957872bdcf351dc8ac4f101fb8280c415 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 28 Nov 2024 05:57:58 +0000 Subject: [PATCH 0293/1283] doc: Update translation status and missing keys --- TRANSLATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 31ab7efa..c15fdcfb 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -58,9 +58,9 @@
- ### it_IT.axaml: 97.87% +
Missing Keys From 58eeeab67b1a0a67c6d93711f52cb34db1d61ab2 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 28 Nov 2024 19:36:07 +0800 Subject: [PATCH 0294/1283] enhance: set `core.autocrlf` to `false` when run `git diff` to get detail changes of selected file (#761) --- src/Commands/Diff.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Commands/Diff.cs b/src/Commands/Diff.cs index dea15592..da971e58 100644 --- a/src/Commands/Diff.cs +++ b/src/Commands/Diff.cs @@ -28,9 +28,9 @@ namespace SourceGit.Commands Context = repo; if (ignoreWhitespace) - Args = $"diff --no-ext-diff --patch --ignore-cr-at-eol --ignore-all-space --unified={unified} {opt}"; + Args = $"-c core.autocrlf=false diff --no-ext-diff --patch --ignore-cr-at-eol --ignore-all-space --unified={unified} {opt}"; else - Args = $"diff --no-ext-diff --patch --ignore-cr-at-eol --unified={unified} {opt}"; + Args = $"-c core.autocrlf=false diff --no-ext-diff --patch --ignore-cr-at-eol --unified={unified} {opt}"; } public Models.DiffResult Result() From 400aaacf183b15eed98c64d2cfaa562896a34352 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 28 Nov 2024 21:40:51 +0800 Subject: [PATCH 0295/1283] fix: wrong column indentation on right side of Interactive Rebase window, for wide commit messages (#764) --- src/Views/InteractiveRebase.axaml | 55 +++++++++++++++++-------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/src/Views/InteractiveRebase.axaml b/src/Views/InteractiveRebase.axaml index c008193b..6679fbb6 100644 --- a/src/Views/InteractiveRebase.axaml +++ b/src/Views/InteractiveRebase.axaml @@ -76,13 +76,16 @@ - + - + @@ -170,8 +173,8 @@ - - - - - - - + + - - - + + + + - + + + - + - - From dfc03d7a8f80b1ca98a4b8ed03845b54577bc462 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 29 Nov 2024 09:51:50 +0800 Subject: [PATCH 0296/1283] feature: allows to copy branch/tag name from the context menu of selected commit --- src/ViewModels/Histories.cs | 108 ++++++++++++++++++++++++------------ 1 file changed, 74 insertions(+), 34 deletions(-) diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index f77fc87b..18ca2e51 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -813,6 +813,8 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Branch"); submenu.Header = current.Name; + FillBranchVisibilityMenu(submenu, current); + if (!string.IsNullOrEmpty(current.Upstream)) { var upstream = current.Upstream.Substring(13); @@ -852,6 +854,17 @@ namespace SourceGit.ViewModels e.Handled = true; }; submenu.Items.Add(push); + + var rename = new MenuItem(); + rename.Header = new Views.NameHighlightedTextBlock("BranchCM.Rename", current.Name); + rename.Icon = App.CreateMenuIcon("Icons.Rename"); + rename.Click += (_, e) => + { + if (PopupHost.CanCreatePopup()) + PopupHost.ShowPopup(new RenameBranch(_repo, current)); + e.Handled = true; + }; + submenu.Items.Add(rename); submenu.Items.Add(new MenuItem() { Header = "-" }); var detect = Commands.GitFlow.DetectType(_repo.FullPath, _repo.Branches, current.Name); @@ -870,18 +883,15 @@ namespace SourceGit.ViewModels submenu.Items.Add(new MenuItem() { Header = "-" }); } - FillBranchVisibilityMenu(submenu, current); - - var rename = new MenuItem(); - rename.Header = new Views.NameHighlightedTextBlock("BranchCM.Rename", current.Name); - rename.Icon = App.CreateMenuIcon("Icons.Rename"); - rename.Click += (_, e) => + var copy = new MenuItem(); + copy.Header = App.Text("BranchCM.CopyName"); + copy.Icon = App.CreateMenuIcon("Icons.Copy"); + copy.Click += (_, e) => { - if (PopupHost.CanCreatePopup()) - PopupHost.ShowPopup(new RenameBranch(_repo, current)); + App.CopyText(current.Name); e.Handled = true; }; - submenu.Items.Add(rename); + submenu.Items.Add(copy); menu.Items.Add(submenu); } @@ -892,6 +902,8 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Branch"); submenu.Header = branch.Name; + FillBranchVisibilityMenu(submenu, branch); + var checkout = new MenuItem(); checkout.Header = new Views.NameHighlightedTextBlock("BranchCM.Checkout", branch.Name); checkout.Icon = App.CreateMenuIcon("Icons.Check"); @@ -913,25 +925,6 @@ namespace SourceGit.ViewModels e.Handled = true; }; submenu.Items.Add(merge); - submenu.Items.Add(new MenuItem() { Header = "-" }); - - var detect = Commands.GitFlow.DetectType(_repo.FullPath, _repo.Branches, branch.Name); - if (detect.IsGitFlowBranch) - { - var finish = new MenuItem(); - finish.Header = new Views.NameHighlightedTextBlock("BranchCM.Finish", branch.Name); - finish.Icon = App.CreateMenuIcon("Icons.GitFlow"); - finish.Click += (_, e) => - { - if (PopupHost.CanCreatePopup()) - PopupHost.ShowPopup(new GitFlowFinish(_repo, branch, detect.Type, detect.Prefix)); - e.Handled = true; - }; - submenu.Items.Add(finish); - submenu.Items.Add(new MenuItem() { Header = "-" }); - } - - FillBranchVisibilityMenu(submenu, branch); var rename = new MenuItem(); rename.Header = new Views.NameHighlightedTextBlock("BranchCM.Rename", branch.Name); @@ -954,6 +947,33 @@ namespace SourceGit.ViewModels e.Handled = true; }; submenu.Items.Add(delete); + submenu.Items.Add(new MenuItem() { Header = "-" }); + + var detect = Commands.GitFlow.DetectType(_repo.FullPath, _repo.Branches, branch.Name); + if (detect.IsGitFlowBranch) + { + var finish = new MenuItem(); + finish.Header = new Views.NameHighlightedTextBlock("BranchCM.Finish", branch.Name); + finish.Icon = App.CreateMenuIcon("Icons.GitFlow"); + finish.Click += (_, e) => + { + if (PopupHost.CanCreatePopup()) + PopupHost.ShowPopup(new GitFlowFinish(_repo, branch, detect.Type, detect.Prefix)); + e.Handled = true; + }; + submenu.Items.Add(finish); + submenu.Items.Add(new MenuItem() { Header = "-" }); + } + + var copy = new MenuItem(); + copy.Header = App.Text("BranchCM.CopyName"); + copy.Icon = App.CreateMenuIcon("Icons.Copy"); + copy.Click += (_, e) => + { + App.CopyText(branch.Name); + e.Handled = true; + }; + submenu.Items.Add(copy); menu.Items.Add(submenu); } @@ -966,6 +986,8 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Branch"); submenu.Header = name; + FillBranchVisibilityMenu(submenu, branch); + var checkout = new MenuItem(); checkout.Header = new Views.NameHighlightedTextBlock("BranchCM.Checkout", name); checkout.Icon = App.CreateMenuIcon("Icons.Check"); @@ -988,9 +1010,6 @@ namespace SourceGit.ViewModels }; submenu.Items.Add(merge); - submenu.Items.Add(new MenuItem() { Header = "-" }); - - FillBranchVisibilityMenu(submenu, branch); var delete = new MenuItem(); delete.Header = new Views.NameHighlightedTextBlock("BranchCM.Delete", name); @@ -1002,6 +1021,17 @@ namespace SourceGit.ViewModels e.Handled = true; }; submenu.Items.Add(delete); + submenu.Items.Add(new MenuItem() { Header = "-" }); + + var copy = new MenuItem(); + copy.Header = App.Text("BranchCM.CopyName"); + copy.Icon = App.CreateMenuIcon("Icons.Copy"); + copy.Click += (_, e) => + { + App.CopyText(name); + e.Handled = true; + }; + submenu.Items.Add(copy); menu.Items.Add(submenu); } @@ -1013,6 +1043,8 @@ namespace SourceGit.ViewModels submenu.Icon = App.CreateMenuIcon("Icons.Tag"); submenu.MinWidth = 200; + FillTagVisibilityMenu(submenu, tag); + var push = new MenuItem(); push.Header = new Views.NameHighlightedTextBlock("TagCM.Push", tag.Name); push.Icon = App.CreateMenuIcon("Icons.Push"); @@ -1036,9 +1068,6 @@ namespace SourceGit.ViewModels e.Handled = true; }; submenu.Items.Add(merge); - submenu.Items.Add(new MenuItem() { Header = "-" }); - - FillTagVisibilityMenu(submenu, tag); var delete = new MenuItem(); delete.Header = new Views.NameHighlightedTextBlock("TagCM.Delete", tag.Name); @@ -1050,6 +1079,17 @@ namespace SourceGit.ViewModels e.Handled = true; }; submenu.Items.Add(delete); + submenu.Items.Add(new MenuItem() { Header = "-" }); + + var copy = new MenuItem(); + copy.Header = App.Text("TagCM.Copy"); + copy.Icon = App.CreateMenuIcon("Icons.Copy"); + copy.Click += (_, e) => + { + App.CopyText(tag.Name); + e.Handled = true; + }; + submenu.Items.Add(copy); menu.Items.Add(submenu); } From db8ee3410bf19f6d81f6f0871bd6635efd8d1c7d Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 29 Nov 2024 09:59:07 +0800 Subject: [PATCH 0297/1283] refactor: users should change the `SystemAccentColor` from system-wide settings --- src/App.axaml.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 0615724a..a4e5bd5b 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -164,12 +164,7 @@ namespace SourceGit var resDic = new ResourceDictionary(); var overrides = JsonSerializer.Deserialize(File.ReadAllText(themeOverridesFile), JsonCodeGen.Default.ThemeOverrides); foreach (var kv in overrides.BasicColors) - { - if (kv.Key.Equals("SystemAccentColor", StringComparison.Ordinal)) - resDic["SystemAccentColor"] = kv.Value; - else - resDic[$"Color.{kv.Key}"] = kv.Value; - } + resDic[$"Color.{kv.Key}"] = kv.Value; if (overrides.GraphColors.Count > 0) Models.CommitGraph.SetPens(overrides.GraphColors, overrides.GraphPenThickness); From 4aad6a7f8610db2e3b57449f44e316e4c177b0e8 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 29 Nov 2024 10:26:36 +0800 Subject: [PATCH 0298/1283] fix: `System.ArgumentException` when hover the commit link multiple times before the first time tooltip shows (#765) --- src/ViewModels/CherryPick.cs | 1 - src/Views/CommitMessagePresenter.cs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/CherryPick.cs b/src/ViewModels/CherryPick.cs index ea601d5a..19dac059 100644 --- a/src/ViewModels/CherryPick.cs +++ b/src/ViewModels/CherryPick.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Text; using System.Threading.Tasks; namespace SourceGit.ViewModels diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index 7ca823dc..a767b395 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -296,7 +296,8 @@ namespace SourceGit.Views if (currentParent is { DataContext: ViewModels.CommitDetail currentDetail } && currentDetail.Commit.SHA == lastDetailCommit) { - _inlineCommits.Add(sha, c); + if (!_inlineCommits.ContainsKey(sha)) + _inlineCommits.Add(sha, c); // Make sure user still hovers the target SHA. if (_lastHover == link && c != null) From 4cb9dbfd143ec4fbcb3102b5f3d18fb2e77252dc Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 29 Nov 2024 10:35:23 +0800 Subject: [PATCH 0299/1283] code_style: remove unused namespace using --- .editorconfig | 3 +++ src/Commands/QueryLocalChanges.cs | 3 +-- src/ViewModels/RepositoryConfigure.cs | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 83b15884..22c741b9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -206,6 +206,9 @@ dotnet_diagnostic.CA1854.severity = warning #CA2211:Non-constant fields should not be visible dotnet_diagnostic.CA2211.severity = error +# IDE0005: remove used namespace using +dotnet_diagnostic.IDE0005.severity = error + # Wrapping preferences csharp_wrap_before_ternary_opsigns = false diff --git a/src/Commands/QueryLocalChanges.cs b/src/Commands/QueryLocalChanges.cs index bdef9bf8..ea422215 100644 --- a/src/Commands/QueryLocalChanges.cs +++ b/src/Commands/QueryLocalChanges.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Text.RegularExpressions; namespace SourceGit.Commands diff --git a/src/ViewModels/RepositoryConfigure.cs b/src/ViewModels/RepositoryConfigure.cs index 620db074..95fb5517 100644 --- a/src/ViewModels/RepositoryConfigure.cs +++ b/src/ViewModels/RepositoryConfigure.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using Avalonia.Collections; using CommunityToolkit.Mvvm.ComponentModel; From f028513d499273d2dfd67a8897300cb776d1cf35 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 29 Nov 2024 11:46:27 +0800 Subject: [PATCH 0300/1283] doc: update tips for manually build --- build/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/README.md b/build/README.md index a75f4d73..b4358a55 100644 --- a/build/README.md +++ b/build/README.md @@ -5,7 +5,7 @@ ## How to build this project manually -1. Make sure [.NET SDK 8](https://dotnet.microsoft.com/en-us/download) is installed on your machine. +1. Make sure [.NET SDK 9](https://dotnet.microsoft.com/en-us/download) is installed on your machine. 2. Clone this project 3. Run the follow command under the project root dir ```sh From e65ac18afc55f69741e6bd3788f5c485c89e7a56 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 29 Nov 2024 19:00:53 +0800 Subject: [PATCH 0301/1283] fix: wrong column indentation on right side of Interactive Rebase window, for wide commit messages (#764) --- src/Views/InteractiveRebase.axaml | 51 ++++++++++++++++--------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/src/Views/InteractiveRebase.axaml b/src/Views/InteractiveRebase.axaml index 6679fbb6..846be5f2 100644 --- a/src/Views/InteractiveRebase.axaml +++ b/src/Views/InteractiveRebase.axaml @@ -65,6 +65,7 @@ + @@ -76,7 +77,7 @@ - + - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - From 938876e92478b07c64638254faef2b5a0393cc2d Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 29 Nov 2024 19:12:27 +0800 Subject: [PATCH 0302/1283] fix: wrong column indentation on right side of Interactive Rebase window, for wide commit messages (#764) --- src/Views/InteractiveRebase.axaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Views/InteractiveRebase.axaml b/src/Views/InteractiveRebase.axaml index 846be5f2..f02f15ae 100644 --- a/src/Views/InteractiveRebase.axaml +++ b/src/Views/InteractiveRebase.axaml @@ -212,7 +212,9 @@ - + + +
-### es_ES.axaml: 97.73% +### es_ES.axaml: 100.00%
Missing Keys -- Text.CommitDetail.Files.Search -- Text.CommitDetail.Info.Children -- Text.Fetch.Force -- Text.Preference.Appearance.FontSize -- Text.Preference.Appearance.FontSize.Default -- Text.Preference.Appearance.FontSize.Editor -- Text.Preference.General.ShowChildren -- Text.Repository.FilterCommits -- Text.Repository.FilterCommits.Default -- Text.Repository.FilterCommits.Exclude -- Text.Repository.FilterCommits.Include -- Text.Repository.HistoriesOrder -- Text.Repository.HistoriesOrder.ByDate -- Text.Repository.HistoriesOrder.Topo -- Text.SHALinkCM.NavigateTo -- Text.WorkingCopy.CommitToEdit +
diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 563419be..7c7f8d7c 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -126,10 +126,12 @@ Buscar Cambios... ARCHIVOS Archivo LFS + Buscar Archivos... Submódulo INFORMACIÓN AUTOR CAMBIADO + HIJOS COMMITTER Ver refs que contienen este commit COMMIT ESTÁ CONTENIDO EN @@ -272,6 +274,7 @@ Fast-Forward (sin checkout) Fetch Fetch todos los remotos + Utilizar opción '--force' Fetch sin etiquetas Remoto: Fetch Cambios Remotos @@ -437,6 +440,9 @@ Servidor APARIENCIA Fuente por defecto + Tamaño de fuente + Por defecto + Editor Fuente Monospace Usar solo fuente monospace en el editor de texto Tema @@ -452,6 +458,7 @@ Idioma Commits en el historial Mostrar hora del autor en lugar de la hora del commit en el gráfico + Mostrar hijos en los detalles de commit Longitud de la guía del asunto GIT Habilitar Auto CRLF @@ -541,6 +548,13 @@ Habilitar Opción '--reflog' Abrir en el Explorador Buscar Ramas/Etiquetas/Submódulos + Visibilidad en el Gráfico + Desestablecer + Ocultar en el Gráfico de Commits + Filtrar en el Gráfico de Commits + Cambiar Modo de Ordenación + Fecha de Commit (--date-order) + Topológicamente (--topo-order) RAMAS LOCALES Navegar a HEAD Habilitar Opción '--first-parent' @@ -593,6 +607,7 @@ Actualización de Software Actualmente no hay actualizaciones disponibles. Copiar SHA + Ir a Squash Commits En: Clave Privada SSH: @@ -670,6 +685,7 @@ COMMIT & PUSH Plantilla/Historias Activar evento de clic + Commit (Editar) Stagear todos los cambios y commit ¡Commit vacío detectado! ¿Quieres continuar (--allow-empty)? CONFLICTOS DETECTADOS From c062f270816581210896b21f1120e2a2b19a65fe Mon Sep 17 00:00:00 2001 From: GadflyFang Date: Fri, 6 Dec 2024 15:09:14 +0800 Subject: [PATCH 0327/1283] fix: Dispose _autoFetchTimer before _setting set to null (#792) Signed-off-by: Gadfly --- src/ViewModels/Repository.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 514bdb6d..38855fef 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -427,12 +427,12 @@ namespace SourceGit.ViewModels { // Ignore } - _settings = null; - _historiesFilterMode = Models.FilterMode.None; - _autoFetchTimer.Dispose(); _autoFetchTimer = null; + _settings = null; + _historiesFilterMode = Models.FilterMode.None; + _watcher?.Dispose(); _histories.Cleanup(); _workingCopy.Cleanup(); From 655d71b0bc163e35f18eb510df45f53bfdfb4095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20W?= <44604769+goran-w@users.noreply.github.com> Date: Sun, 8 Dec 2024 10:50:33 +0100 Subject: [PATCH 0328/1283] Add navigation and highlighting of change-blocks in Text Diff (#616, #717) (#703) * Corrected misspelled local variable nextHigh(t)light * Implemented change-block navigation * Modified behavior of the Prev/Next Change buttons in DiffView toolbar. * Well-defined change-blocks are pre-calculated and can be navigated between. * Current change-block is highlighted in the Diff panel(s). * Prev/next at start/end of range (re-)scrolls to first/last change-block (I.e when unset, or already at first/last change-block, or at the only one.) * Current change-block is unset in RefreshContent(). * Added safeguards for edge cases * Added indicator of current/total change-blocks in DiffView toolbar * Added new Icon and String (en-US) for Highlighted Diff Navigation * Added Preference and ToggleButton for diff navigation style --- src/Commands/Diff.cs | 3 + src/Models/DiffResult.cs | 60 +++++++++++- src/Resources/Icons.axaml | 1 + src/Resources/Locales/en_US.axaml | 1 + src/ViewModels/DiffContext.cs | 73 +++++++++++++- src/ViewModels/Preference.cs | 7 ++ src/ViewModels/TwoSideTextDiff.cs | 33 +++++++ src/Views/DiffView.axaml | 27 +++++- src/Views/DiffView.axaml.cs | 44 ++++++--- src/Views/TextDiffView.axaml | 3 + src/Views/TextDiffView.axaml.cs | 156 ++++++++++++++++++++++++------ 11 files changed, 361 insertions(+), 47 deletions(-) diff --git a/src/Commands/Diff.cs b/src/Commands/Diff.cs index da971e58..f1bef7b7 100644 --- a/src/Commands/Diff.cs +++ b/src/Commands/Diff.cs @@ -51,6 +51,9 @@ namespace SourceGit.Commands _result.TextDiff.MaxLineNumber = Math.Max(_newLine, _oldLine); } + if (_result.TextDiff != null) + _result.TextDiff.ProcessChangeBlocks(); + return _result; } diff --git a/src/Models/DiffResult.cs b/src/Models/DiffResult.cs index e0ae82e0..afe22ad4 100644 --- a/src/Models/DiffResult.cs +++ b/src/Models/DiffResult.cs @@ -2,6 +2,8 @@ using System.Text; using System.Text.RegularExpressions; +using CommunityToolkit.Mvvm.ComponentModel; + using Avalonia; using Avalonia.Media.Imaging; @@ -59,16 +61,70 @@ namespace SourceGit.Models } } - public partial class TextDiff + public class TextDiffChangeBlock + { + public TextDiffChangeBlock(int startLine, int endLine) + { + StartLine = startLine; + EndLine = endLine; + } + + public int StartLine { get; set; } = 0; + public int EndLine { get; set; } = 0; + + public bool IsInRange(int line) + { + return line >= StartLine && line <= EndLine; + } + } + + public partial class TextDiff : ObservableObject { public string File { get; set; } = string.Empty; public List Lines { get; set; } = new List(); public Vector ScrollOffset { get; set; } = Vector.Zero; public int MaxLineNumber = 0; + public int CurrentChangeBlockIdx + { + get => _currentChangeBlockIdx; + set => SetProperty(ref _currentChangeBlockIdx, value); + } + public string Repo { get; set; } = null; public DiffOption Option { get; set; } = null; + public List ChangeBlocks { get; set; } = []; + + public void ProcessChangeBlocks() + { + ChangeBlocks.Clear(); + int lineIdx = 0, blockStartIdx = 0; + bool isNewBlock = true; + foreach (var line in Lines) + { + lineIdx++; + if (line.Type == Models.TextDiffLineType.Added || + line.Type == Models.TextDiffLineType.Deleted || + line.Type == Models.TextDiffLineType.None) // Empty + { + if (isNewBlock) + { + isNewBlock = false; + blockStartIdx = lineIdx; + } + } + else + { + if (!isNewBlock) + { + ChangeBlocks.Add(new TextDiffChangeBlock(blockStartIdx, lineIdx - 1)); + isNewBlock = true; + } + } + } + } + public TextDiffSelection MakeSelection(int startLine, int endLine, bool isCombined, bool isOldSide) { var rs = new TextDiffSelection(); @@ -626,6 +682,8 @@ namespace SourceGit.Models return true; } + private int _currentChangeBlockIdx = -1; // NOTE: Use -1 as "not set". + [GeneratedRegex(@"^@@ \-(\d+),?\d* \+(\d+),?\d* @@")] private static partial Regex REG_INDICATOR(); } diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml index 8d66a250..b2c347ba 100644 --- a/src/Resources/Icons.axaml +++ b/src/Resources/Icons.axaml @@ -54,6 +54,7 @@ M30 271l241 0 0-241-241 0 0 241zM392 271l241 0 0-241-241 0 0 241zM753 30l0 241 241 0 0-241-241 0zM30 632l241 0 0-241-241 0 0 241zM392 632l241 0 0-241-241 0 0 241zM753 632l241 0 0-241-241 0 0 241zM30 994l241 0 0-241-241 0 0 241zM392 994l241 0 0-241-241 0 0 241zM753 994l241 0 0-241-241 0 0 241z M0 512M1024 512M512 0M512 1024M955 323q0 23-16 39l-414 414-78 78q-16 16-39 16t-39-16l-78-78-207-207q-16-16-16-39t16-39l78-78q16-16 39-16t39 16l168 169 375-375q16-16 39-16t39 16l78 78q16 16 16 39z M416 64H768v64h-64v704h64v64H448v-64h64V512H416a224 224 0 1 1 0-448zM576 832h64V128H576v704zM416 128H512v320H416a160 160 0 0 1 0-320z + M20.2585648,2.00438474 C20.6382605,2.00472706 20.9518016,2.28716326 21.0011348,2.65328337 L21.0078899,2.75506004 L21.0038407,7.25276883 C21.0009137,8.40908568 20.1270954,9.36072944 19.0029371,9.48671858 L19.0024932,11.7464847 C19.0024932,12.9373487 18.0773316,13.9121296 16.906542,13.9912939 L16.7524932,13.9964847 L16.501,13.9963847 L16.5017549,16.7881212 C16.5017549,17.6030744 16.0616895,18.349347 15.3600767,18.7462439 L15.2057929,18.8258433 L8.57108142,21.9321389 C8.10484975,22.1504232 7.57411944,21.8450614 7.50959937,21.3535767 L7.50306874,21.2528982 L7.503,13.9963847 L7.25,13.9964847 C6.05913601,13.9964847 5.08435508,13.0713231 5.00519081,11.9005335 L5,11.7464847 L5.00043957,9.4871861 C3.92882124,9.36893736 3.08392302,8.49812196 3.0058865,7.41488149 L3,7.25086975 L3,2.75438506 C3,2.3401715 3.33578644,2.00438474 3.75,2.00438474 C4.12969577,2.00438474 4.44349096,2.28653894 4.49315338,2.6526145 L4.5,2.75438506 L4.5,7.25086975 C4.5,7.63056552 4.78215388,7.94436071 5.14822944,7.99402313 L5.25,8.00086975 L18.7512697,8.00087075 C19.1315998,8.00025031 19.4461483,7.71759877 19.4967392,7.3518545 L19.5038434,7.25019537 L19.5078902,2.75371008 C19.508263,2.33949668 19.8443515,2.00401258 20.2585648,2.00438474 Z M15.001,13.9963847 L9.003,13.9963847 L9.00306874,20.0736262 L14.5697676,17.4673619 C14.8004131,17.3593763 14.9581692,17.1431606 14.9940044,16.89581 L15.0017549,16.7881212 L15.001,13.9963847 Z M17.502,9.50038474 L6.5,9.50038474 L6.5,11.7464847 C6.5,12.1261805 6.78215388,12.4399757 7.14822944,12.4896381 L7.25,12.4964847 L16.7524932,12.4964847 C17.1321889,12.4964847 17.4459841,12.2143308 17.4956465,11.8482552 L17.5024932,11.7464847 L17.502,9.50038474 Z M24 512A488 488 0 01512 24A488 488 0 011000 512A488 488 0 01512 1000A488 488 0 0124 512zm447-325v327L243 619l51 111 300-138V187H471z M832 64h128v278l-128-146V64zm64 448L512 73 128 512H0L448 0h128l448 512h-128zm0 83V1024H640V704c0-35-29-64-64-64h-128a64 64 0 00-64 64v320H128V595l384-424 384 424z M512 0C229 0 0 229 0 512c0 283 229 512 512 512s512-229 512-512c0-283-229-512-512-512zm0 958C266 958 66 758 66 512S266 66 512 66 958 266 958 512 758 958 512 958zM192 416h96a32 32 0 0032-32v-32a32 32 0 00-32-32H192a32 32 0 00-32 32v32a32 32 0 0032 32zM384 416h96a32 32 0 0032-32v-32a32 32 0 00-32-32h-96a32 32 0 00-32 32v32a32 32 0 0032 32zM576 416h96a32 32 0 0032-32v-32a32 32 0 00-32-32h-96a32 32 0 00-32 32v32a32 32 0 0032 32zM832 320h-64a32 32 0 00-32 32v128h-160a32 32 0 00-32 32v32a32 32 0 0032 32h256a32 32 0 0032-32v-192a32 32 0 00-32-32zM320 544v-32a32 32 0 00-32-32H192a32 32 0 00-32 32v32a32 32 0 0032 32h96a32 32 0 0032-32zM384 576h96a32 32 0 0032-32v-32a32 32 0 00-32-32h-96a32 32 0 00-32 32v32a32 32 0 0032 32zM800 640H256a32 32 0 00-32 32v32a32 32 0 0032 32h544a32 32 0 0032-32v-32a32 32 0 00-32-32z diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 6bea386d..792bc9b8 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -233,6 +233,7 @@ NEW OLD Copy + Highlighted Diff Navigation File Mode Changed Ignore Whitespace Change LFS OBJECT CHANGE diff --git a/src/ViewModels/DiffContext.cs b/src/ViewModels/DiffContext.cs index 87b1a6de..6e6e9fb5 100644 --- a/src/ViewModels/DiffContext.cs +++ b/src/ViewModels/DiffContext.cs @@ -51,6 +51,12 @@ namespace SourceGit.ViewModels private set => SetProperty(ref _unifiedLines, value); } + public string ChangeBlockIndicator + { + get => _changeBlockIndicator; + private set => SetProperty(ref _changeBlockIndicator, value); + } + public DiffContext(string repo, Models.DiffOption option, DiffContext previous = null) { _repo = repo; @@ -73,12 +79,68 @@ namespace SourceGit.ViewModels LoadDiffContent(); } + public void PrevChange() + { + if (_content is Models.TextDiff textDiff) + { + if (textDiff.CurrentChangeBlockIdx > 0) + { + textDiff.CurrentChangeBlockIdx--; + } + else if (textDiff.ChangeBlocks.Count > 0) + { + // Force property value change and (re-)jump to first change block + textDiff.CurrentChangeBlockIdx = -1; + textDiff.CurrentChangeBlockIdx = 0; + } + } + RefreshChangeBlockIndicator(); + } + + public void NextChange() + { + if (_content is Models.TextDiff textDiff) + { + if (textDiff.CurrentChangeBlockIdx < textDiff.ChangeBlocks.Count - 1) + { + textDiff.CurrentChangeBlockIdx++; + } + else if (textDiff.ChangeBlocks.Count > 0) + { + // Force property value change and (re-)jump to last change block + textDiff.CurrentChangeBlockIdx = -1; + textDiff.CurrentChangeBlockIdx = textDiff.ChangeBlocks.Count - 1; + } + RefreshChangeBlockIndicator(); + } + } + + public void RefreshChangeBlockIndicator() + { + string curr = "-", tot = "-"; + if (_content is Models.TextDiff textDiff) + { + if (textDiff.CurrentChangeBlockIdx >= 0) + curr = (textDiff.CurrentChangeBlockIdx + 1).ToString(); + tot = (textDiff.ChangeBlocks.Count).ToString(); + } + ChangeBlockIndicator = curr + "/" + tot; + } + public void ToggleFullTextDiff() { Preference.Instance.UseFullTextDiff = !Preference.Instance.UseFullTextDiff; LoadDiffContent(); } + public void ToggleHighlightedDiffNavigation() + { + Preference.Instance.EnableChangeBlocks = !Preference.Instance.EnableChangeBlocks; + if (_content is Models.TextDiff textDiff) + textDiff.CurrentChangeBlockIdx = -1; + RefreshChangeBlockIndicator(); + } + public void IncrUnified() { UnifiedLines = _unifiedLines + 1; @@ -91,6 +153,12 @@ namespace SourceGit.ViewModels LoadDiffContent(); } + public void ToggleTwoSideDiff() + { + Preference.Instance.UseSideBySideDiff = !Preference.Instance.UseSideBySideDiff; + RefreshChangeBlockIndicator(); + } + public void OpenExternalMergeTool() { var toolType = Preference.Instance.ExternalMergeToolType; @@ -217,7 +285,9 @@ namespace SourceGit.ViewModels FileModeChange = latest.FileModeChange; Content = rs; IsTextDiff = rs is Models.TextDiff; - }); + + RefreshChangeBlockIndicator(); + }); }); } @@ -281,6 +351,7 @@ namespace SourceGit.ViewModels private string _title; private string _fileModeChange = string.Empty; private int _unifiedLines = 4; + private string _changeBlockIndicator = "-/-"; private bool _isTextDiff = false; private bool _ignoreWhitespace = false; private object _content = null; diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index 1ccee4cd..8d09272f 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -206,6 +206,12 @@ namespace SourceGit.ViewModels set => SetProperty(ref _useFullTextDiff, value); } + public bool EnableChangeBlocks + { + get => _enableChangeBlocks; + set => SetProperty(ref _enableChangeBlocks, value); + } + public Models.ChangeViewMode UnstagedChangeViewMode { get => _unstagedChangeViewMode; @@ -614,6 +620,7 @@ namespace SourceGit.ViewModels private bool _enableDiffViewWordWrap = false; private bool _showHiddenSymbolsInDiffView = false; private bool _useFullTextDiff = false; + private bool _enableChangeBlocks = false; private Models.ChangeViewMode _unstagedChangeViewMode = Models.ChangeViewMode.List; private Models.ChangeViewMode _stagedChangeViewMode = Models.ChangeViewMode.List; diff --git a/src/ViewModels/TwoSideTextDiff.cs b/src/ViewModels/TwoSideTextDiff.cs index 3fb1e63b..493174e0 100644 --- a/src/ViewModels/TwoSideTextDiff.cs +++ b/src/ViewModels/TwoSideTextDiff.cs @@ -45,10 +45,43 @@ namespace SourceGit.ViewModels FillEmptyLines(); + ProcessChangeBlocks(); + if (previous != null && previous.File == File) _syncScrollOffset = previous._syncScrollOffset; } + public List ChangeBlocks { get; set; } = []; + + public void ProcessChangeBlocks() + { + ChangeBlocks.Clear(); + int lineIdx = 0, blockStartIdx = 0; + bool isNewBlock = true; + foreach (var line in Old) // NOTE: Same block size in both Old and New lines. + { + lineIdx++; + if (line.Type == Models.TextDiffLineType.Added || + line.Type == Models.TextDiffLineType.Deleted || + line.Type == Models.TextDiffLineType.None) // Empty + { + if (isNewBlock) + { + isNewBlock = false; + blockStartIdx = lineIdx; + } + } + else + { + if (!isNewBlock) + { + ChangeBlocks.Add(new Models.TextDiffChangeBlock(blockStartIdx, lineIdx - 1)); + isNewBlock = true; + } + } + } + } + public void ConvertsToCombinedRange(Models.TextDiff combined, ref int startLine, ref int endLine, bool isOldSide) { endLine = Math.Min(endLine, combined.Lines.Count - 1); diff --git a/src/Views/DiffView.axaml b/src/Views/DiffView.axaml index e0627ad8..bf7b0339 100644 --- a/src/Views/DiffView.axaml +++ b/src/Views/DiffView.axaml @@ -34,6 +34,15 @@ + + + + + + + + + + + + + - - - + + + - + - - + + + +
+ + + +