mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 13:20:30 +08:00
feature: add --simplify-by-decoration mode support (#1595)
This commit is contained in:
@@ -14,6 +14,12 @@ namespace SourceGit.Models
|
||||
set;
|
||||
} = string.Empty;
|
||||
|
||||
public bool SimplifyByDecoration
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = false;
|
||||
|
||||
public bool EnableReflog
|
||||
{
|
||||
get;
|
||||
|
||||
@@ -670,6 +670,7 @@
|
||||
<x:String x:Key="Text.Repository.Search.InCurrentBranch" xml:space="preserve">Current Branch</x:String>
|
||||
<x:String x:Key="Text.Repository.ShowFirstParentOnly" xml:space="preserve">Show first-parent only</x:String>
|
||||
<x:String x:Key="Text.Repository.ShowLostCommits" xml:space="preserve">Show lost commits</x:String>
|
||||
<x:String x:Key="Text.Repository.SimplifyByDecoration" xml:space="preserve">Show Decorate Commits Only</x:String>
|
||||
<x:String x:Key="Text.Repository.ShowSubmodulesAsTree" xml:space="preserve">Show Submodules as Tree</x:String>
|
||||
<x:String x:Key="Text.Repository.ShowTagsAsTree" xml:space="preserve">Show Tags as Tree</x:String>
|
||||
<x:String x:Key="Text.Repository.Skip" xml:space="preserve">SKIP</x:String>
|
||||
|
||||
@@ -91,6 +91,20 @@ namespace SourceGit.ViewModels
|
||||
set => SetProperty(ref _selectedView, value);
|
||||
}
|
||||
|
||||
public bool SimplifyByDecoration
|
||||
{
|
||||
get => _settings.SimplifyByDecoration;
|
||||
set
|
||||
{
|
||||
if (value != _settings.SimplifyByDecoration)
|
||||
{
|
||||
_settings.SimplifyByDecoration = value;
|
||||
OnPropertyChanged();
|
||||
Task.Run(RefreshCommits);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnableReflog
|
||||
{
|
||||
get => _settings.EnableReflog;
|
||||
@@ -1271,6 +1285,9 @@ namespace SourceGit.ViewModels
|
||||
builder.Append("--reflog ");
|
||||
if (_settings.EnableFirstParentInHistories)
|
||||
builder.Append("--first-parent ");
|
||||
// only show commits with decorators
|
||||
if (_settings.SimplifyByDecoration)
|
||||
builder.Append("--simplify-by-decoration ");
|
||||
|
||||
var filters = _settings.BuildHistoriesFilter();
|
||||
if (string.IsNullOrEmpty(filters))
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
</ListBox.ItemsPanel>
|
||||
|
||||
<ListBoxItem>
|
||||
<Grid Classes="view_mode" ColumnDefinitions="Auto,*,Auto,Auto,Auto,Auto,Auto">
|
||||
<Grid Classes="view_mode" ColumnDefinitions="Auto,*,Auto,Auto,Auto,Auto,Auto,Auto">
|
||||
<Path Grid.Column="0" Classes="icon" Data="{StaticResource Icons.Histories}"/>
|
||||
<TextBlock Grid.Column="1" Classes="header" Text="{DynamicResource Text.Histories}"/>
|
||||
|
||||
@@ -131,7 +131,21 @@
|
||||
ToolTip.Tip="{DynamicResource Text.Repository.UseRelativeTimeInGraph}">
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Stopwatch}"/>
|
||||
</ToggleButton>
|
||||
<Button Grid.Column="6"
|
||||
<ToggleButton Grid.Column="6"
|
||||
Classes="line_path"
|
||||
Width="26" Height="26"
|
||||
Background="Transparent"
|
||||
IsChecked="{Binding SimplifyByDecoration, Mode=TwoWay}">
|
||||
<ToolTip.Tip>
|
||||
<TextBlock>
|
||||
<Run Text="{DynamicResource Text.Repository.SimplifyByDecoration}"/>
|
||||
<Run Text=" "/>
|
||||
<Run Text="--simplify-by-decoration" FontSize="11" Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"/>
|
||||
</TextBlock>
|
||||
</ToolTip.Tip>
|
||||
<Path Width="12" Height="12" Data="{StaticResource Icons.Tree}"/>
|
||||
</ToggleButton>
|
||||
<Button Grid.Column="7"
|
||||
Classes="icon_button"
|
||||
Width="26" Height="26"
|
||||
Click="OnOpenAdvancedHistoriesOption">
|
||||
|
||||
Reference in New Issue
Block a user