Skip to content

Commit b1e6d06

Browse files
committed
remove disable-linear-search argument
1 parent 6c5c7d5 commit b1e6d06

File tree

5 files changed

+4
-17
lines changed

5 files changed

+4
-17
lines changed

GitContentSearch.UI/Models/ApplicationSettings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ public record ApplicationSettings
1010
public string LatestCommit { get; init; } = string.Empty;
1111
public string WorkingDirectory { get; init; } = string.Empty;
1212
public string LogDirectory { get; init; } = string.Empty;
13-
public bool DisableLinearSearch { get; init; }
1413
public bool FollowHistory { get; init; }
1514
}

GitContentSearch.UI/ViewModels/MainWindowViewModel.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ await Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() =>
123123
[ObservableProperty]
124124
private string logDirectory = string.Empty;
125125

126-
[ObservableProperty]
127-
private bool disableLinearSearch;
128-
129126
[ObservableProperty]
130127
private bool followHistory;
131128

@@ -183,7 +180,6 @@ private async Task LoadSettingsAsync()
183180
LatestCommit = settings.LatestCommit;
184181
WorkingDirectory = settings.WorkingDirectory;
185182
LogDirectory = settings.LogDirectory;
186-
DisableLinearSearch = settings.DisableLinearSearch;
187183
FollowHistory = settings.FollowHistory;
188184
}
189185
// If settings is null, we'll keep the default empty string values initialized in the properties
@@ -199,7 +195,6 @@ public async Task SaveSettingsAsync()
199195
LatestCommit = LatestCommit,
200196
WorkingDirectory = WorkingDirectory,
201197
LogDirectory = LogDirectory,
202-
DisableLinearSearch = DisableLinearSearch,
203198
FollowHistory = FollowHistory
204199
};
205200

@@ -345,7 +340,7 @@ private async Task StartSearchAsync()
345340
writer.WriteLine($"Logs and temporary files will be created in: {logAndTempFileDirectory}");
346341
writer.WriteLine(new string('=', 50));
347342

348-
var gitContentSearcher = new GitContentSearcher(_gitHelper, _fileSearcher, _fileManager, DisableLinearSearch, writer);
343+
var gitContentSearcher = new GitContentSearcher(_gitHelper, _fileSearcher, _fileManager, false, writer);
349344

350345
var progress = new Progress<double>(value =>
351346
{

GitContentSearch.UI/Views/MainWindow.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
<Grid Grid.Row="5" ColumnDefinitions="Auto,*" Margin="0,8">
7272
<TextBlock Grid.Column="0" Text="Options" VerticalAlignment="Center" Width="140" FontWeight="Medium"/>
7373
<StackPanel Grid.Column="1" Orientation="Horizontal" Margin="8,0">
74-
<CheckBox Content="Disable Linear Search" IsChecked="{Binding DisableLinearSearch}" Margin="0,0,24,0"/>
7574
<CheckBox Content="Follow History" IsChecked="{Binding FollowHistory}"/>
7675
</StackPanel>
7776
</Grid>

GitContentSearch/Program.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ static void Main(string[] args)
99
{
1010
if (args.Length < 2)
1111
{
12-
Console.WriteLine("Usage: <program> <file-path> <search-string> [--earliest-commit=<commit>] [--latest-commit=<commit>] [--working-directory=<path>] [--log-directory=<path>] [--disable-linear-search] [--follow]");
12+
Console.WriteLine("Usage: <program> <file-path> <search-string> [--earliest-commit=<commit>] [--latest-commit=<commit>] [--working-directory=<path>] [--log-directory=<path>] [--follow]");
1313
return;
1414
}
1515

1616
string filePath = args[0];
1717
string searchString = args[1];
1818
string earliestCommit = "";
1919
string latestCommit = "";
20-
bool disableLinearSearch = false;
2120
bool follow = false;
2221
string? workingDirectory = null;
2322
string? logDirectory = null;
@@ -41,10 +40,6 @@ static void Main(string[] args)
4140
{
4241
logDirectory = arg.Replace("--log-directory=", "");
4342
}
44-
else if (arg == "--disable-linear-search")
45-
{
46-
disableLinearSearch = true;
47-
}
4843
else if (arg == "--follow")
4944
{
5045
follow = true;
@@ -82,7 +77,7 @@ static void Main(string[] args)
8277
var gitHelper = new GitHelper(processWrapper, workingDirectory, follow);
8378
var fileSearcher = new FileSearcher();
8479
var fileManager = new FileManager(logAndTempFileDirectory);
85-
var gitContentSearcher = new GitContentSearcher(gitHelper, fileSearcher, fileManager, disableLinearSearch, logWriter);
80+
var gitContentSearcher = new GitContentSearcher(gitHelper, fileSearcher, fileManager, false, logWriter);
8681

8782
gitContentSearcher.SearchContent(filePath, searchString, earliestCommit, latestCommit);
8883

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ cd /path/to/your/git/repository
8484
**2. Run the tool**:
8585

8686
```bash
87-
GitContentSearch.exe <remote-file-path> <search-string> [--earliest-commit=<commit>] [--latest-commit=<commit>] [--working-directory=<path>] [--log-directory=<path>] [--disable-linear-search] [--follow]
87+
GitContentSearch.exe <remote-file-path> <search-string> [--earliest-commit=<commit>] [--latest-commit=<commit>] [--working-directory=<path>] [--log-directory=<path>] [--follow]
8888
```
8989

9090
### CLI Arguments
@@ -93,7 +93,6 @@ GitContentSearch.exe <remote-file-path> <search-string> [--earliest-commit=<comm
9393
* `<search-string>`: The string you want to search for in the Content file.
9494
* `--earliest-commit=<commit>`: (Optional) The earliest commit to begin the search.
9595
* `--latest-commit=<commit>`: (Optional) The latest commit to end the search.
96-
- `--disable-linear-search`: Use this option to disable the linear search. When enabled, the tool will rely solely on binary search, which can improve performance in large repositories, especially if you already know that one of the commits contains the search string.
9796
* `--working-directory=<path>`: (Optional) The directory where Git commands should be executed. Defaults to the user's temp directory if not provided.
9897
* `--log-directory=<path>`: (Optional) The directory where the log file and temporary files will be stored. Defaults to the user's temp directory if not provided.
9998
* `--follow`: (Optional) Follow file renames and history across commits.

0 commit comments

Comments
 (0)