Skip to content

Commit 56780f9

Browse files
committed
Merge branch 'release/v8.11'
2 parents d60a33a + 04185a7 commit 56780f9

34 files changed

+463
-126
lines changed

.github/workflows/ci.yml

Lines changed: 76 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,9 @@ on:
77
branches: [develop]
88
workflow_dispatch:
99
jobs:
10-
build:
11-
name: Build
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
include:
16-
- os: ubuntu-latest
17-
platform: linux-x64
18-
- os: windows-latest
19-
platform: win-x64
20-
- os: macos-latest
21-
platform: osx-x64
22-
- os: macos-latest
23-
platform: osx-arm64
24-
runs-on: ${{ matrix.os }}
10+
build-windows:
11+
name: Build Windows x64
12+
runs-on: windows-latest
2513
steps:
2614
- name: Checkout sources
2715
uses: actions/checkout@v4
@@ -34,9 +22,80 @@ jobs:
3422
- name: Build
3523
run: dotnet build -c Release
3624
- name: Publish
37-
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r ${{ matrix.platform }} -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
25+
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r win-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
3826
- name: Upload Artifact
3927
uses: actions/upload-artifact@v4
4028
with:
41-
name: ${{ matrix.platform }}
29+
name: sourcegit.win-x64
4230
path: publish
31+
build-macos-intel:
32+
name: Build macOS (Intel)
33+
runs-on: macos-latest
34+
steps:
35+
- name: Checkout sources
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
- name: Setup .NET
40+
uses: actions/setup-dotnet@v4
41+
with:
42+
dotnet-version: 8.0.x
43+
- name: Build
44+
run: dotnet build -c Release
45+
- name: Publish
46+
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
47+
- name: Packing Program
48+
run: tar -cvf sourcegit.osx-x64.tar publish/
49+
- name: Upload Artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: sourcegit.osx-x64
53+
path: sourcegit.osx-x64.tar
54+
build-macos-arm64:
55+
name: Build macOS (Apple Silicon)
56+
runs-on: macos-latest
57+
steps:
58+
- name: Checkout sources
59+
uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
- name: Setup .NET
63+
uses: actions/setup-dotnet@v4
64+
with:
65+
dotnet-version: 8.0.x
66+
- name: Build
67+
run: dotnet build -c Release
68+
- name: Publish
69+
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-arm64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
70+
- name: Packing Program
71+
run: tar -cvf sourcegit.osx-arm64.tar publish/
72+
- name: Upload Artifact
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: sourcegit.osx-arm64
76+
path: sourcegit.osx-arm64.tar
77+
build-linux:
78+
name: Build Linux
79+
runs-on: ubuntu-latest
80+
steps:
81+
- name: Checkout sources
82+
uses: actions/checkout@v4
83+
with:
84+
fetch-depth: 0
85+
- name: Setup .NET
86+
uses: actions/setup-dotnet@v4
87+
with:
88+
dotnet-version: 8.0.x
89+
- name: Build
90+
run: dotnet build -c Release
91+
- name: Publish
92+
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r linux-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
93+
- name: Rename Executable File
94+
run: mv publish/SourceGit publish/sourcegit
95+
- name: Packing Program
96+
run: tar -cvf sourcegit.linux-x64.tar publish/
97+
- name: Upload Artifact
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: sourcegit.linux-x64
101+
path: sourcegit.linux-x64.tar

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ This app supports open repository in external tools listed in the table below.
6969
| --- | --- | --- | --- | --- |
7070
| Visual Studio Code | YES | YES | YES | VSCODE_PATH |
7171
| Visual Studio Code - Insiders | YES | YES | YES | VSCODE_INSIDERS_PATH |
72+
| VSCodium | YES | YES | YES | VSCODIUM_PATH |
7273
| JetBrains Fleet | YES | YES | YES | FLEET_PATH |
7374
| Sublime Text | YES | YES | YES | SUBLIME_TEXT_PATH |
7475

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.10
1+
8.11

build/build.linux.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ rm -rf SourceGit *.tar.gz resources/deb/opt *.deb *.rpm
88
# Compile
99
dotnet publish ../src/SourceGit.csproj -c Release -r linux-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
1010
mv SourceGit/SourceGit SourceGit/sourcegit
11+
cp resources/app/App.icns SourceGit/sourcegit.icns
1112
rm -f SourceGit/*.dbg
1213

1314
# General Linux archive
1415
tar -zcvf sourcegit_${version}.linux-x64.tar.gz SourceGit
16+
rm -f SourceGit/sourcegit.icns
1517

1618
# Debain/Ubuntu package
1719
mkdir -p resources/deb/opt/sourcegit/

src/Commands/IsConflictResolved.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
public class IsConflictResolved : Command
44
{
5-
public IsConflictResolved(string repo, Models.Change change)
5+
public IsConflictResolved(string repo, Models.Change change)
66
{
77
var opt = new Models.DiffOption(change, true);
88

src/Converters/BoolConverters.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Avalonia.Data.Converters;
1+
using Avalonia.Controls;
2+
using Avalonia.Data.Converters;
23
using Avalonia.Media;
34

45
namespace SourceGit.Converters
@@ -8,7 +9,10 @@ public static class BoolConverters
89
public static readonly FuncValueConverter<bool, double> HalfIfFalse =
910
new FuncValueConverter<bool, double>(x => x ? 1 : 0.5);
1011

11-
public static readonly FuncValueConverter<bool, FontWeight> BoldIfTrue =
12+
public static readonly FuncValueConverter<bool, FontWeight> BoldIfTrue =
1213
new FuncValueConverter<bool, FontWeight>(x => x ? FontWeight.Bold : FontWeight.Regular);
14+
15+
public static readonly FuncValueConverter<bool, GridLength> ToStarOrAutoGridLength =
16+
new(value => value ? new GridLength(1, GridUnitType.Star) : new GridLength(1, GridUnitType.Auto));
1317
}
1418
}

src/Models/ExternalMerger.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ static ExternalMerger()
4040
new ExternalMerger(5, "kdiff3", "KDiff3", "kdiff3.exe", "\"$REMOTE\" -b \"$BASE\" \"$LOCAL\" -o \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""),
4141
new ExternalMerger(6, "beyond_compare", "Beyond Compare", "BComp.exe", "\"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""),
4242
new ExternalMerger(7, "win_merge", "WinMerge", "WinMergeU.exe", "-u -e \"$REMOTE\" \"$LOCAL\" \"$MERGED\"", "-u -e \"$LOCAL\" \"$REMOTE\""),
43+
new ExternalMerger(8, "codium", "VSCodium", "VSCodium.exe", "-n --wait \"$MERGED\"", "-n --wait --diff \"$LOCAL\" \"$REMOTE\""),
4344
};
4445
}
4546
else if (OperatingSystem.IsMacOS())
@@ -51,6 +52,7 @@ static ExternalMerger()
5152
new ExternalMerger(3, "vscode_insiders", "Visual Studio Code - Insiders", "/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code", "-n --wait \"$MERGED\"", "-n --wait --diff \"$LOCAL\" \"$REMOTE\""),
5253
new ExternalMerger(4, "kdiff3", "KDiff3", "/Applications/kdiff3.app/Contents/MacOS/kdiff3", "\"$REMOTE\" -b \"$BASE\" \"$LOCAL\" -o \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""),
5354
new ExternalMerger(5, "beyond_compare", "Beyond Compare", "/Applications/Beyond Compare.app/Contents/MacOS/bcomp", "\"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""),
55+
new ExternalMerger(6, "codium", "VSCodium", "/Applications/VSCodium.app/Contents/Resources/app/bin/codium", "-n --wait \"$MERGED\"", "-n --wait --diff \"$LOCAL\" \"$REMOTE\""),
5456
};
5557
}
5658
else if (OperatingSystem.IsLinux())
@@ -62,6 +64,7 @@ static ExternalMerger()
6264
new ExternalMerger(3, "kdiff3", "KDiff3", "/usr/bin/kdiff3", "\"$REMOTE\" -b \"$BASE\" \"$LOCAL\" -o \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""),
6365
new ExternalMerger(4, "beyond_compare", "Beyond Compare", "/usr/bin/bcomp", "\"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""),
6466
new ExternalMerger(5, "meld", "Meld", "/usr/bin/meld", "\"$LOCAL\" \"$BASE\" \"$REMOTE\" -output \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""),
67+
new ExternalMerger(6, "codium", "VSCodium", "/usr/share/codium/bin/codium", "-n --wait \"$MERGED\"", "-n --wait --diff \"$LOCAL\" \"$REMOTE\""),
6568
};
6669
}
6770
else

src/Models/ExternalTool.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,31 +116,36 @@ public void TryAdd(string name, string icon, string args, string env, Func<strin
116116
});
117117
}
118118

119-
public void VSCode(Func<string> platform_finder)
119+
public void VSCode(Func<string> platformFinder)
120120
{
121-
TryAdd("Visual Studio Code", "vscode", "\"{0}\"", "VSCODE_PATH", platform_finder);
121+
TryAdd("Visual Studio Code", "vscode", "\"{0}\"", "VSCODE_PATH", platformFinder);
122122
}
123123

124-
public void VSCodeInsiders(Func<string> platform_finder)
124+
public void VSCodeInsiders(Func<string> platformFinder)
125125
{
126-
TryAdd("Visual Studio Code - Insiders", "vscode_insiders", "\"{0}\"", "VSCODE_INSIDERS_PATH", platform_finder);
126+
TryAdd("Visual Studio Code - Insiders", "vscode_insiders", "\"{0}\"", "VSCODE_INSIDERS_PATH", platformFinder);
127127
}
128128

129-
public void Fleet(Func<string> platform_finder)
129+
public void VSCodium(Func<string> platformFinder)
130130
{
131-
TryAdd("Fleet", "fleet", "\"{0}\"", "FLEET_PATH", platform_finder);
131+
TryAdd("VSCodium", "codium", "\"{0}\"", "VSCODIUM_PATH", platformFinder);
132132
}
133133

134-
public void SublimeText(Func<string> platform_finder)
134+
public void Fleet(Func<string> platformFinder)
135135
{
136-
TryAdd("Sublime Text", "sublime_text", "\"{0}\"", "SUBLIME_TEXT_PATH", platform_finder);
136+
TryAdd("Fleet", "fleet", "\"{0}\"", "FLEET_PATH", platformFinder);
137137
}
138138

139-
public void FindJetBrainsFromToolbox(Func<string> platform_finder)
139+
public void SublimeText(Func<string> platformFinder)
140+
{
141+
TryAdd("Sublime Text", "sublime_text", "\"{0}\"", "SUBLIME_TEXT_PATH", platformFinder);
142+
}
143+
144+
public void FindJetBrainsFromToolbox(Func<string> platformFinder)
140145
{
141146
var exclude = new List<string> { "fleet", "dotmemory", "dottrace", "resharper-u", "androidstudio" };
142147
var supported_icons = new List<string> { "CL", "DB", "DL", "DS", "GO", "IC", "IU", "JB", "PC", "PS", "PY", "QA", "QD", "RD", "RM", "RR", "WRS", "WS" };
143-
var state = Path.Combine(platform_finder(), "state.json");
148+
var state = Path.Combine(platformFinder(), "state.json");
144149
if (File.Exists(state))
145150
{
146151
var stateData = JsonSerializer.Deserialize(File.ReadAllText(state), JsonCodeGen.Default.JetBrainsState);

src/Models/Watcher.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ public Watcher(IRepository repo)
3535
_wcWatcher.Deleted += OnWorkingCopyChanged;
3636
_wcWatcher.EnableRaisingEvents = true;
3737

38+
// If this repository is a worktree repository, just watch the main repository's gitdir.
39+
var gitDirNormalized = _repo.GitDir.Replace("\\", "/");
40+
var worktreeIdx = gitDirNormalized.IndexOf(".git/worktrees/");
41+
var repoWatchDir = _repo.GitDir;
42+
if (worktreeIdx > 0)
43+
repoWatchDir = _repo.GitDir.Substring(0, worktreeIdx + 4);
44+
3845
_repoWatcher = new FileSystemWatcher();
39-
_repoWatcher.Path = _repo.GitDir;
46+
_repoWatcher.Path = repoWatchDir;
4047
_repoWatcher.Filter = "*";
4148
_repoWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.DirectoryName | NotifyFilters.FileName;
4249
_repoWatcher.IncludeSubdirectories = true;
@@ -173,8 +180,7 @@ private void OnRepositoryChanged(object o, FileSystemEventArgs e)
173180
}
174181
else if (name.Equals("HEAD", StringComparison.Ordinal) ||
175182
name.StartsWith("refs/heads/", StringComparison.Ordinal) ||
176-
name.StartsWith("refs/remotes/", StringComparison.Ordinal) ||
177-
name.StartsWith("worktrees/", StringComparison.Ordinal))
183+
name.StartsWith("refs/remotes/", StringComparison.Ordinal))
178184
{
179185
_updateBranch = DateTime.Now.AddSeconds(.5).ToFileTime();
180186
}

src/Native/Linux.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public string FindGitExecutable()
5757
var finder = new Models.ExternalToolsFinder();
5858
finder.VSCode(() => FindExecutable("code"));
5959
finder.VSCodeInsiders(() => FindExecutable("code-insiders"));
60+
finder.VSCodium(() => FindExecutable("codium"));
6061
finder.Fleet(FindJetBrainsFleet);
6162
finder.FindJetBrainsFromToolbox(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}/JetBrains/Toolbox");
6263
finder.SublimeText(() => FindExecutable("subl"));

0 commit comments

Comments
 (0)