feature: add a toggle button to enable --reflog when query commits

This commit is contained in:
leo 2024-10-18 14:27:20 +08:00
parent f2de7a0c21
commit 62ac4290ca
No known key found for this signature in database
6 changed files with 26 additions and 1 deletions

View file

@ -74,6 +74,16 @@ namespace SourceGit.ViewModels
set => SetProperty(ref _selectedView, value);
}
public bool EnableReflog
{
get => _enableReflog;
set
{
if (SetProperty(ref _enableReflog, value))
Task.Run(RefreshCommits);
}
}
public bool EnableFirstParentInHistories
{
get => _enableFirstParentInHistories;
@ -827,6 +837,8 @@ namespace SourceGit.ViewModels
Dispatcher.UIThread.Invoke(() => _histories.IsLoading = true);
var limits = $"-{Preference.Instance.MaxHistoryCommits} ";
if (_enableReflog)
limits += "--reflog ";
if (_enableFirstParentInHistories)
limits += "--first-parent ";
@ -2126,6 +2138,7 @@ namespace SourceGit.ViewModels
private bool _isSearchCommitSuggestionOpen = false;
private int _searchCommitFilterType = 2;
private bool _onlySearchCommitsInCurrentBranch = false;
private bool _enableReflog = false;
private bool _enableFirstParentInHistories = false;
private string _searchCommitFilter = string.Empty;
private List<Models.Commit> _searchedCommits = new List<Models.Commit>();