Skip to content

Commit

Permalink
Merge branch 'release/v8.23'
Browse files Browse the repository at this point in the history
  • Loading branch information
love-linger committed Jul 29, 2024
2 parents 41dfbb3 + aec621b commit b7c6d62
Show file tree
Hide file tree
Showing 78 changed files with 1,264 additions and 784 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Build
run: dotnet build -c Release
- name: Publish
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r win-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r win-x64
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Build
run: dotnet build -c Release
- name: Publish
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-x64
- name: Packing Program
run: tar -cvf sourcegit.osx-x64.tar -C publish/ .
- name: Upload Artifact
Expand All @@ -66,7 +66,7 @@ jobs:
- name: Build
run: dotnet build -c Release
- name: Publish
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-arm64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r osx-arm64
- name: Packing Program
run: tar -cvf sourcegit.osx-arm64.tar -C publish/ .
- name: Upload Artifact
Expand All @@ -89,7 +89,7 @@ jobs:
- name: Build
run: dotnet build -c Release
- name: Publish
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r linux-x64 -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
run: dotnet publish src/SourceGit.csproj -c Release -o publish -r linux-x64
- name: Rename Executable File
run: mv publish/SourceGit publish/sourcegit
- name: Packing Program
Expand Down
10 changes: 10 additions & 0 deletions SourceGit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SPECS", "SPECS", "{7802CD7A
build\resources\rpm\SPECS\build.spec = build\resources\rpm\SPECS\build.spec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "appimage", "appimage", "{5D125DD9-B48A-491F-B2FB-D7830D74C4DC}"
ProjectSection(SolutionItems) = preProject
build\resources\appimage\publish-appimage = build\resources\appimage\publish-appimage
build\resources\appimage\publish-appimage.conf = build\resources\appimage\publish-appimage.conf
build\resources\appimage\runtime-x86_64 = build\resources\appimage\runtime-x86_64
build\resources\appimage\sourcegit.appdata.xml = build\resources\appimage\sourcegit.appdata.xml
build\resources\appimage\sourcegit.png = build\resources\appimage\sourcegit.png
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -104,6 +113,7 @@ Global
{F101849D-BDB7-40D4-A516-751150C3CCFC} = {9C2F0CDA-B56E-44A5-94B6-F3EA7AC20CDC}
{9BA0B044-0CC9-46F8-B551-204F149BF45D} = {FD384607-ED99-47B7-AF31-FB245841BC92}
{7802CD7A-591B-4EDD-96F8-9BF3F61692E4} = {9BA0B044-0CC9-46F8-B551-204F149BF45D}
{5D125DD9-B48A-491F-B2FB-D7830D74C4DC} = {FD384607-ED99-47B7-AF31-FB245841BC92}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7FF1B9C6-B5BF-4A50-949F-4B407A0E31C9}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.22.1
8.23
4 changes: 2 additions & 2 deletions build/build.osx.command
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ cp resources/app/App.icns SourceGit.app/Contents/Resources/App.icns
sed "s/SOURCE_GIT_VERSION/${version}/g" resources/app/App.plist > SourceGit.app/Contents/Info.plist

mkdir -p SourceGit.app/Contents/MacOS
dotnet publish ../src/SourceGit.csproj -c Release -r osx-arm64 -o SourceGit.app/Contents/MacOS -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
dotnet publish ../src/SourceGit.csproj -c Release -r osx-arm64 -o SourceGit.app/Contents/MacOS
zip sourcegit_${version}.osx-arm64.zip -r SourceGit.app -x "*/*\.dsym/*"

rm -rf SourceGit.app/Contents/MacOS

mkdir -p SourceGit.app/Contents/MacOS
dotnet publish ../src/SourceGit.csproj -c Release -r osx-x64 -o SourceGit.app/Contents/MacOS -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
dotnet publish ../src/SourceGit.csproj -c Release -r osx-x64 -o SourceGit.app/Contents/MacOS
zip sourcegit_${version}.osx-x64.zip -r SourceGit.app -x "*/*\.dsym/*"

rm -rf SourceGit.app
4 changes: 2 additions & 2 deletions build/build.windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (Test-Path SourceGit) {

Remove-Item *.zip -Force

dotnet publish ..\src\SourceGit.csproj -c Release -r win-arm64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
dotnet publish ..\src\SourceGit.csproj -c Release -r win-arm64 -o SourceGit

Remove-Item SourceGit\*.pdb -Force

Expand All @@ -16,7 +16,7 @@ if (Test-Path SourceGit) {
Remove-Item SourceGit -Recurse -Force
}

dotnet publish ..\src\SourceGit.csproj -c Release -r win-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
dotnet publish ..\src\SourceGit.csproj -c Release -r win-x64 -o SourceGit

Remove-Item SourceGit\*.pdb -Force

Expand Down
50 changes: 25 additions & 25 deletions build/resources/app/App.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIconFile</key>
<string>App.icns</string>
<key>CFBundleIdentifier</key>
<string>com.sourcegit-scm.sourcegit</string>
<key>CFBundleName</key>
<string>SourceGit</string>
<key>CFBundleVersion</key>
<string>SOURCE_GIT_VERSION.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
<key>LSEnvironment</key>
<dict>
<key>PATH</key>
<string>/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>CFBundleExecutable</key>
<string>SourceGit</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>SOURCE_GIT_VERSION</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>CFBundleIconFile</key>
<string>App.icns</string>
<key>CFBundleIdentifier</key>
<string>com.sourcegit-scm.sourcegit</string>
<key>CFBundleName</key>
<string>SourceGit</string>
<key>CFBundleVersion</key>
<string>SOURCE_GIT_VERSION.0</string>
<key>LSMinimumSystemVersion</key>
<string>11.0</string>
<key>LSEnvironment</key>
<dict>
<key>PATH</key>
<string>/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>CFBundleExecutable</key>
<string>SourceGit</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>SOURCE_GIT_VERSION</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
4 changes: 2 additions & 2 deletions build/resources/appimage/publish-appimage.conf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ DOTNET_PROJECT_PATH="../../../src/SourceGit.csproj"
# Additional useful arguments include:
# "-p:DebugType=None -p:DebugSymbols=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=link"
# Refer: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
DOTNET_PUBLISH_ARGS="-c Release -p:DebugType=None -p:DebugSymbols=false -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained"
DOTNET_PUBLISH_ARGS="-c Release -p:DebugType=None -p:DebugSymbols=false"


########################################
Expand Down Expand Up @@ -137,4 +137,4 @@ PKG_APPIMAGE_SUFFIX=".AppImage"
APPIMAGETOOL_COMMAND="appimagetool"

# Internal use only. Used for compatibility between conf and script. Do not modify.
CONF_IMPL_VERSION=1
CONF_IMPL_VERSION=1
2 changes: 1 addition & 1 deletion src/App.JsonCodeGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public override void Write(Utf8JsonWriter writer, GridLength value, JsonSerializ
[JsonSerializable(typeof(Models.JetBrainsState))]
[JsonSerializable(typeof(Models.ThemeOverrides))]
[JsonSerializable(typeof(Models.Version))]
[JsonSerializable(typeof(Models.RepositorySettings))]
[JsonSerializable(typeof(ViewModels.Preference))]
[JsonSerializable(typeof(ViewModels.RepositorySettings))]
internal partial class JsonCodeGen : JsonSerializerContext { }
}
24 changes: 17 additions & 7 deletions src/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static AppBuilder BuildAvaloniaApp()
var toplevel = GetTopLevel() as Window;
if (toplevel == null)
return;

var dialog = new Views.Preference();
dialog.ShowDialog(toplevel);
});
Expand All @@ -102,7 +102,7 @@ public static AppBuilder BuildAvaloniaApp()
var toplevel = GetTopLevel() as Window;
if (toplevel == null)
return;

var dialog = new Views.Hotkeys();
dialog.ShowDialog(toplevel);
});
Expand All @@ -112,7 +112,7 @@ public static AppBuilder BuildAvaloniaApp()
var toplevel = GetTopLevel() as Window;
if (toplevel == null)
return;

var dialog = new Views.About();
dialog.ShowDialog(toplevel);
});
Expand Down Expand Up @@ -247,7 +247,7 @@ public static Avalonia.Controls.Shapes.Path CreateMenuIcon(string key)
var geo = Current?.FindResource(key) as StreamGeometry;
if (geo != null)
icon.Data = geo;

return icon;
}

Expand All @@ -257,7 +257,7 @@ public static TopLevel GetTopLevel()
{
return desktop.MainWindow;
}

return null;
}

Expand Down Expand Up @@ -302,6 +302,11 @@ public static void Check4Update(bool manually = false)
});
}

public static ViewModels.Launcher GetLauncer()
{
return Current is App app ? app._launcher : null;
}

public static ViewModels.Repository FindOpenedRepository(string repoPath)
{
if (Current is App app && app._launcher != null)
Expand Down Expand Up @@ -501,10 +506,15 @@ private bool TryLaunchedAsCoreEditor(IClassicDesktopStyleApplicationLifetime des
private bool TryLaunchedAsAskpass(IClassicDesktopStyleApplicationLifetime desktop)
{
var args = desktop.Args;
if (args == null || args.Length != 1 || !args[0].StartsWith("Enter passphrase", StringComparison.Ordinal))
if (args == null || args.Length != 1)
return false;

var param = args[0];
if (!param.StartsWith("enter passphrase", StringComparison.OrdinalIgnoreCase) &&
!param.Contains(" password", StringComparison.OrdinalIgnoreCase))
return false;

desktop.MainWindow = new Views.Askpass(args[0]);
desktop.MainWindow = new Views.Askpass(param);
return true;
}

Expand Down
10 changes: 5 additions & 5 deletions src/Commands/AssumeUnchanged.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ namespace SourceGit.Commands
{
public partial class AssumeUnchanged
{
partial class ViewCommand : Command
{
[GeneratedRegex(@"^(\w)\s+(.+)$")]
private static partial Regex REG();
[GeneratedRegex(@"^(\w)\s+(.+)$")]
private static partial Regex REG_PARSE();

class ViewCommand : Command
{
public ViewCommand(string repo)
{
WorkingDirectory = repo;
Expand All @@ -25,7 +25,7 @@ public List<string> Result()

protected override void OnReadline(string line)
{
var match = REG().Match(line);
var match = REG_PARSE().Match(line);
if (!match.Success)
return;

Expand Down
4 changes: 3 additions & 1 deletion src/Commands/CompareRevisions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public CompareRevisions(string repo, string start, string end)
{
WorkingDirectory = repo;
Context = repo;
Args = $"diff --name-status {start} {end}";

var based = string.IsNullOrEmpty(start) ? "-R" : start;
Args = $"diff --name-status {based} {end}";
}

public List<Models.Change> Result()
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/Diff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public partial class Diff : Command

public Diff(string repo, Models.DiffOption opt, int unified)
{
_result.TextDiff = new Models.TextDiff() {
_result.TextDiff = new Models.TextDiff()
{
Repo = repo,
Option = opt,
};
Expand Down
6 changes: 1 addition & 5 deletions src/Commands/QueryBranches.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace SourceGit.Commands
{
public partial class QueryBranches : Command
public class QueryBranches : Command
{
private const string PREFIX_LOCAL = "refs/heads/";
private const string PREFIX_REMOTE = "refs/remotes/";
private const string PREFIX_DETACHED = "(HEAD detached at";

[GeneratedRegex(@"^(\d+)\s(\d+)$")]
private static partial Regex REG_AHEAD_BEHIND();

public QueryBranches(string repo)
{
WorkingDirectory = repo;
Expand Down
2 changes: 0 additions & 2 deletions src/Commands/QuerySingleCommit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,5 @@ public Models.Commit Result()

return null;
}


}
}
1 change: 0 additions & 1 deletion src/Commands/QueryStashChanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace SourceGit.Commands
{
public partial class QueryStashChanges : Command
{

[GeneratedRegex(@"^(\s?[\w\?]{1,4})\s+(.+)$")]
private static partial Regex REG_FORMAT();

Expand Down
6 changes: 3 additions & 3 deletions src/Commands/QueryTags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public QueryTags(string repo)
{
Context = repo;
WorkingDirectory = repo;
Args = "for-each-ref --sort=-creatordate --format=\"$%(refname:short)$%(objectname)$%(*objectname)\" refs/tags";
Args = "tag -l --sort=-creatordate --format=\"$%(refname)$%(objectname)$%(*objectname)\"";
}

public List<Models.Tag> Result()
Expand All @@ -25,15 +25,15 @@ protected override void OnReadline(string line)
{
_loaded.Add(new Models.Tag()
{
Name = subs[0],
Name = subs[0].Substring(10),
SHA = subs[1],
});
}
else if (subs.Length == 3)
{
_loaded.Add(new Models.Tag()
{
Name = subs[0],
Name = subs[0].Substring(10),
SHA = subs[2],
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/QueryTrackStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace SourceGit.Commands
{
public class QueryTrackStatus : Command
{
public QueryTrackStatus(string repo, string local, string upstream)
public QueryTrackStatus(string repo, string local, string upstream)
{
WorkingDirectory = repo;
Context = repo;
Expand All @@ -19,7 +19,7 @@ public Models.BranchTrackStatus Result()
if (!rs.IsSuccess)
return status;

var lines = rs.StdOut.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries);
var lines = rs.StdOut.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var line in lines)
{
if (line[0] == '>')
Expand Down
Loading

0 comments on commit b7c6d62

Please sign in to comment.