Skip to content

Commit 3ee56dd

Browse files
committed
Merge branch 'release/v8.38'
2 parents 9452b79 + 7df6d32 commit 3ee56dd

Some content is hidden

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

61 files changed

+966
-444
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
4848
## Translation Status
4949

50-
[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-96.05%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-97.08%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-87.72%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-90.79%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-100.00%25-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md)
50+
[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.56%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.86%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.60%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.86%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.86%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md)
5151

5252
## How to Use
5353

TRANSLATION.md

Lines changed: 27 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,33 @@
1-
### de_DE.axaml: 96.05%
1+
### de_DE.axaml: 98.56%
22

33

44
<details>
55
<summary>Missing Keys</summary>
66

7-
- Text.BranchCM.FetchInto
8-
- Text.ChangeCM.GenerateCommitMessage
9-
- Text.CommitCM.CustomAction
10-
- Text.Configure.CustomAction
11-
- Text.Configure.CustomAction.Arguments
12-
- Text.Configure.CustomAction.Arguments.Tip
13-
- Text.Configure.CustomAction.Executable
14-
- Text.Configure.CustomAction.Name
15-
- Text.Configure.CustomAction.Scope
16-
- Text.Configure.CustomAction.Scope.Commit
17-
- Text.Configure.CustomAction.Scope.Repository
18-
- Text.Configure.Git.EnablePruneOnFetch
19-
- Text.Configure.Git.EnableSignOff
20-
- Text.Configure.IssueTracker.AddSampleGitLabIssue
21-
- Text.Configure.IssueTracker.AddSampleGitLabMergeRequest
22-
- Text.Configure.OpenAI
23-
- Text.Configure.OpenAI.Prefered
24-
- Text.Configure.OpenAI.Prefered.Tip
25-
- Text.ExecuteCustomAction
26-
- Text.ExecuteCustomAction.Name
27-
- Text.Preference.AI.AnalyzeDiffPrompt
28-
- Text.Preference.AI.GenerateSubjectPrompt
29-
- Text.Preference.AI.Name
30-
- Text.Repository.CustomActions
31-
- Text.Repository.CustomActions.Empty
32-
- Text.Stash.KeepIndex
33-
- Text.WorkingCopy.ConfirmCommitWithoutFiles
7+
- Text.CommitDetail.Info.Children
8+
- Text.Diff.SaveAsPatch
9+
- Text.Diff.VisualLines.All
10+
- Text.Hotkeys.Repo.CreateBranchOnCommit
11+
- Text.Hotkeys.Repo.Fetch
12+
- Text.Hotkeys.Repo.Pull
13+
- Text.Hotkeys.Repo.Push
14+
- Text.IssueLinkCM.OpenInBrowser
15+
- Text.IssueLinkCM.CopyLink
16+
- Text.Preference.Appearance.EditorFontSize
3417

3518
</details>
3619

37-
### es_ES.axaml: 97.08%
20+
### es_ES.axaml: 99.86%
3821

3922

4023
<details>
4124
<summary>Missing Keys</summary>
4225

43-
- Text.ChangeCM.GenerateCommitMessage
44-
- Text.CommitCM.CustomAction
45-
- Text.Configure.CustomAction
46-
- Text.Configure.CustomAction.Arguments
47-
- Text.Configure.CustomAction.Arguments.Tip
48-
- Text.Configure.CustomAction.Executable
49-
- Text.Configure.CustomAction.Name
50-
- Text.Configure.CustomAction.Scope
51-
- Text.Configure.CustomAction.Scope.Commit
52-
- Text.Configure.CustomAction.Scope.Repository
53-
- Text.Configure.Git.EnablePruneOnFetch
54-
- Text.Configure.OpenAI
55-
- Text.Configure.OpenAI.Prefered
56-
- Text.Configure.OpenAI.Prefered.Tip
57-
- Text.ExecuteCustomAction
58-
- Text.ExecuteCustomAction.Name
59-
- Text.Preference.AI.Name
60-
- Text.Repository.CustomActions
61-
- Text.Repository.CustomActions.Empty
62-
- Text.Stash.KeepIndex
26+
- Text.CommitDetail.Info.Children
6327

6428
</details>
6529

66-
### fr_FR.axaml: 87.72%
30+
### fr_FR.axaml: 86.60%
6731

6832

6933
<details>
@@ -108,6 +72,8 @@
10872
- Text.ConventionalCommit.ShortDescription
10973
- Text.ConventionalCommit.Type
11074
- Text.Diff.IgnoreWhitespace
75+
- Text.Diff.SaveAsPatch
76+
- Text.Diff.VisualLines.All
11177
- Text.Discard.IncludeIgnored
11278
- Text.ExecuteCustomAction
11379
- Text.ExecuteCustomAction.Name
@@ -118,7 +84,13 @@
11884
- Text.Histories.Tips.MacOS
11985
- Text.Histories.Tips.Prefix
12086
- Text.Hotkeys.Repo.CommitWithAutoStage
87+
- Text.Hotkeys.Repo.CreateBranchOnCommit
12188
- Text.Hotkeys.Repo.DiscardSelected
89+
- Text.Hotkeys.Repo.Fetch
90+
- Text.Hotkeys.Repo.Pull
91+
- Text.Hotkeys.Repo.Push
92+
- Text.IssueLinkCM.OpenInBrowser
93+
- Text.IssueLinkCM.CopyLink
12294
- Text.MoveRepositoryNode
12395
- Text.MoveRepositoryNode.Target
12496
- Text.Preference.AI
@@ -128,6 +100,7 @@
128100
- Text.Preference.AI.Model
129101
- Text.Preference.AI.Name
130102
- Text.Preference.AI.Server
103+
- Text.Preference.Appearance.EditorFontSize
131104
- Text.Preference.General.ShowAuthorTime
132105
- Text.Preference.Integration
133106
- Text.Preference.Shell
@@ -156,85 +129,23 @@
156129

157130
</details>
158131

159-
### pt_BR.axaml: 90.79%
132+
### pt_BR.axaml: 99.86%
160133

161134

162135
<details>
163136
<summary>Missing Keys</summary>
164137

165-
- Text.About.Chart
166-
- Text.AIAssistant
167-
- Text.AIAssistant.Tip
168-
- Text.BranchCM.FetchInto
169-
- Text.ChangeCM.GenerateCommitMessage
170-
- Text.CherryPick.AppendSourceToMessage
171-
- Text.CherryPick.Mainline
172-
- Text.CherryPick.Mainline.Tips
173-
- Text.CommitCM.CherryPickMultiple
174-
- Text.CommitCM.CustomAction
175-
- Text.CommitCM.SquashCommitsSinceThis
176-
- Text.CommitDetail.Info.ContainsIn
177-
- Text.CommitDetail.Info.ContainsIn.Title
178-
- Text.CommitDetail.Info.WebLinks
179-
- Text.Configure.CustomAction
180-
- Text.Configure.CustomAction.Arguments
181-
- Text.Configure.CustomAction.Arguments.Tip
182-
- Text.Configure.CustomAction.Executable
183-
- Text.Configure.CustomAction.Name
184-
- Text.Configure.CustomAction.Scope
185-
- Text.Configure.CustomAction.Scope.Commit
186-
- Text.Configure.CustomAction.Scope.Repository
187-
- Text.Configure.Git.DefaultRemote
188-
- Text.Configure.Git.EnablePruneOnFetch
189-
- Text.Configure.Git.EnableSignOff
190-
- Text.Configure.IssueTracker.AddSampleGitLabIssue
191-
- Text.Configure.IssueTracker.AddSampleGitLabMergeRequest
192-
- Text.Configure.OpenAI
193-
- Text.Configure.OpenAI.Prefered
194-
- Text.Configure.OpenAI.Prefered.Tip
195-
- Text.ConfigureWorkspace
196-
- Text.ConfigureWorkspace.Color
197-
- Text.ConfigureWorkspace.Restore
198-
- Text.ConventionalCommit
199-
- Text.ConventionalCommit.BreakingChanges
200-
- Text.ConventionalCommit.ClosedIssue
201-
- Text.ConventionalCommit.Detail
202-
- Text.ConventionalCommit.Scope
203-
- Text.ConventionalCommit.ShortDescription
204-
- Text.ConventionalCommit.Type
205-
- Text.CopyAllText
206-
- Text.Discard.IncludeIgnored
207-
- Text.ExecuteCustomAction
208-
- Text.ExecuteCustomAction.Name
209-
- Text.FileHistory.FileContent
210-
- Text.FileHistory.FileChange
211-
- Text.GitLFS.Locks.OnlyMine
212-
- Text.MoveRepositoryNode
213-
- Text.MoveRepositoryNode.Target
214-
- Text.Preference.AI.Name
215-
- Text.Push.CheckSubmodules
216-
- Text.Repository.CustomActions
217-
- Text.Repository.CustomActions.Empty
218-
- Text.Squash.Into
219-
- Text.Stash.KeepIndex
220-
- Text.Stash.OnlyStagedChanges
221-
- Text.Stash.TipForSelectedFiles
222-
- Text.Statistics.Overview
223-
- Text.TagCM.CopyMessage
224-
- Text.WorkingCopy.Staged.UnstageAll
225-
- Text.WorkingCopy.Unstaged
226-
- Text.WorkingCopy.Unstaged.Stage
227-
- Text.WorkingCopy.Unstaged.StageAll
138+
- Text.CommitDetail.Info.Children
228139

229140
</details>
230141

231-
### ru_RU.axaml: 100.00%
142+
### ru_RU.axaml: 99.86%
232143

233144

234145
<details>
235146
<summary>Missing Keys</summary>
236147

237-
148+
- Text.CommitDetail.Info.Children
238149

239150
</details>
240151

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.37
1+
8.38

src/Commands/Diff.cs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ public partial class Diff : Command
88
{
99
[GeneratedRegex(@"^@@ \-(\d+),?\d* \+(\d+),?\d* @@")]
1010
private static partial Regex REG_INDICATOR();
11+
12+
[GeneratedRegex(@"^index\s([0-9a-f]{6,40})\.\.([0-9a-f]{6,40})(\s[1-9]{6})?")]
13+
private static partial Regex REG_HASH_CHANGE();
14+
1115
private const string PREFIX_LFS_NEW = "+version https://git-lfs.github.com/spec/";
1216
private const string PREFIX_LFS_DEL = "-version https://git-lfs.github.com/spec/";
1317
private const string PREFIX_LFS_MODIFY = " version https://git-lfs.github.com/spec/";
@@ -101,17 +105,31 @@ protected override void OnReadline(string line)
101105

102106
if (_result.TextDiff.Lines.Count == 0)
103107
{
104-
var match = REG_INDICATOR().Match(line);
105-
if (!match.Success)
108+
if (line.StartsWith("Binary", StringComparison.Ordinal))
106109
{
107-
if (line.StartsWith("Binary", StringComparison.Ordinal))
108-
_result.IsBinary = true;
110+
_result.IsBinary = true;
109111
return;
110112
}
111113

112-
_oldLine = int.Parse(match.Groups[1].Value);
113-
_newLine = int.Parse(match.Groups[2].Value);
114-
_result.TextDiff.Lines.Add(new Models.TextDiffLine(Models.TextDiffLineType.Indicator, line, 0, 0));
114+
if (string.IsNullOrEmpty(_result.OldHash))
115+
{
116+
var match = REG_HASH_CHANGE().Match(line);
117+
if (!match.Success)
118+
return;
119+
120+
_result.OldHash = match.Groups[1].Value;
121+
_result.NewHash = match.Groups[2].Value;
122+
}
123+
else
124+
{
125+
var match = REG_INDICATOR().Match(line);
126+
if (!match.Success)
127+
return;
128+
129+
_oldLine = int.Parse(match.Groups[1].Value);
130+
_newLine = int.Parse(match.Groups[2].Value);
131+
_result.TextDiff.Lines.Add(new Models.TextDiffLine(Models.TextDiffLineType.Indicator, line, 0, 0));
132+
}
115133
}
116134
else
117135
{

src/Commands/ExecuteCustomAction.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public static void Run(string repo, string file, string args, Action<string> out
3030
start.Environment.Add("PATH", Native.OS.CustomPathEnv);
3131

3232
var proc = new Process() { StartInfo = start };
33+
var builder = new StringBuilder();
34+
3335
proc.OutputDataReceived += (_, e) =>
3436
{
3537
if (e.Data != null)
@@ -39,7 +41,10 @@ public static void Run(string repo, string file, string args, Action<string> out
3941
proc.ErrorDataReceived += (_, e) =>
4042
{
4143
if (e.Data != null)
44+
{
4245
outputHandler?.Invoke(e.Data);
46+
builder.AppendLine(e.Data);
47+
}
4348
};
4449

4550
try
@@ -57,7 +62,17 @@ public static void Run(string repo, string file, string args, Action<string> out
5762
});
5863
}
5964

65+
var exitCode = proc.ExitCode;
6066
proc.Close();
67+
68+
if (exitCode != 0)
69+
{
70+
var errMsg = builder.ToString();
71+
Dispatcher.UIThread.Invoke(() =>
72+
{
73+
App.RaiseException(repo, errMsg);
74+
});
75+
}
6176
}
6277
}
6378
}

src/Commands/QueryCommitChildren.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
namespace SourceGit.Commands
2+
{
3+
public class QueryCommitChildren : Command
4+
{
5+
public QueryCommitChildren(string repo, string sha)
6+
{
7+
WorkingDirectory = repo;
8+
Context = repo;
9+
_sha = sha;
10+
Args = $"rev-list --children --all {sha}^..";
11+
}
12+
13+
public string[] Result()
14+
{
15+
var rs = ReadToEnd();
16+
if (!rs.IsSuccess)
17+
return [];
18+
19+
int start = rs.StdOut.IndexOf($"\n{_sha}");
20+
if (start != -1)
21+
{
22+
int end = rs.StdOut.IndexOf('\n', start + 1);
23+
if (end == -1)
24+
end = rs.StdOut.Length;
25+
start = rs.StdOut.IndexOf(' ', start);
26+
if (start != -1 && start < end)
27+
return rs.StdOut.Substring(start + 1, end - start - 1).Split(' ', System.StringSplitOptions.RemoveEmptyEntries);
28+
}
29+
return [];
30+
}
31+
32+
private string _sha;
33+
}
34+
}

src/Commands/SaveChangesAsPatch.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace SourceGit.Commands
99
{
1010
public static class SaveChangesAsPatch
1111
{
12-
public static bool Exec(string repo, List<Models.Change> changes, bool isUnstaged, string saveTo)
12+
public static bool ProcessLocalChanges(string repo, List<Models.Change> changes, bool isUnstaged, string saveTo)
1313
{
1414
using (var sw = File.Create(saveTo))
1515
{
@@ -23,6 +23,20 @@ public static bool Exec(string repo, List<Models.Change> changes, bool isUnstage
2323
return true;
2424
}
2525

26+
public static bool ProcessRevisionCompareChanges(string repo, List<Models.Change> changes, string baseRevision, string targetRevision, string saveTo)
27+
{
28+
using (var sw = File.Create(saveTo))
29+
{
30+
foreach (var change in changes)
31+
{
32+
if (!ProcessSingleChange(repo, new Models.DiffOption(baseRevision, targetRevision, change), sw))
33+
return false;
34+
}
35+
}
36+
37+
return true;
38+
}
39+
2640
private static bool ProcessSingleChange(string repo, Models.DiffOption opt, FileStream writer)
2741
{
2842
var starter = new ProcessStartInfo();

src/Models/CustomAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public string Executable
3030

3131
public string Arguments
3232
{
33-
get => _arguments;
33+
get => _arguments;
3434
set => SetProperty(ref _arguments, value);
3535
}
3636

src/Models/DiffResult.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public partial class TextDiff
6363
{
6464
public string File { get; set; } = string.Empty;
6565
public List<TextDiffLine> Lines { get; set; } = new List<TextDiffLine>();
66-
public Vector SyncScrollOffset { get; set; } = Vector.Zero;
66+
public Vector ScrollOffset { get; set; } = Vector.Zero;
6767
public int MaxLineNumber = 0;
6868

6969
public string Repo { get; set; } = null;
@@ -674,6 +674,8 @@ public class DiffResult
674674
{
675675
public bool IsBinary { get; set; } = false;
676676
public bool IsLFS { get; set; } = false;
677+
public string OldHash { get; set; } = string.Empty;
678+
public string NewHash { get; set; } = string.Empty;
677679
public string OldMode { get; set; } = string.Empty;
678680
public string NewMode { get; set; } = string.Empty;
679681
public TextDiff TextDiff { get; set; } = null;

0 commit comments

Comments
 (0)