Skip to content

Commit 1202230

Browse files
committed
Revert "feature: add children list to the commit base info view"
This reverts commit 7ba35e1.
1 parent 7ba35e1 commit 1202230

File tree

5 files changed

+8
-40
lines changed

5 files changed

+8
-40
lines changed

src/Commands/QueryCommits.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ public QueryCommits(string repo, string filter, Models.CommitSearchMethod method
104104
if (_findFirstMerged && !_isHeadFounded && _commits.Count > 0)
105105
MarkFirstMerged();
106106

107-
foreach (var commit in _commits)
108-
{
109-
foreach (var parent in _commits.FindAll(c => commit.Parents.Contains(c.SHA)))
110-
{
111-
parent.Children.Add(commit.SHA);
112-
}
113-
}
114-
115107
return _commits;
116108
}
117109

src/Models/Commit.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public static double OpacityForNotMerged
2828
public ulong CommitterTime { get; set; } = 0;
2929
public string Subject { get; set; } = string.Empty;
3030
public List<string> Parents { get; set; } = new List<string>();
31-
public List<string> Children { get; set; } = new List<string>();
3231
public List<Decorator> Decorators { get; set; } = new List<Decorator>();
3332
public bool HasDecorators => Decorators.Count > 0;
3433

src/Resources/Locales/en_US.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
<x:String x:Key="Text.CommitDetail.Info" xml:space="preserve">INFORMATION</x:String>
126126
<x:String x:Key="Text.CommitDetail.Info.Author" xml:space="preserve">AUTHOR</x:String>
127127
<x:String x:Key="Text.CommitDetail.Info.Changed" xml:space="preserve">CHANGED</x:String>
128-
<x:String x:Key="Text.CommitDetail.Info.Children" xml:space="preserve">CHILDREN</x:String>
129128
<x:String x:Key="Text.CommitDetail.Info.Committer" xml:space="preserve">COMMITTER</x:String>
130129
<x:String x:Key="Text.CommitDetail.Info.ContainsIn" xml:space="preserve">Check refs that contains this commit</x:String>
131130
<x:String x:Key="Text.CommitDetail.Info.ContainsIn.Title" xml:space="preserve">COMMIT IS CONTAINED BY</x:String>

src/Views/CommitBaseInfo.axaml

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<Rectangle Height=".65" Margin="8" Fill="{DynamicResource Brush.Border2}" VerticalAlignment="Center"/>
5252

5353
<!-- Base Information -->
54-
<Grid RowDefinitions="24,Auto,Auto,Auto,Auto" ColumnDefinitions="96,*">
54+
<Grid RowDefinitions="24,Auto,Auto,Auto" ColumnDefinitions="96,*">
5555
<!-- SHA -->
5656
<TextBlock Grid.Row="0" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.SHA}" />
5757
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
@@ -101,7 +101,7 @@
101101
</StackPanel>
102102

103103
<!-- PARENTS -->
104-
<TextBlock Grid.Row="1" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Parents}"/>
104+
<TextBlock Grid.Row="1" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Parents}" IsVisible="{Binding Parents.Count, Converter={x:Static c:IntConverters.IsGreaterThanZero}}"/>
105105
<ItemsControl Grid.Row="1" Grid.Column="1" Height="24" Margin="12,0,0,0" ItemsSource="{Binding Parents}" IsVisible="{Binding Parents.Count, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
106106
<ItemsControl.ItemsPanel>
107107
<ItemsPanelTemplate>
@@ -117,36 +117,14 @@
117117
TextDecorations="Underline"
118118
Cursor="Hand"
119119
Margin="0,0,16,0"
120-
PointerPressed="OnSHAPressed"/>
121-
</DataTemplate>
122-
</ItemsControl.ItemTemplate>
123-
</ItemsControl>
124-
125-
<!-- CHILDREN -->
126-
<TextBlock Grid.Row="2" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Children}"/>
127-
<ItemsControl Grid.Row="2" Grid.Column="1" Height="24" Margin="12,0,0,0" ItemsSource="{Binding Children}" IsVisible="{Binding Children.Count, Converter={x:Static c:IntConverters.IsGreaterThanZero}}">
128-
<ItemsControl.ItemsPanel>
129-
<ItemsPanelTemplate>
130-
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"/>
131-
</ItemsPanelTemplate>
132-
</ItemsControl.ItemsPanel>
133-
134-
<ItemsControl.ItemTemplate>
135-
<DataTemplate>
136-
<TextBlock Classes="primary"
137-
Text="{Binding Converter={x:Static c:StringConverters.ToShortSHA}}"
138-
Foreground="DarkOrange"
139-
TextDecorations="Underline"
140-
Cursor="Hand"
141-
Margin="0,0,16,0"
142-
PointerPressed="OnSHAPressed"/>
120+
PointerPressed="OnParentSHAPressed"/>
143121
</DataTemplate>
144122
</ItemsControl.ItemTemplate>
145123
</ItemsControl>
146124

147125
<!-- REFS -->
148-
<TextBlock Grid.Row="3" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Refs}" IsVisible="{Binding HasDecorators}"/>
149-
<Border Grid.Row="3" Grid.Column="1" Margin="12,0,0,0" Height="24" IsVisible="{Binding HasDecorators}">
126+
<TextBlock Grid.Row="2" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Refs}" IsVisible="{Binding HasDecorators}"/>
127+
<Border Grid.Row="2" Grid.Column="1" Margin="12,0,0,0" Height="24" IsVisible="{Binding HasDecorators}">
150128
<v:CommitRefsPresenter TagBackground="{DynamicResource Brush.DecoratorTag}"
151129
Foreground="{DynamicResource Brush.FG1}"
152130
FontFamily="{DynamicResource Fonts.Primary}"
@@ -156,8 +134,8 @@
156134
</Border>
157135

158136
<!-- Messages -->
159-
<TextBlock Grid.Row="4" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Message}" VerticalAlignment="Top" Margin="0,4,0,0" />
160-
<v:CommitMessagePresenter Grid.Row="4" Grid.Column="1"
137+
<TextBlock Grid.Row="3" Grid.Column="0" Classes="info_label" Text="{DynamicResource Text.CommitDetail.Info.Message}" VerticalAlignment="Top" Margin="0,4,0,0" />
138+
<v:CommitMessagePresenter Grid.Row="3" Grid.Column="1"
161139
Margin="12,5,8,0"
162140
Classes="primary"
163141
Message="{Binding #ThisControl.Message}"

src/Views/CommitBaseInfo.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private void OnOpenContainsIn(object sender, RoutedEventArgs e)
113113
e.Handled = true;
114114
}
115115

116-
private void OnSHAPressed(object sender, PointerPressedEventArgs e)
116+
private void OnParentSHAPressed(object sender, PointerPressedEventArgs e)
117117
{
118118
if (DataContext is ViewModels.CommitDetail detail && sender is Control { DataContext: string sha })
119119
{

0 commit comments

Comments
 (0)