Skip to content

Commit 718dd32

Browse files
committed
Merge branch 'release/v8.31'
2 parents 67b3952 + 517cb63 commit 718dd32

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4372
-263
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Opensource Git GUI client.
77
* Supports Windows/macOS/Linux
88
* Opensource/Free
99
* Fast
10-
* English/Français/Deutsch/Português/简体中文/繁體中文
10+
* English/Français/Deutsch/Português/Русский/简体中文/繁體中文
1111
* Built-in light/dark themes
1212
* Customize theme
1313
* Visual commit graph
@@ -97,7 +97,7 @@ For `OpenAI`:
9797

9898
For other AI service:
9999

100-
* The `Server` should fill in a URL equivalent to OpenAI's `https://api.openai.com/v1/chat/completions`
100+
* The `Server` should fill in a URL equivalent to OpenAI's `https://api.openai.com/v1/chat/completions`. For example, when using `Ollama`, it should be `http://localhost:11434/v1/chat/completions` instead of `http://localhost:11434/api/generate`
101101
* The `API Key` is optional that depends on the service
102102

103103
## External Tools
@@ -111,6 +111,7 @@ This app supports open repository in external tools listed in the table below.
111111
| VSCodium | YES | YES | YES | VSCODIUM |
112112
| JetBrains Fleet | YES | YES | YES | FLEET |
113113
| Sublime Text | YES | YES | YES | SUBLIME_TEXT |
114+
| Zed | NO | YES | YES | ZED |
114115

115116
> [!NOTE]
116117
> This app will try to find those tools based on some pre-defined or expected locations automatically. If you are using one portable version of these tools, it will not be detected by this app.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.30.1
1+
8.31

build/scripts/package.linux.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
4+
set -o
5+
set -u
6+
set pipefail
47

5-
if [ -z "$VERSION" ]; then
8+
if [[ -z "$VERSION" ]]; then
69
echo "Provide the version as environment variable VERSION"
710
exit 1
811
fi
912

10-
if [ -z "$RUNTIME" ]; then
13+
if [[ -z "$RUNTIME" ]]; then
1114
echo "Provide the runtime as environment variable RUNTIME"
1215
exit 1
1316
fi
@@ -33,7 +36,7 @@ APPIMAGETOOL_URL=https://github.com/AppImage/appimagetool/releases/download/cont
3336

3437
cd build
3538

36-
if [ ! -f "appimagetool" ]; then
39+
if [[ ! -f "appimagetool" ]]; then
3740
curl -o appimagetool -L "$APPIMAGETOOL_URL"
3841
chmod +x appimagetool
3942
fi

build/scripts/package.osx-app.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
4+
set -o
5+
set -u
6+
set pipefail
47

5-
if [ -z "$VERSION" ]; then
8+
if [[ -z "$VERSION" ]]; then
69
echo "Provide the version as environment variable VERSION"
710
exit 1
811
fi
912

10-
if [ -z "$RUNTIME" ]; then
13+
if [[ -z "$RUNTIME" ]]; then
1114
echo "Provide the runtime as environment variable RUNTIME"
1215
exit 1
1316
fi

build/scripts/package.windows-portable.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
4+
set -o
5+
set -u
6+
set pipefail
47

5-
if [ -z "$VERSION" ]; then
8+
if [[ -z "$VERSION" ]]; then
69
echo "Provide the version as environment variable VERSION"
710
exit 1
811
fi
912

10-
if [ -z "$RUNTIME" ]; then
13+
if [[ -z "$RUNTIME" ]]; then
1114
echo "Provide the runtime as environment variable RUNTIME"
1215
exit 1
1316
fi

src/App.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<ResourceInclude x:Key="en_US" Source="/Resources/Locales/en_US.axaml"/>
1616
<ResourceInclude x:Key="fr_FR" Source="/Resources/Locales/fr_FR.axaml"/>
1717
<ResourceInclude x:Key="pt_BR" Source="/Resources/Locales/pt_BR.axaml"/>
18+
<ResourceInclude x:Key="ru_RU" Source="/Resources/Locales/ru_RU.axaml"/>
1819
<ResourceInclude x:Key="zh_CN" Source="/Resources/Locales/zh_CN.axaml"/>
1920
<ResourceInclude x:Key="zh_TW" Source="/Resources/Locales/zh_TW.axaml"/>
2021
</ResourceDictionary>

src/App.axaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,9 @@ private bool TryLaunchedAsAskpass(IClassicDesktopStyleApplicationLifetime deskto
521521
return false;
522522

523523
var param = args[0];
524+
if (Directory.Exists(param))
525+
return false;
526+
524527
if (!param.StartsWith("enter passphrase", StringComparison.OrdinalIgnoreCase) &&
525528
!param.Contains(" password", StringComparison.OrdinalIgnoreCase))
526529
return false;

src/Commands/Command.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,14 @@ public bool Exec()
5959

6060
// If an SSH private key was provided, sets the environment.
6161
if (!string.IsNullOrEmpty(SSHKey))
62+
{
6263
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -o StrictHostKeyChecking=accept-new -i '{SSHKey}'");
64+
}
6365
else
66+
{
67+
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -o StrictHostKeyChecking=accept-new");
6468
start.Arguments += "-c credential.helper=manager ";
69+
}
6570

6671
// Force using en_US.UTF-8 locale to avoid GCM crash
6772
if (OperatingSystem.IsLinux())

src/Converters/PathConverters.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.IO;
1+
using System;
2+
using System.IO;
23

34
using Avalonia.Data.Converters;
45

@@ -7,9 +8,23 @@ namespace SourceGit.Converters
78
public static class PathConverters
89
{
910
public static readonly FuncValueConverter<string, string> PureFileName =
10-
new FuncValueConverter<string, string>(fullpath => Path.GetFileName(fullpath) ?? "");
11+
new(v => Path.GetFileName(v) ?? "");
1112

1213
public static readonly FuncValueConverter<string, string> PureDirectoryName =
13-
new FuncValueConverter<string, string>(fullpath => Path.GetDirectoryName(fullpath) ?? "");
14+
new(v => Path.GetDirectoryName(v) ?? "");
15+
16+
public static readonly FuncValueConverter<string, string> RelativeToHome =
17+
new(v =>
18+
{
19+
if (OperatingSystem.IsWindows())
20+
return v;
21+
22+
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
23+
var prefixLen = home.EndsWith('/') ? home.Length - 1 : home.Length;
24+
if (v.StartsWith(home, StringComparison.Ordinal))
25+
return "~" + v.Substring(prefixLen);
26+
27+
return v;
28+
});
1429
}
1530
}

src/Models/AutoFetchManager.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.IO;
34
using System.Threading;
45
using System.Threading.Tasks;
56

@@ -20,6 +21,7 @@ public static AutoFetchManager Instance
2021

2122
public class Job
2223
{
24+
public string IndexLockFile = string.Empty;
2325
public Commands.Fetch Cmd = null;
2426
public DateTime NextRunTimepoint = DateTime.MinValue;
2527
}
@@ -75,8 +77,11 @@ public void Start()
7577

7678
foreach (var job in uptodate)
7779
{
78-
job.Cmd.Exec();
79-
job.NextRunTimepoint = DateTime.Now.AddMinutes(Convert.ToDouble(Interval));
80+
if (!File.Exists(job.IndexLockFile))
81+
{
82+
job.Cmd.Exec();
83+
job.NextRunTimepoint = DateTime.Now.AddMinutes(Convert.ToDouble(Interval));
84+
}
8085
}
8186

8287
Thread.Sleep(2000);
@@ -86,10 +91,11 @@ public void Start()
8691
});
8792
}
8893

89-
public void AddRepository(string repo)
94+
public void AddRepository(string repo, string gitDir)
9095
{
9196
var job = new Job
9297
{
98+
IndexLockFile = Path.Combine(gitDir, "index.lock"),
9399
Cmd = new Commands.Fetch(repo, "--all", true, false, null) { RaiseError = false },
94100
NextRunTimepoint = DateTime.Now.AddMinutes(Convert.ToDouble(Interval)),
95101
};

0 commit comments

Comments
 (0)