diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 4f3244c2..856577d7 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -384,7 +384,9 @@ ADD REMOTE RESOLVE Search Commit - Search Author/Committer/Message/SHA + Search By + Information + File Statistics SUBMODULES ADD SUBMODULE diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 9677cf22..e5b46759 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -387,7 +387,9 @@ 添加远程 解决冲突 查找提交 - 支持搜索作者/提交者/主题/指纹 + 搜索途径 + 摘要 + 文件 提交统计 子模块列表 添加子模块 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index a6cc8b21..ae7a6d47 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -387,7 +387,9 @@ 新增遠端 解決衝突 查詢提交 - 支援搜尋作者/提交者/主題/指紋 + 查詢方式 + 摘要 + 檔案 提交統計 子模組列表 新增子模組 diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index af197759..24853daf 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -185,6 +185,13 @@ namespace SourceGit.ViewModels } } + [JsonIgnore] + public int SearchCommitFilterType + { + get => _searchCommitFilterType; + set => SetProperty(ref _searchCommitFilterType, value); + } + [JsonIgnore] public string SearchCommitFilter { @@ -416,18 +423,26 @@ namespace SourceGit.ViewModels return; var visible = new List(); - foreach (var c in _histories.Commits) + + if (_searchCommitFilterType == 0) { - if (c.SHA.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) - || c.Body.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) - || c.Author.Name.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) - || c.Committer.Name.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) - || c.Author.Email.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) - || c.Committer.Email.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase)) + foreach (var c in _histories.Commits) { - visible.Add(c); + if (c.SHA.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) + || c.Body.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) + || c.Author.Name.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) + || c.Committer.Name.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) + || c.Author.Email.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase) + || c.Committer.Email.Contains(_searchCommitFilter, StringComparison.OrdinalIgnoreCase)) + { + visible.Add(c); + } } } + else + { + visible = new Commands.QueryCommits(FullPath, $"-1000 -- \"{_searchCommitFilter}\"", false).Result(); + } SearchedCommits = visible; } @@ -1508,6 +1523,7 @@ namespace SourceGit.ViewModels private object _selectedView = null; private bool _isSearching = false; + private int _searchCommitFilterType = 0; private string _searchCommitFilter = string.Empty; private List _searchedCommits = new List(); diff --git a/src/Views/Repository.axaml b/src/Views/Repository.axaml index d393f508..7a631e31 100644 --- a/src/Views/Repository.axaml +++ b/src/Views/Repository.axaml @@ -493,17 +493,17 @@ - + @@ -529,7 +529,27 @@ - + + + + + + + + + + + @@ -572,7 +593,7 @@ -