diff --git a/.azuredevops/Pipelines/build.yaml b/.azuredevops/Pipelines/build.yaml
index 17a4a2aa..582b474a 100644
--- a/.azuredevops/Pipelines/build.yaml
+++ b/.azuredevops/Pipelines/build.yaml
@@ -157,32 +157,21 @@ stages:
displayName: "Dotnet Publish RepoM"
inputs:
command: publish
- # arguments: "--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/${{ variables.SystemTestsArtifactName }}/bin/Release/publish --no-build --self-contained true"
arguments: "--configuration $(buildConfiguration) --output _output/Win/Assemblies"
projects: "**/RepoM.App.csproj"
publishWebProjects: false
modifyOutputPath: false
zipAfterPublish: false
- - task: DotNetCoreCLI@2
- displayName: "Dotnet Publish grr tool"
- inputs:
- command: publish
- arguments: "--configuration $(buildConfiguration) --output _output/Win/Assemblies --self-contained true --runtime win-x64"
- projects: "**/Grr.App.csproj"
- publishWebProjects: false
- modifyOutputPath: false
- zipAfterPublish: false
-
- - task: DotNetCoreCLI@2
- displayName: "Dotnet Publish grrui tool"
- inputs:
- command: publish
- arguments: "--configuration $(buildConfiguration) --output _output/Win/Assemblies --self-contained true --runtime win-x64"
- projects: "**/GrrUi.App.csproj"
- publishWebProjects: false
- modifyOutputPath: false
- zipAfterPublish: false
+ # - task: DotNetCoreCLI@2
+ # displayName: "Dotnet Publish grr tool"
+ # inputs:
+ # command: publish
+ # arguments: "--configuration $(buildConfiguration) --output _output/Win/Assemblies --self-contained true --runtime win-x64"
+ # projects: "**/Grr.App.csproj"
+ # publishWebProjects: false
+ # modifyOutputPath: false
+ # zipAfterPublish: false
- task: DeleteFiles@1
displayName: 'Remove unneeded files'
diff --git a/README.md b/README.md
index 9680d842..47e686c2 100644
--- a/README.md
+++ b/README.md
@@ -1,23 +1,19 @@
-# RepoM ~~RepoZ~~
+# RepoM
-RepoZ is a zero-conf git repository hub with Windows Explorer- & CLI-enhancements. It uses the git repositories on your machine to create an efficient navigation widget and makes sure you'll never lose track of your work along the way.
+RepoM is a minimal-conf git repository hub with Windows Explorer enhancements. It uses the git repositories on your machine to create an efficient navigation widget and makes sure you'll never lose track of your work along the way.
It's populating itself as you work with git. It does not get in the way and does not require any user attention to work.
-RepoZ will not compete with your favourite git clients, so keep them. It's not about working within a repository: It's a new way to use all of your repositories to make your daily work easier.
+Repo< will not compete with your favourite git clients, so keep them. It's not about working within a repository: It's a new way to use all of your repositories to make your daily work easier.
π¦ [Check the Releases page](https://github.com/coenm/RepoM/releases) to **download** the latest version and see **what's new**!
-~~π« Available on [chocolatey](https://chocolatey.org/packages/repoz) as well, just use `choco install repoz`.~~
-
## The Hub
-The hub provides a quick overview of your repositories including their current branch and a short status information. Additionally, it offers some shortcuts like revealing a repository in the Windows Explorer or macOS Finder, opening a command line tool in a given repository and checking out git branches.
-RepoZ is available for Windows and macOS.
+The hub provides a quick overview of your repositories including their current branch and a short status information. Additionally, it offers some shortcuts like revealing a repository in the Windows Explorer, opening a command line tool in a given repository and checking out git branches.

-
> **"Well ok, that's a neat summary ..."** you might say **"... but how does this help?"**.
If you are working on different git repositories throughout the day, you might find yourself wasting time by permanently switching over from one repository to another. If you are like me, you tend to keep all those windows open to be reused later, ending up on a window list which has to be looped through all the time.
@@ -26,37 +22,16 @@ With RepoZ, you can instantly jump into a given repository with a file browser o

-For Windows, use the hotkeys Ctrl+Alt+R to show RepoZ. On Mac it's Command+Alt+R*.
+For Windows, use the hotkeys Ctrl+Alt+R to show RepoM.
To open a file browser, simply press Return on the keyboard once you selected a repository. To open a command prompt instead, hold Ctrl on Windows or Command on macOS while pressing Return. These modifier keys will also work with mouse navigation.
-* On Mac you need to give RepoZ access to the [keyboard events in the system privacy settings](http://mizage.com/help/accessibility.html). Once you have done this, you might need to restart the app.
-
-## Command Line Sidekick
-RepoZ is a UI-centered tool but comes with a sidekick app called **grr** to empower the command line hackers.
-With **grr**, the information from RepoZ can be brought to any command line tool.
-
-It supports ...
- - listing all repositories found in RepoZ including their branch and status information
- - filtering for repository [names, branches or paths](https://github.com/awaescher/RepoZ/issues/68#issuecomment-478764341) (to list or jump) by RegEx patterns, like `grr [M.*]`
- - jumping directly to a repository path by adding the `cd` command, like `grr cd MyRepo`
- - opening a file browser in a repository from anywhere in your command prompt with `grr open MyRepo`
- - list files in a repository following a pattern with `grr list MyRepo *.sln` (add `-r` for recursive search)
- - open files in a repository directly with `grr open MyRepo *.sln` (add `-e` for elevated mode, "as Admin")
-
-See it in action in a ([styled](https://github.com/awaescher/PoshX)) powershell console:
-
-
-
-#### Don't forget to have a look at `grr help` once you get your hands on.
-
## Enhanced Windows Explorer Titles
+
As an extra goodie for Windows users, RepoZ automatically detects open File Explorer windows and adds a status appendix to their title if they are in context of a git repository.

-## Dependencies β οΈ
-Some user [reported crashes at program start](https://github.com/awaescher/RepoZ/issues/83). Please make sure to install the [.NET Framework Runtime v4.7.2](http://go.microsoft.com/fwlink/?LinkId=863262) if you experience similar issues.
-
## Credits
-The **grr** app icon was made by Freepik from www.flaticon.com and is licensed by CC 3.0 BY
+
+RepoM is a fork of the amazing RepoZ, which was created by [Screenshot](https://github.com/awaescher/RepoZ).
diff --git a/RepoM.sln b/RepoM.sln
index 1d3255e2..5802ec6e 100644
--- a/RepoM.sln
+++ b/RepoM.sln
@@ -9,12 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.App", "src\RepoM.App\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Specs", "tests\Specs\Specs.csproj", "{C91C3255-637F-45D4-93C0-6A26B4E99FC1}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GrrUi.App", "src\GrrUi.App\GrrUi.App.csproj", "{350BAB52-335E-4D14-B46A-9A6CF0786519}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Ipc", "src\RepoM.Ipc\RepoM.Ipc.csproj", "{B38E49E8-4691-4D3B-982E-41F8E8B527E3}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Grr.App", "src\Grr.App\Grr.App.csproj", "{D5772395-C27C-4BB5-86DA-42DF7388A19B}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Api", "src\RepoM.Api\RepoM.Api.csproj", "{699FA61D-A44D-4710-A6DD-52016DAC51D7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Plugin.LuceneSearch", "src\RepoM.Plugin.LuceneSearch\RepoM.Plugin.LuceneSearch.csproj", "{409FE957-77C4-40E9-80F2-EBE26676645E}"
@@ -25,8 +19,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Plugin.WindowsExplore
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{D6E372DC-10D3-4997-9DFC-568B4666635A}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Plugin.IpcService", "src\RepoM.Plugin.IpcService\RepoM.Plugin.IpcService.csproj", "{01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Plugin.EverythingFileSearch", "src\RepoM.Plugin.EverythingFileSearch\RepoM.Plugin.EverythingFileSearch.csproj", "{C85EAF73-3491-4C67-9047-B677CC999184}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Plugin.SonarCloud", "src\RepoM.Plugin.SonarCloud\RepoM.Plugin.SonarCloud.csproj", "{F780A2C4-0DAD-4DAA-AF2E-7B35683535EB}"
@@ -39,8 +31,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Plugin.AzureDevOps.Te
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Api.Tests", "tests\RepoM.Api.Tests\RepoM.Api.Tests.csproj", "{A798CB57-4743-4486-BF0E-93F7563A542B}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Ipc.Tests", "tests\RepoM.Ipc.Tests\RepoM.Ipc.Tests.csproj", "{82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RepoM.Core.Plugin", "src\RepoM.Core.Plugin\RepoM.Core.Plugin.csproj", "{E38D9928-A0A6-4978-BD7E-C7F2E2B6BC9B}"
EndProject
Global
@@ -117,66 +107,6 @@ Global
{C91C3255-637F-45D4-93C0-6A26B4E99FC1}.Release|x64.Build.0 = Release|Any CPU
{C91C3255-637F-45D4-93C0-6A26B4E99FC1}.Release|x86.ActiveCfg = Release|Any CPU
{C91C3255-637F-45D4-93C0-6A26B4E99FC1}.Release|x86.Build.0 = Release|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Debug|ARM.Build.0 = Debug|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Debug|ARM64.Build.0 = Debug|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Debug|x64.ActiveCfg = Debug|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Debug|x64.Build.0 = Debug|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Debug|x86.ActiveCfg = Debug|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Debug|x86.Build.0 = Debug|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Release|Any CPU.Build.0 = Release|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Release|ARM.ActiveCfg = Release|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Release|ARM.Build.0 = Release|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Release|ARM64.ActiveCfg = Release|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Release|ARM64.Build.0 = Release|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Release|x64.ActiveCfg = Release|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Release|x64.Build.0 = Release|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Release|x86.ActiveCfg = Release|Any CPU
- {350BAB52-335E-4D14-B46A-9A6CF0786519}.Release|x86.Build.0 = Release|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Debug|ARM.Build.0 = Debug|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Debug|ARM64.Build.0 = Debug|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Debug|x64.ActiveCfg = Debug|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Debug|x64.Build.0 = Debug|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Debug|x86.ActiveCfg = Debug|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Debug|x86.Build.0 = Debug|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Release|Any CPU.Build.0 = Release|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Release|ARM.ActiveCfg = Release|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Release|ARM.Build.0 = Release|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Release|ARM64.ActiveCfg = Release|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Release|ARM64.Build.0 = Release|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Release|x64.ActiveCfg = Release|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Release|x64.Build.0 = Release|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Release|x86.ActiveCfg = Release|Any CPU
- {B38E49E8-4691-4D3B-982E-41F8E8B527E3}.Release|x86.Build.0 = Release|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Debug|ARM.Build.0 = Debug|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Debug|ARM64.Build.0 = Debug|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Debug|x64.ActiveCfg = Debug|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Debug|x64.Build.0 = Debug|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Debug|x86.ActiveCfg = Debug|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Debug|x86.Build.0 = Debug|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Release|Any CPU.Build.0 = Release|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Release|ARM.ActiveCfg = Release|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Release|ARM.Build.0 = Release|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Release|ARM64.ActiveCfg = Release|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Release|ARM64.Build.0 = Release|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Release|x64.ActiveCfg = Release|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Release|x64.Build.0 = Release|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Release|x86.ActiveCfg = Release|Any CPU
- {D5772395-C27C-4BB5-86DA-42DF7388A19B}.Release|x86.Build.0 = Release|Any CPU
{699FA61D-A44D-4710-A6DD-52016DAC51D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{699FA61D-A44D-4710-A6DD-52016DAC51D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{699FA61D-A44D-4710-A6DD-52016DAC51D7}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -257,26 +187,6 @@ Global
{6214312F-61F1-4F4C-A9E2-3383987DE266}.Release|x64.Build.0 = Release|Any CPU
{6214312F-61F1-4F4C-A9E2-3383987DE266}.Release|x86.ActiveCfg = Release|Any CPU
{6214312F-61F1-4F4C-A9E2-3383987DE266}.Release|x86.Build.0 = Release|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Debug|ARM.Build.0 = Debug|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Debug|ARM64.Build.0 = Debug|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Debug|x64.ActiveCfg = Debug|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Debug|x64.Build.0 = Debug|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Debug|x86.ActiveCfg = Debug|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Debug|x86.Build.0 = Debug|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Release|Any CPU.Build.0 = Release|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Release|ARM.ActiveCfg = Release|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Release|ARM.Build.0 = Release|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Release|ARM64.ActiveCfg = Release|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Release|ARM64.Build.0 = Release|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Release|x64.ActiveCfg = Release|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Release|x64.Build.0 = Release|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Release|x86.ActiveCfg = Release|Any CPU
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE}.Release|x86.Build.0 = Release|Any CPU
{C85EAF73-3491-4C67-9047-B677CC999184}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C85EAF73-3491-4C67-9047-B677CC999184}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C85EAF73-3491-4C67-9047-B677CC999184}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -397,26 +307,6 @@ Global
{A798CB57-4743-4486-BF0E-93F7563A542B}.Release|x64.Build.0 = Release|Any CPU
{A798CB57-4743-4486-BF0E-93F7563A542B}.Release|x86.ActiveCfg = Release|Any CPU
{A798CB57-4743-4486-BF0E-93F7563A542B}.Release|x86.Build.0 = Release|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Debug|ARM.Build.0 = Debug|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Debug|ARM64.Build.0 = Debug|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Debug|x64.ActiveCfg = Debug|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Debug|x64.Build.0 = Debug|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Debug|x86.ActiveCfg = Debug|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Debug|x86.Build.0 = Debug|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Release|Any CPU.Build.0 = Release|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Release|ARM.ActiveCfg = Release|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Release|ARM.Build.0 = Release|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Release|ARM64.ActiveCfg = Release|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Release|ARM64.Build.0 = Release|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Release|x64.ActiveCfg = Release|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Release|x64.Build.0 = Release|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Release|x86.ActiveCfg = Release|Any CPU
- {82F7BFA8-E679-4CD7-BC46-DB53C9C226D2}.Release|x86.Build.0 = Release|Any CPU
{E38D9928-A0A6-4978-BD7E-C7F2E2B6BC9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E38D9928-A0A6-4978-BD7E-C7F2E2B6BC9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E38D9928-A0A6-4978-BD7E-C7F2E2B6BC9B}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -445,7 +335,6 @@ Global
{409FE957-77C4-40E9-80F2-EBE26676645E} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
{48ED60BB-E01F-4395-978E-D25C11C25E52} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
{6214312F-61F1-4F4C-A9E2-3383987DE266} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
- {01F564A1-BA9F-4BC4-A3AF-D9CDE4B654DE} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
{C85EAF73-3491-4C67-9047-B677CC999184} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
{F780A2C4-0DAD-4DAA-AF2E-7B35683535EB} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
{74B95BAF-0DB4-42C8-92EA-A364E8080809} = {D6E372DC-10D3-4997-9DFC-568B4666635A}
diff --git a/RepoM.sln.DotSettings b/RepoM.sln.DotSettings
index 64364c71..7f128dd7 100644
--- a/RepoM.sln.DotSettings
+++ b/RepoM.sln.DotSettings
@@ -2,7 +2,6 @@
TrueTrueTrue
- TrueTrueTrueTrue
diff --git a/_setup/RepoM.nsi b/_setup/RepoM.nsi
index ef16f536..3fcfb916 100644
--- a/_setup/RepoM.nsi
+++ b/_setup/RepoM.nsi
@@ -52,7 +52,7 @@ Section "RepoM"
File /r ..\_output\win\Assemblies\*.*
File ..\_ref\PathEd.exe ; Add PathEd.exe to add the RepoM directory to the system's PATH easily
- File ..\_ref\SendKeys.exe ; Add SendKeys.exe to add the RepoM directory for grr and grrui
+ ; File ..\_ref\SendKeys.exe ; Add SendKeys.exe to add the RepoM directory for grr.
File ..\_ref\RepositoryActions.json ; Can be copied in-app for the default settings
File ..\_ref\RepositoryActions.yaml ; Can be copied in-app for the default settings
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}.lnk" $INSTDIR\${PRODUCT_NAME}.exe
diff --git a/src/Grr.App/CommandLineOptions.cs b/src/Grr.App/CommandLineOptions.cs
deleted file mode 100644
index 91755492..00000000
--- a/src/Grr.App/CommandLineOptions.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-namespace Grr.App;
-
-using System;
-using System.Linq;
-using CommandLine;
-using CommandLine.Text;
-
-[Verb("list", HelpText = "(Default) Lists the repositories found by RepoM including their current branch and the corresponding status. Can be omitted like shown in the examples below.")]
-public class ListOptions : RepositoryFilterOptions { }
-
-[Verb("cd", HelpText = "Causes the command line interface to navigate to the directory of a given repository.")]
-public class ChangeDirectoryOptions : RepositoryFilterOptions { }
-
-[Verb("gd", HelpText = "Returns the main directory of a given repository and puts it into the clipboard")]
-public class GetDirectoryOptions : RepositoryFilterOptions { }
-
-[Verb("open", HelpText = "Opens the directory or a file of a given repository with the operating system's default application.")]
-public class OpenDirectoryOptions : RepositoryFilterOptions { }
-
-partial class CommandLineOptions
-{
- public const string LIST_COMMAND = "list";
- public const string CHANGE_DIRECTORY_COMMAND = "cd";
- public const string GET_DIRECTORY_COMMAND = "gd";
- public const string OPEN_DIRECTORY_COMMAND = "open";
-
- public const string HELP_COMMAND = "help";
- public const char HELP_COMMAND_CHAR = '?';
-
- public static string[] GetKnownCommands()
- {
- return new string[]
- {
- LIST_COMMAND,
- CHANGE_DIRECTORY_COMMAND,
- GET_DIRECTORY_COMMAND,
- OPEN_DIRECTORY_COMMAND,
- HELP_COMMAND,
- HELP_COMMAND_CHAR.ToString(),
- };
- }
-
- public static bool IsKnownArgument(string arg)
- {
- arg = arg.TrimStart('-').TrimStart('/');
- return GetKnownCommands().Contains(arg, StringComparer.OrdinalIgnoreCase);
- }
-
- public static string GetUsage()
- {
- var help = new HelpText
- {
- Heading = HeadingInfo.Default,
- Copyright = CopyrightInfo.Default,
- AdditionalNewLineAfterOption = true,
- AddDashesToOption = false,
- MaximumDisplayWidth = 100
- };
-
- var knownCommandsPiped = string.Join("|", GetKnownCommands());
- help.AddPreOptionsLine(" ");
- help.AddPreOptionsLine(" ");
- help.AddPreOptionsLine("USAGE:");
- help.AddPreOptionsLine($" grr [{knownCommandsPiped}] [repository filter or RegEx pattern] [file filter] [file options]");
- help.AddPreOptionsLine(" ");
- help.AddPreOptionsLine(" ");
- help.AddPreOptionsLine(" ");
-
- help.AddPreOptionsLine("COMMANDS:");
- help.AddVerbs(typeof(ListOptions), typeof(ChangeDirectoryOptions), typeof(OpenDirectoryOptions));
-
- help.AddPostOptionsLine(" ");
- help.AddPostOptionsLine("FILTERS:");
- help.AddPostOptionsLine("β Repository filter or RegEx pattern:");
- help.AddPostOptionsLine("β The filter pattern to find matching repositories with a like search.");
- help.AddPostOptionsLine("β If a like search is too broad, use a RegEx pattern instead by adding square brackets.");
- help.AddPostOptionsLine("β Like [.*Z] for all repositories ending with \"Z\".");
- help.AddPostOptionsLine("β Note that you should put the filter or RegEx pattern in quotes if it contains spaces.");
- help.AddPostOptionsLine("β");
- help.AddPostOptionsLine("β File name or filter:");
- help.AddPostOptionsLine("β The filter pattern to find matching files of a given repository with a like search.");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("OPTIONS:");
- help.AddPostOptionsLine("β --recursive or -r:");
- help.AddPostOptionsLine("β Enables recursive search in subdirectories of a given Git repository.");
- help.AddPostOptionsLine("β Compatible with commands: \"list\" and \"open\"");
- help.AddPostOptionsLine("β");
- help.AddPostOptionsLine("β --elevated or -e:");
- help.AddPostOptionsLine("β Invokes the UAC dialog to request elevated priviledges for the process to open.");
- help.AddPostOptionsLine("β Compatible with commands: \"open\"");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("");
-
- help.AddPostOptionsLine("EXAMPLES:");
- help.AddPostOptionsLine("β (to keep the examples short, \"Repo\" is used as placeholder for a repository name");
- help.AddPostOptionsLine("β like \"RepoM\" or \"NSidekick\", for example)");
- help.AddPostOptionsLine("");
-
- help.AddPostOptionsLine("Basics:");
- help.AddPostOptionsLine("β grr \t\t\tLists all repositories found in RepoM including their status");
- help.AddPostOptionsLine("β grr list Repo\tShows the status of a given repository (command \"list\" is optional)");
- help.AddPostOptionsLine("β grr cd Repo\t\tNavigates to the main directory of a given repository");
- help.AddPostOptionsLine("β grr gd Repo\t\tReturns the main directory of a given repository and puts it into the clipboard");
- help.AddPostOptionsLine("β grr open Repo\tOpens the main directory of a given repository (in Windows Explorer)");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("Predefined filters:");
- help.AddPostOptionsLine("β grr todo\t\tLists repositories with unpushed changes (file changes, stashes and more)");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("Filter targets:");
- help.AddPostOptionsLine("β grr Repo\t\tBy default, filters are applied to the repository name");
- help.AddPostOptionsLine("β grr \"n Repo\"\t\tThe prefix \"n \" forces RepoM to filter for repository names (optional)");
- help.AddPostOptionsLine("β grr \"b master\"\tThe prefix \"b \" forces RepoM to filter for repository branches");
- help.AddPostOptionsLine("β grr \"p C:\\\"\t\tThe prefix \"p \" forces RepoM to filter for repository paths");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("File operations in given repositories:");
- help.AddPostOptionsLine("β grr list Repo *.txt\tLists all text files in the given repository matching the filter *.txt");
- help.AddPostOptionsLine("β grr open Repo *.sln\tOpens the Visual Studio solutions in the given repository");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("RegEx patterns for advanced repository filtering (note the square brackets):");
- help.AddPostOptionsLine("β grr list [.*_.*]\tLists all repositories containing a \"_\"");
- help.AddPostOptionsLine("β grr cd [Re.*]\tNavigates to the first repository starting with \"Re\"");
- help.AddPostOptionsLine("β grr open [.*Z] *.sln\tOpens each Visual Studio solution in every repository ending with \"Z\"");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("Advanced: grr defines indexes for found repositories. They can be used for the next execution:");
- help.AddPostOptionsLine("β grr list :3 \t\tShows the branch and status of the repository at index 3");
- help.AddPostOptionsLine("β grr open :1 *.sln -e\tOpens the Visual Studio solutions of the repository at index 1 as Admin");
- help.AddPostOptionsLine("β grr list :3 *.* -r\tLists all files of the repository at index 3 recursively");
- help.AddPostOptionsLine("β grr cd :21 \t\tNavigates to the repository at index 21");
- help.AddPostOptionsLine("");
- help.AddPostOptionsLine("Bonus:");
- help.AddPostOptionsLine("β grr cd - \t\tNavigates back to the last path grr was called from");
- help.AddPostOptionsLine(" ");
- help.AddPostOptionsLine("Noteworthy:");
- help.AddPostOptionsLine("βββThe parameter \"list\" can be omitted, \"grr [.*_.*]\" has the same effect.");
- help.AddPostOptionsLine("βββPut your filter in quotes if it contains spaces.");
- help.AddPostOptionsLine("βββRepoM has to be running on this system to use grr.");
- help.AddPostOptionsLine("");
-
- return help.ToString();
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/ConsoleExtensions.cs b/src/Grr.App/ConsoleExtensions.cs
deleted file mode 100644
index d37fad69..00000000
--- a/src/Grr.App/ConsoleExtensions.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-namespace Grr.App;
-
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.IO;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[SuppressMessage("ReSharper", "FieldCanBeMadeReadOnly.Local")]
-internal static class ConsoleExtensions
-{
- ///
- /// A utility class to determine a process parent.
- ///
- [SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Not sure if naming can be altered")]
- [SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Not sure if naming can be altered")]
- [StructLayout(LayoutKind.Sequential)]
- public struct ParentProcessUtilities
- {
- // These members must match PROCESS_BASIC_INFORMATION
- private IntPtr Reserved1;
- private IntPtr PebBaseAddress;
- private IntPtr Reserved2_0;
- private IntPtr Reserved2_1;
- private IntPtr UniqueProcessId;
- private IntPtr InheritedFromUniqueProcessId;
-
- [DllImport("ntdll.dll")]
- private static extern int NtQueryInformationProcess(
- IntPtr processHandle,
- int processInformationClass,
- ref ParentProcessUtilities processInformation,
- int processInformationLength,
- out int returnLength);
-
- ///
- /// Gets the parent process of the current process.
- ///
- /// An instance of the Process class.
- public static Process? GetParentProcess()
- {
- return GetParentProcess(Process.GetCurrentProcess().Handle);
- }
-
- ///
- /// Gets the parent process of specified process.
- ///
- /// The process id.
- /// An instance of the Process class.
- public static Process? GetParentProcess(int id)
- {
- var process = Process.GetProcessById(id);
- return GetParentProcess(process.Handle);
- }
-
- ///
- /// Climbs up the process tree to find the windowed process where SendKey can send the command keys to
- ///
- /// The process id
- /// First parent in the process tree with window handle
- internal static Process? GetWindowedParentProcess(in int id)
- {
- var process = Process.GetProcessById(id);
-
- while (process.MainWindowHandle == IntPtr.Zero)
- {
- Process lastProcess = process;
- process = GetParentProcess(process.Handle);
-
- if (process == null)
- {
- break;
- }
-
- // Better a result without window handle than an infinite loop
- if (lastProcess == process)
- {
- break;
- }
- }
-
- return process;
- }
-
- ///
- /// Gets the parent process of a specified process.
- ///
- /// The process handle.
- /// An instance of the Process class.
- private static Process? GetParentProcess(IntPtr handle)
- {
- var pbi = new ParentProcessUtilities();
- var status = NtQueryInformationProcess(handle, 0, ref pbi, Marshal.SizeOf(pbi), out _);
- if (status != 0)
- {
- throw new Win32Exception(status);
- }
-
- try
- {
- return Process.GetProcessById(pbi.InheritedFromUniqueProcessId.ToInt32());
- }
- catch (ArgumentException)
- {
- // not found
- return null;
- }
- }
- }
-
- public static void WriteConsoleInput(Process target, string value, int waitMilliseconds = 0)
- {
- PrintDebug($"Write {value} to console input {target.ProcessName} ({target.Id})");
-
- // Find the first process in the process tree which has a windows handle
- Process? parentProcess = ParentProcessUtilities.GetWindowedParentProcess(target.Id);
- if (parentProcess == null)
- {
- // could not find parent to send key press to.
- return;
- }
-
- PrintDebug($"Found a process, writing to process {parentProcess.ProcessName} ({parentProcess.Id})");
-
- // send CTRL+V with Enter to insert the command
- var arguments = "^v{Enter}";
-
- arguments = $"-pid:{parentProcess.Id} \"{arguments}\"";
-
- if (waitMilliseconds > 0)
- {
- arguments += $" -wait:{waitMilliseconds}";
- }
-
- var currentPath = Path.GetDirectoryName(Path.Combine(Assembly.GetExecutingAssembly().Location));
- var command = Path.Combine(currentPath ?? string.Empty, "SendKeys.exe");
-
- // todo, in future, use IFileSystem
- if (File.Exists(command))
- {
- Process.Start(new ProcessStartInfo(command, arguments) { UseShellExecute = true, });
- }
- else
- {
- Console.WriteLine(command + " does not exist.");
- }
- }
-
- private static void PrintDebug(string value)
- {
- Debug.WriteLine(value);
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Grr.App.csproj b/src/Grr.App/Grr.App.csproj
deleted file mode 100644
index 153b2dbc..00000000
--- a/src/Grr.App/Grr.App.csproj
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
- Exe
- net6.0
- Andreas WΓ€scher
- Git Repositories of RepoM
- Command line interface to query repository information from RepoM
- https://raw.githubusercontent.com/awaescher/RepoZ/master/grr/grr.ico
- grr
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ..\..\_ref\SendKeys.exe
- true
-
-
-
diff --git a/src/Grr.App/History/FileHistoryRepository.cs b/src/Grr.App/History/FileHistoryRepository.cs
deleted file mode 100644
index 4f40c070..00000000
--- a/src/Grr.App/History/FileHistoryRepository.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-namespace Grr.App.History;
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.IO.Abstractions;
-using System.Linq;
-using System.Text;
-using RepoM.Ipc;
-
-public class FileHistoryRepository : IHistoryRepository
-{
- private readonly IFileSystem _fileSystem;
-
- public FileHistoryRepository(IFileSystem fileSystem)
- {
- _fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));
- }
-
- public void Save(State state)
- {
- // if multiple repositories were found the last time we ran grr,
- // these were written to the last state.
- // if the user selects one with an index like "grr cd :2", we want
- // to keep the last repositories to enable him to choose another one
- // with the same indexes as before.
- // so we have to get the old repositories - load and copy them if required
- if (!state.OverwriteRepositories)
- {
- State oldState = Load();
- if (oldState.LastRepositories?.Length > 0)
- {
- state.LastRepositories = oldState.LastRepositories;
- }
- }
-
- var lines = new []
- {
- state.LastLocation ?? string.Empty,
- Serialize(state.LastRepositories ?? Array.Empty()),
- };
-
- try
- {
- _fileSystem.File.WriteAllLines(GetFileName(), lines, Encoding.Default);
- }
- catch (Exception)
- {
- /* safely ignore this, saving the state is optional */
- }
- }
-
- public State Load()
- {
- var lines = Array.Empty();
-
- try
- {
- lines = _fileSystem.File.ReadAllLines(GetFileName(), Encoding.Default);
- }
- catch
- {
- /* safely ignore this, reading the state is optional */
- }
-
- if (lines.Length != 2)
- {
- return new State()
- {
- LastLocation = string.Empty,
- LastRepositories = Array.Empty(),
- };
- }
-
- return new State()
- {
- LastLocation = lines[0],
- LastRepositories = Deserialize(lines[1]),
- };
- }
-
- private static string GetFileName()
- {
- return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RepoM", "state.grr");
- }
-
- private static string Serialize(IEnumerable repositories)
- {
- var names = repositories
- .Select(r => r.Name)
- .ToArray();
-
- if (!names.Any())
- {
- return string.Empty;
- }
-
- return string.Join("|", names);
- }
-
- private static Repository[] Deserialize(string repositoryString)
- {
- if (string.IsNullOrEmpty(repositoryString))
- {
- return Array.Empty();
- }
-
- return repositoryString
- .Split(new [] { "|", }, StringSplitOptions.None)
- .Select(s => new Repository(s))
- .ToArray();
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/History/IHistoryRepository.cs b/src/Grr.App/History/IHistoryRepository.cs
deleted file mode 100644
index a69f3eaa..00000000
--- a/src/Grr.App/History/IHistoryRepository.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Grr.App.History;
-
-public interface IHistoryRepository
-{
- State Load();
-
- void Save(State state);
-}
\ No newline at end of file
diff --git a/src/Grr.App/History/State.cs b/src/Grr.App/History/State.cs
deleted file mode 100644
index 165e7f19..00000000
--- a/src/Grr.App/History/State.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace Grr.App.History;
-
-using RepoM.Ipc;
-
-public class State
-{
- public Repository[]? LastRepositories { get; set; }
-
- public bool OverwriteRepositories { get; set; }
-
- public string? LastLocation { get; set; }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/ChangeToDirectoryMessage.cs b/src/Grr.App/Messages/ChangeToDirectoryMessage.cs
deleted file mode 100644
index 171f8b0e..00000000
--- a/src/Grr.App/Messages/ChangeToDirectoryMessage.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-namespace Grr.App.Messages;
-
-using System;
-using System.Diagnostics;
-using System.IO.Abstractions;
-using System.Runtime.InteropServices;
-using RepoM.Ipc;
-
-[DebuggerDisplay("{GetRemoteCommand()}")]
-public class ChangeToDirectoryMessage : DirectoryMessage
-{
- public ChangeToDirectoryMessage(RepositoryFilterOptions filter, IFileSystem fileSystem)
- : base(filter, fileSystem) { }
-
- protected override void ExecuteExistingDirectory(string directory)
- {
- var command = $"cd \"{directory}\"";
-
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- // type the path into the console which is hosting grr.exe to change to the directory
- TextCopy.ClipboardService.SetText(command);
- ConsoleExtensions.WriteConsoleInput(Process.GetCurrentProcess(), command);
- }
- else
- {
- TextCopy.ClipboardService.SetText(command);
- Console.ForegroundColor = ConsoleColor.Cyan;
- Console.WriteLine("The command was copied to the clipboard, paste and execute it manually now.\nChanging directories is not supported on macOS yet, sorry.");
- Console.ResetColor();
- }
- }
-
- protected override void ExecuteRepositoryQuery(Repository[] repositories)
- {
- if (repositories.Length > 1)
- {
- // only use the first repository when multiple repositories came in
- // cd makes no sense with multiple repositories
- System.Console.WriteLine("");
- System.Console.WriteLine($"Found multiple repositories, using {repositories[0].Name}.");
- System.Console.WriteLine("You can access the others by index now, like:\n grr cd :2");
- base.ExecuteRepositoryQuery(new Repository[] { repositories[0], });
- }
- else
- {
- base.ExecuteRepositoryQuery(repositories);
- }
- }
-
- public override bool ShouldWriteRepositories(Repository[] repositories)
- {
- return true;
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/DirectoryMessage.cs b/src/Grr.App/Messages/DirectoryMessage.cs
deleted file mode 100644
index e2e4f9d7..00000000
--- a/src/Grr.App/Messages/DirectoryMessage.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-namespace Grr.App.Messages;
-
-using System;
-using System.IO.Abstractions;
-using RepoM.Ipc;
-
-[System.Diagnostics.DebuggerDisplay("{GetRemoteCommand()}")]
-public abstract class DirectoryMessage : IMessage
-{
- private readonly bool _argumentIsExistingDirectory;
- private protected readonly IFileSystem FileSystem;
-
- protected DirectoryMessage(RepositoryFilterOptions filter, IFileSystem fileSystem)
- {
- Filter = filter ?? throw new ArgumentNullException(nameof(filter));
- FileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));
- _argumentIsExistingDirectory = FileSystem.Directory.Exists(Filter.RepositoryFilter);
- }
-
- public void Execute(Repository[] repositories)
- {
- if (_argumentIsExistingDirectory)
- {
- ExecuteExistingDirectoryWithSafetyCheck(Filter.RepositoryFilter);
- }
- else
- {
- ExecuteRepositoryQuery(repositories);
- }
- }
-
- private void ExecuteExistingDirectoryWithSafetyCheck(string? directory)
- {
- if (directory == null)
- {
- return;
- }
-
- // use '/' for linux systems and bash command line (will work on cmd and powershell as well)
- directory = directory.Replace(@"\", "/");
- ExecuteExistingDirectory(directory);
- }
-
- protected abstract void ExecuteExistingDirectory(string directory);
-
- protected virtual void ExecuteRepositoryQuery(Repository[] repositories)
- {
- if (repositories.Length == 0)
- {
- return;
- }
-
- foreach (Repository repository in repositories)
- {
- var directory = repository.SafePath;
-
- if (string.IsNullOrWhiteSpace(directory))
- {
- System.Console.WriteLine("Repository path is empty. Aborting.");
- return;
- }
-
- if (FileSystem.Directory.Exists(directory))
- {
- ExecuteExistingDirectoryWithSafetyCheck(directory);
- }
- else
- {
- System.Console.WriteLine("Repository path does not exist:\n" + directory);
- }
- }
- }
-
- public virtual string? GetRemoteCommand()
- {
- if (!HasRemoteCommand)
- {
- return null;
- }
-
- return string.IsNullOrEmpty(Filter?.RepositoryFilter)
- ? null /* makes no sense */
- : $"list:{RegexFilter.Get(Filter.RepositoryFilter)}";
- }
-
- public virtual bool HasRemoteCommand
- {
- get
- {
- if (_argumentIsExistingDirectory)
- {
- return false;
- }
-
- return !string.IsNullOrEmpty(Filter?.RepositoryFilter);
- }
- }
-
- public abstract bool ShouldWriteRepositories(Repository[] repositories);
-
- public RepositoryFilterOptions Filter { get; }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/FileMessage.cs b/src/Grr.App/Messages/FileMessage.cs
deleted file mode 100644
index bc69dc13..00000000
--- a/src/Grr.App/Messages/FileMessage.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-namespace Grr.App.Messages;
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.IO.Abstractions;
-using System.Linq;
-
-[System.Diagnostics.DebuggerDisplay("{GetRemoteCommand()}")]
-public abstract class FileMessage : DirectoryMessage
-{
- protected FileMessage(RepositoryFilterOptions filter, IFileSystem fileSystem)
- : base(filter, fileSystem)
- {
- }
-
- protected override void ExecuteExistingDirectory(string directory)
- {
- string[] items;
-
- try
- {
- items = FindItems(directory, Filter).ToArray();
- }
- catch (Exception ex)
- {
- Console.WriteLine("An error occurred:\n" + ex.ToString());
- return;
- }
-
- if (items.Length == 0)
- {
- System.Console.WriteLine($"No files found.\n Directory:\t{directory}\n Filter:\t{Filter.FileFilter}");
- return;
- }
-
- ExecuteFound(items);
- }
-
- protected virtual IEnumerable FindItems(string directory, RepositoryFilterOptions filter)
- {
- SearchOption searchOption = Filter.RecursiveFileFilter
- ? SearchOption.AllDirectories
- : SearchOption.TopDirectoryOnly;
-
- return FileSystem.Directory.GetFiles(directory, filter.FileFilter, searchOption)
- .OrderBy(i => i);
- }
-
- protected abstract void ExecuteFound(string[] files);
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/Filters/GoBackMessageFilter.cs b/src/Grr.App/Messages/Filters/GoBackMessageFilter.cs
deleted file mode 100644
index 8f55c84a..00000000
--- a/src/Grr.App/Messages/Filters/GoBackMessageFilter.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-namespace Grr.App.Messages.Filters;
-
-using System;
-using Grr.App.History;
-
-public class GoBackMessageFilter : IMessageFilter
-{
- private readonly IHistoryRepository _historyRepository;
-
- public GoBackMessageFilter(IHistoryRepository historyRepository)
- {
- _historyRepository = historyRepository ?? throw new ArgumentNullException(nameof(historyRepository));
- }
-
- public void Filter(RepositoryFilterOptions filter)
- {
- var filterValue = filter?.RepositoryFilter ?? string.Empty;
-
- if ("-" == filterValue)
- {
- State state = _historyRepository.Load();
- if (filter != null)
- {
- filter.RepositoryFilter = state.LastLocation ?? filterValue;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/Filters/IMessageFilter.cs b/src/Grr.App/Messages/Filters/IMessageFilter.cs
deleted file mode 100644
index eabcf304..00000000
--- a/src/Grr.App/Messages/Filters/IMessageFilter.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Grr.App.Messages.Filters;
-
-public interface IMessageFilter
-{
- void Filter(RepositoryFilterOptions filter);
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/Filters/IndexMessageFilter.cs b/src/Grr.App/Messages/Filters/IndexMessageFilter.cs
deleted file mode 100644
index d1a1e6e5..00000000
--- a/src/Grr.App/Messages/Filters/IndexMessageFilter.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-namespace Grr.App.Messages.Filters;
-
-using System;
-using Grr.App.History;
-
-public class IndexMessageFilter : IMessageFilter
-{
- private readonly IHistoryRepository _historyRepository;
-
- public IndexMessageFilter(IHistoryRepository historyRepository)
- {
- _historyRepository = historyRepository ?? throw new ArgumentNullException(nameof(historyRepository));
- }
-
- public void Filter(RepositoryFilterOptions filter)
- {
- if (filter?.RepositoryFilter == null)
- {
- return;
- }
-
- if (!filter.RepositoryFilter.StartsWith(":"))
- {
- return;
- }
-
- var rest = filter.RepositoryFilter[1..];
- if (!int.TryParse(rest, out var index))
- {
- return;
- }
-
- index--; // the index visible to the user are 1-based, not 0-based
- State state = _historyRepository.Load();
- if (state.LastRepositories == null)
- {
- return;
- }
-
- if (index >= 0 && state.LastRepositories.Length > index)
- {
- filter.RepositoryFilter = state.LastRepositories[index]?.Name ?? filter.RepositoryFilter;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/GetDirectoryMessage.cs b/src/Grr.App/Messages/GetDirectoryMessage.cs
deleted file mode 100644
index 57758059..00000000
--- a/src/Grr.App/Messages/GetDirectoryMessage.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-namespace Grr.App.Messages;
-
-using System;
-using System.IO.Abstractions;
-using RepoM.Ipc;
-
-[System.Diagnostics.DebuggerDisplay("{GetRemoteCommand()}")]
-public class GetDirectoryMessage : DirectoryMessage
-{
- public GetDirectoryMessage(RepositoryFilterOptions filter, IFileSystem fileSystem)
- : base(filter, fileSystem)
- {
- }
-
- protected override void ExecuteExistingDirectory(string directory)
- {
- directory = $"\"{directory}\"";
-
- TextCopy.ClipboardService.SetText(directory);
- Console.WriteLine(directory);
- }
-
- protected override void ExecuteRepositoryQuery(Repository[] repositories)
- {
- if (repositories.Length > 1)
- {
- // only use the first repository when multiple repositories came in
- // cd makes no sense with multiple repositories
- System.Console.WriteLine("");
- System.Console.WriteLine($"Found multiple repositories, using {repositories[0].Name}.");
- System.Console.WriteLine("You can get the others by index now, like:\n grr gd :2");
- base.ExecuteRepositoryQuery(new Repository[] { repositories[0], });
- }
- else
- {
- base.ExecuteRepositoryQuery(repositories);
- }
- }
-
- public override bool ShouldWriteRepositories(Repository[] repositories)
- {
- return (repositories?.Length ?? 0) > 1;
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/IMessage.cs b/src/Grr.App/Messages/IMessage.cs
deleted file mode 100644
index fce10713..00000000
--- a/src/Grr.App/Messages/IMessage.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace Grr.App.Messages;
-
-using RepoM.Ipc;
-
-public interface IMessage
-{
- string? GetRemoteCommand();
-
- void Execute(Repository[] repositories);
-
- bool HasRemoteCommand { get; }
-
- bool ShouldWriteRepositories(Repository[] repositories);
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/ListRepositoriesMessage.cs b/src/Grr.App/Messages/ListRepositoriesMessage.cs
deleted file mode 100644
index 087b96f2..00000000
--- a/src/Grr.App/Messages/ListRepositoriesMessage.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-namespace Grr.App.Messages;
-
-using RepoM.Ipc;
-
-[System.Diagnostics.DebuggerDisplay("{GetRemoteCommand()}")]
-public class ListRepositoriesMessage : IMessage
-{
- private readonly string _repositoryFilter;
-
- public ListRepositoriesMessage()
- {
- _repositoryFilter = string.Empty;
- }
-
- public ListRepositoriesMessage(RepositoryFilterOptions filter)
- {
- _repositoryFilter = filter?.RepositoryFilter ?? string.Empty;
- }
-
- public void Execute(Repository[] repositories)
- {
- // nothing to do
- }
-
- public string GetRemoteCommand()
- {
- return string.IsNullOrEmpty(_repositoryFilter)
- ? "list:.*" /* show all with RegEx pattern ".*" */
- : $"list:{RegexFilter.Get(_repositoryFilter)}";
- }
-
- public bool HasRemoteCommand => true;
-
- public bool ShouldWriteRepositories(Repository[] repositories)
- {
- return true;
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/ListRepositoryFilesMessage.cs b/src/Grr.App/Messages/ListRepositoryFilesMessage.cs
deleted file mode 100644
index eb611589..00000000
--- a/src/Grr.App/Messages/ListRepositoryFilesMessage.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-namespace Grr.App.Messages;
-
-using System.Collections.Generic;
-using System.IO;
-using System.IO.Abstractions;
-using System.Linq;
-using RepoM.Ipc;
-
-[System.Diagnostics.DebuggerDisplay("{GetRemoteCommand()}")]
-public class ListRepositoryFilesMessage : FileMessage
-{
- public ListRepositoryFilesMessage(RepositoryFilterOptions filter, IFileSystem fileSystem)
- : base(filter, fileSystem)
- {
- }
-
- protected override void ExecuteFound(string[] files)
- {
- foreach (var file in files)
- {
- System.Console.WriteLine(file);
- }
- }
-
- protected override IEnumerable FindItems(string directory, RepositoryFilterOptions filter)
- {
- SearchOption searchOption = Filter.RecursiveFileFilter
- ? SearchOption.AllDirectories
- : SearchOption.TopDirectoryOnly;
-
- if (filter.FileFilter != null)
- {
- // todo Fix IFileSystem
- return /*FileSystem.*/Directory.GetFileSystemEntries(directory, filter.FileFilter, searchOption)
- .OrderBy(i => i);
- }
-
- return Enumerable.Empty();
-
- }
-
- public override bool ShouldWriteRepositories(Repository[] repositories)
- {
- return false;
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/OpenDirectoryMessage.cs b/src/Grr.App/Messages/OpenDirectoryMessage.cs
deleted file mode 100644
index db920100..00000000
--- a/src/Grr.App/Messages/OpenDirectoryMessage.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace Grr.App.Messages;
-
-using System.Diagnostics;
-using System.IO.Abstractions;
-using System.Runtime.InteropServices;
-using RepoM.Ipc;
-
-[System.Diagnostics.DebuggerDisplay("{GetRemoteCommand()}")]
-public class OpenDirectoryMessage : DirectoryMessage
-{
- public OpenDirectoryMessage(RepositoryFilterOptions filter, IFileSystem fileSystem)
- : base(filter, fileSystem)
- {
- }
-
- protected override void ExecuteExistingDirectory(string directory)
- {
- var directoryInQuotes = $"\"{directory}\"";
-
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- Process.Start(new ProcessStartInfo(directoryInQuotes) { UseShellExecute = true, });
- }
- else
- {
- Process.Start(new ProcessStartInfo("open", directoryInQuotes));
- }
- }
-
- public override bool ShouldWriteRepositories(Repository[] repositories)
- {
- return true;
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Messages/OpenFileMessage.cs b/src/Grr.App/Messages/OpenFileMessage.cs
deleted file mode 100644
index 2e8a31a1..00000000
--- a/src/Grr.App/Messages/OpenFileMessage.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-namespace Grr.App.Messages;
-
-using System;
-using System.Diagnostics;
-using System.IO.Abstractions;
-using System.Linq;
-using System.Runtime.InteropServices;
-using RepoM.Ipc;
-
-[System.Diagnostics.DebuggerDisplay("{GetRemoteCommand()}")]
-public class OpenFileMessage : FileMessage
-{
- public OpenFileMessage(RepositoryFilterOptions filter, IFileSystem fileSystem)
- : base(filter, fileSystem)
- {
- }
-
- protected override void ExecuteFound(string[] files)
- {
- foreach (var file in files)
- {
- System.Console.WriteLine($"Opening {file} ...");
-
- try
- {
- Process.Start(CreateStartInfo(file));
- }
- catch (System.Exception ex)
- {
- System.Console.WriteLine("An error occurred:\n" + ex.ToString());
- }
- }
- }
-
- private ProcessStartInfo CreateStartInfo(string file)
- {
- var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
-
- if (!Filter.RequestElevation)
- {
- if (isWindows)
- {
- return new ProcessStartInfo(file) { UseShellExecute = true, };
- }
- else
- {
- return new ProcessStartInfo("open", file);
- }
- }
-
- if (!isWindows)
- {
- throw new AccessViolationException("Elevation is not supported on this platform.");
- }
-
- var isExecutable = IsExecutable(file);
-
- // executables can be used directly, whereas files such as *.sln, for example,
- // have to been opened with (a hidden) cmd.exe to request elevation.
- // command is: cmd.exe /C "C:\Path\Solution.sln"
- var executable = isExecutable ? file : "cmd.exe";
- var arguments = isExecutable ? "" : $"/C \"{file}\"";
- ProcessWindowStyle windowStyle = isExecutable ? ProcessWindowStyle.Normal : ProcessWindowStyle.Hidden;
-
- return new ProcessStartInfo
- {
- UseShellExecute = true, // this with Verb=runas forces elevation
- CreateNoWindow = true,
- WindowStyle = windowStyle,
- FileName = executable,
- Verb = "runas", // this with ShellEx=true forces elevation
- Arguments = arguments,
- };
- }
-
- private static bool IsExecutable(string file)
- {
- var executables = new string[]
- {
- ".exe",
- ".bat",
- ".cmd",
- ".com",
- };
- return executables.Any(e => file.EndsWith(e, System.StringComparison.OrdinalIgnoreCase));
- }
-
- public override bool ShouldWriteRepositories(Repository[] repositories)
- {
- return false;
- }
-}
\ No newline at end of file
diff --git a/src/Grr.App/Program.cs b/src/Grr.App/Program.cs
deleted file mode 100644
index df5f605f..00000000
--- a/src/Grr.App/Program.cs
+++ /dev/null
@@ -1,262 +0,0 @@
-namespace Grr.App;
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO.Abstractions;
-using System.Linq;
-using System.Text;
-using CommandLine;
-using Grr.App.Messages;
-using Grr.App.Messages.Filters;
-using RepoM.Ipc;
-
-static class Program
-{
- private const int MAX_REPO_NAME_LENGTH = 35;
-
- private static readonly IFileSystem _fileSystem = new FileSystem();
-
- static void Main(string[] args)
- {
- Console.OutputEncoding = Encoding.UTF8;
-
- args = PrepareArguments(args);
-
- if (IsHelpRequested(args))
- {
- ShowHelp();
- }
- else
- {
- IMessage? message = TryParseArgumentsToMessage(args);
-
- if (message != null)
- {
- IpcClient.Result? result = null;
-
- if (message.HasRemoteCommand)
- {
- var client = new IpcClient(new DefaultIpcEndpoint());
- result = client.GetRepositories(message.GetRemoteCommand());
-
- if (result.Repositories?.Length > 0)
- {
- if (message.ShouldWriteRepositories(result.Repositories))
- {
- WriteRepositories(result.Repositories);
- }
- }
- else
- {
- Console.WriteLine(result.Answer);
- }
- }
-
- Repository[]? repositories = result?.Repositories;
-
- if (repositories != null)
- {
- message?.Execute(repositories);
-
- WriteHistory(repositories);
- }
- }
- else
- {
- Console.WriteLine("Could not parse command line arguments.");
- }
- }
-
- if (Debugger.IsAttached)
- {
- Console.ReadKey();
- }
- }
-
- private static IMessage? TryParseArgumentsToMessage(IReadOnlyList args)
- {
- try
- {
- ParserResult