From 1161738df91fbb4b14ed5f8b64798469016cde82 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 29 May 2024 11:20:15 +0800 Subject: [PATCH 1/2] enhance: a more adaptable regular expression for remote URLs (#149) --- src/Models/Remote.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Models/Remote.cs b/src/Models/Remote.cs index c1cce340..75ca961f 100644 --- a/src/Models/Remote.cs +++ b/src/Models/Remote.cs @@ -4,11 +4,11 @@ namespace SourceGit.Models { public partial class Remote { - [GeneratedRegex(@"^http[s]?://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/]+/[\w\-\.]+\.git$")] + [GeneratedRegex(@"^http[s]?://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/]+/[\w\-\.]+(\.git)?$")] private static partial Regex REG_HTTPS(); - [GeneratedRegex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-/]+/[\w\-\.]+\.git$")] + [GeneratedRegex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-/]+/[\w\-\.]+(\.git)?$")] private static partial Regex REG_SSH1(); - [GeneratedRegex(@"^ssh://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/]+/[\w\-\.]+\.git$")] + [GeneratedRegex(@"^ssh://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/]+/[\w\-\.]+(\.git)?$")] private static partial Regex REG_SSH2(); private static readonly Regex[] URL_FORMATS = [ From 69f9dceece4ea7fe91d19759e6c2250aa4e88462 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 29 May 2024 12:50:26 +0800 Subject: [PATCH 2/2] feature: new way to display changes of submodules --- src/Models/DiffResult.cs | 6 +++++ src/Resources/Locales/en_US.axaml | 2 ++ src/Resources/Locales/zh_CN.axaml | 2 ++ src/Resources/Styles.axaml | 2 +- src/ViewModels/DiffContext.cs | 29 ++++++++++++++++++++--- src/Views/CommitBaseInfo.axaml | 3 --- src/Views/CommitBaseInfo.axaml.cs | 15 +++++++++--- src/Views/CommitDetail.axaml | 7 ++++-- src/Views/DiffView.axaml | 38 +++++++++++++++++++++++++++++++ 9 files changed, 92 insertions(+), 12 deletions(-) diff --git a/src/Models/DiffResult.cs b/src/Models/DiffResult.cs index 8a72b35d..d9d21031 100644 --- a/src/Models/DiffResult.cs +++ b/src/Models/DiffResult.cs @@ -582,6 +582,12 @@ namespace SourceGit.Models public string New { get; set; } = string.Empty; } + public class SubmoduleDiff + { + public Commit Old { get; set; } = null; + public Commit New { get; set; } = null; + } + public class DiffResult { public bool IsBinary { get; set; } = false; diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index bc2bc9c0..d580b82b 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -161,6 +161,8 @@ NO CHANGES OR ONLY EOL CHANGES Previous Difference Side-By-Side Diff + SUBMODULE + NEW Syntax Highlighting Open In Merge Tool Decrease Number of Visible Lines diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 3dffd574..12ec9409 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -161,6 +161,8 @@ 没有变更或仅有换行符差异 上一个差异 分列对比 + 子模块 + 新增 语法高亮 使用外部合并工具查看 减少可见的行数 diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index 376f9424..2f8bb671 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -72,7 +72,7 @@ -