Skip to content

Commit 0594196

Browse files
committed
Merge branch 'release/v2025.20'
2 parents 4887252 + 425395d commit 0594196

Some content is hidden

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

58 files changed

+571
-421
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ You can find the current translation status in [TRANSLATION.md](https://github.c
5454

5555
## How to Use
5656

57-
**To use this tool, you need to install Git(>=2.23.0) first.**
57+
**To use this tool, you need to install Git(>=2.25.1) first.**
5858

5959
You can download the latest stable from [Releases](https://github.com/sourcegit-scm/sourcegit/releases/latest) or download workflow artifacts from [Github Actions](https://github.com/sourcegit-scm/sourcegit/actions) to try this app based on latest commits.
6060

TRANSLATION.md

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This document shows the translation status of each locale file in the repository
66

77
### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen)
88

9-
### ![de__DE](https://img.shields.io/badge/de__DE-96.75%25-yellow)
9+
### ![de__DE](https://img.shields.io/badge/de__DE-96.50%25-yellow)
1010

1111
<details>
1212
<summary>Missing keys in de_DE.axaml</summary>
@@ -26,6 +26,7 @@ This document shows the translation status of each locale file in the repository
2626
- Text.Launcher.Workspaces
2727
- Text.Launcher.Pages
2828
- Text.Pull.RecurseSubmodules
29+
- Text.Repository.ClearStashes
2930
- Text.Repository.ShowSubmodulesAsTree
3031
- Text.ResetWithoutCheckout
3132
- Text.ResetWithoutCheckout.MoveTo
@@ -37,19 +38,13 @@ This document shows the translation status of each locale file in the repository
3738
- Text.Submodule.Status.RevisionChanged
3839
- Text.Submodule.Status.Unmerged
3940
- Text.Submodule.URL
41+
- Text.WorkingCopy.ResetAuthor
4042

4143
</details>
4244

43-
### ![es__ES](https://img.shields.io/badge/es__ES-99.87%25-yellow)
45+
### ![es__ES](https://img.shields.io/badge/es__ES-%E2%88%9A-brightgreen)
4446

45-
<details>
46-
<summary>Missing keys in es_ES.axaml</summary>
47-
48-
- Text.CreateBranch.OverwriteExisting
49-
50-
</details>
51-
52-
### ![fr__FR](https://img.shields.io/badge/fr__FR-92.62%25-yellow)
47+
### ![fr__FR](https://img.shields.io/badge/fr__FR-92.38%25-yellow)
5348

5449
<details>
5550
<summary>Missing keys in fr_FR.axaml</summary>
@@ -90,6 +85,7 @@ This document shows the translation status of each locale file in the repository
9085
- Text.Repository.BranchSort
9186
- Text.Repository.BranchSort.ByCommitterDate
9287
- Text.Repository.BranchSort.ByName
88+
- Text.Repository.ClearStashes
9389
- Text.Repository.Search.ByContent
9490
- Text.Repository.ShowSubmodulesAsTree
9591
- Text.Repository.ViewLogs
@@ -113,10 +109,11 @@ This document shows the translation status of each locale file in the repository
113109
- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts
114110
- Text.WorkingCopy.Conflicts.UseMine
115111
- Text.WorkingCopy.Conflicts.UseTheirs
112+
- Text.WorkingCopy.ResetAuthor
116113

117114
</details>
118115

119-
### ![it__IT](https://img.shields.io/badge/it__IT-98.00%25-yellow)
116+
### ![it__IT](https://img.shields.io/badge/it__IT-97.75%25-yellow)
120117

121118
<details>
122119
<summary>Missing keys in it_IT.axaml</summary>
@@ -133,14 +130,16 @@ This document shows the translation status of each locale file in the repository
133130
- Text.Launcher.Workspaces
134131
- Text.Launcher.Pages
135132
- Text.Pull.RecurseSubmodules
133+
- Text.Repository.ClearStashes
136134
- Text.ResetWithoutCheckout
137135
- Text.ResetWithoutCheckout.MoveTo
138136
- Text.ResetWithoutCheckout.Target
139137
- Text.Submodule.Deinit
138+
- Text.WorkingCopy.ResetAuthor
140139

141140
</details>
142141

143-
### ![ja__JP](https://img.shields.io/badge/ja__JP-92.37%25-yellow)
142+
### ![ja__JP](https://img.shields.io/badge/ja__JP-92.01%25-yellow)
144143

145144
<details>
146145
<summary>Missing keys in ja_JP.axaml</summary>
@@ -152,6 +151,7 @@ This document shows the translation status of each locale file in the repository
152151
- Text.Bisect.Good
153152
- Text.Bisect.Skip
154153
- Text.Bisect.WaitingForRange
154+
- Text.BranchCM.CompareWithCurrent
155155
- Text.BranchCM.ResetToSelectedCommit
156156
- Text.Checkout.RecurseSubmodules
157157
- Text.CommitCM.CopyAuthor
@@ -181,6 +181,7 @@ This document shows the translation status of each locale file in the repository
181181
- Text.Repository.BranchSort
182182
- Text.Repository.BranchSort.ByCommitterDate
183183
- Text.Repository.BranchSort.ByName
184+
- Text.Repository.ClearStashes
184185
- Text.Repository.FilterCommits
185186
- Text.Repository.Search.ByContent
186187
- Text.Repository.ShowSubmodulesAsTree
@@ -206,10 +207,11 @@ This document shows the translation status of each locale file in the repository
206207
- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts
207208
- Text.WorkingCopy.Conflicts.UseMine
208209
- Text.WorkingCopy.Conflicts.UseTheirs
210+
- Text.WorkingCopy.ResetAuthor
209211

210212
</details>
211213

212-
### ![pt__BR](https://img.shields.io/badge/pt__BR-84.23%25-yellow)
214+
### ![pt__BR](https://img.shields.io/badge/pt__BR-84.02%25-yellow)
213215

214216
<details>
215217
<summary>Missing keys in pt_BR.axaml</summary>
@@ -294,6 +296,7 @@ This document shows the translation status of each locale file in the repository
294296
- Text.Repository.BranchSort
295297
- Text.Repository.BranchSort.ByCommitterDate
296298
- Text.Repository.BranchSort.ByName
299+
- Text.Repository.ClearStashes
297300
- Text.Repository.FilterCommits
298301
- Text.Repository.HistoriesLayout
299302
- Text.Repository.HistoriesLayout.Horizontal
@@ -339,13 +342,23 @@ This document shows the translation status of each locale file in the repository
339342
- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts
340343
- Text.WorkingCopy.Conflicts.UseMine
341344
- Text.WorkingCopy.Conflicts.UseTheirs
345+
- Text.WorkingCopy.ResetAuthor
342346
- Text.WorkingCopy.SignOff
343347

344348
</details>
345349

346-
### ![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen)
350+
### ![ru__RU](https://img.shields.io/badge/ru__RU-99.63%25-yellow)
351+
352+
<details>
353+
<summary>Missing keys in ru_RU.axaml</summary>
354+
355+
- Text.BranchCM.CompareWithCurrent
356+
- Text.Repository.ClearStashes
357+
- Text.WorkingCopy.ResetAuthor
358+
359+
</details>
347360

348-
### ![ta__IN](https://img.shields.io/badge/ta__IN-92.62%25-yellow)
361+
### ![ta__IN](https://img.shields.io/badge/ta__IN-92.26%25-yellow)
349362

350363
<details>
351364
<summary>Missing keys in ta_IN.axaml</summary>
@@ -357,6 +370,7 @@ This document shows the translation status of each locale file in the repository
357370
- Text.Bisect.Good
358371
- Text.Bisect.Skip
359372
- Text.Bisect.WaitingForRange
373+
- Text.BranchCM.CompareWithCurrent
360374
- Text.BranchCM.ResetToSelectedCommit
361375
- Text.Checkout.RecurseSubmodules
362376
- Text.CommitCM.CopyAuthor
@@ -386,6 +400,7 @@ This document shows the translation status of each locale file in the repository
386400
- Text.Repository.BranchSort
387401
- Text.Repository.BranchSort.ByCommitterDate
388402
- Text.Repository.BranchSort.ByName
403+
- Text.Repository.ClearStashes
389404
- Text.Repository.Search.ByContent
390405
- Text.Repository.ShowSubmodulesAsTree
391406
- Text.Repository.ViewLogs
@@ -409,10 +424,11 @@ This document shows the translation status of each locale file in the repository
409424
- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts
410425
- Text.WorkingCopy.Conflicts.UseMine
411426
- Text.WorkingCopy.Conflicts.UseTheirs
427+
- Text.WorkingCopy.ResetAuthor
412428

413429
</details>
414430

415-
### ![uk__UA](https://img.shields.io/badge/uk__UA-93.74%25-yellow)
431+
### ![uk__UA](https://img.shields.io/badge/uk__UA-93.51%25-yellow)
416432

417433
<details>
418434
<summary>Missing keys in uk_UA.axaml</summary>
@@ -449,6 +465,7 @@ This document shows the translation status of each locale file in the repository
449465
- Text.Repository.BranchSort
450466
- Text.Repository.BranchSort.ByCommitterDate
451467
- Text.Repository.BranchSort.ByName
468+
- Text.Repository.ClearStashes
452469
- Text.Repository.Search.ByContent
453470
- Text.Repository.ShowSubmodulesAsTree
454471
- Text.Repository.ViewLogs
@@ -467,6 +484,7 @@ This document shows the translation status of each locale file in the repository
467484
- Text.ViewLogs.Clear
468485
- Text.ViewLogs.CopyLog
469486
- Text.ViewLogs.Delete
487+
- Text.WorkingCopy.ResetAuthor
470488

471489
</details>
472490

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025.19
1+
2025.20

src/App.axaml.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,17 @@ public override void OnFrameworkInitializationCompleted()
393393
_ipcChannel = new Models.IpcChannel();
394394
if (!_ipcChannel.IsFirstInstance)
395395
{
396-
_ipcChannel.SendToFirstInstance(desktop.Args is { Length: 1 } ? desktop.Args[0] : string.Empty);
396+
var arg = desktop.Args is { Length: > 0 } ? desktop.Args[0].Trim() : string.Empty;
397+
if (!string.IsNullOrEmpty(arg))
398+
{
399+
if (arg.StartsWith('"') && arg.EndsWith('"'))
400+
arg = arg.Substring(1, arg.Length - 2).Trim();
401+
402+
if (arg.Length > 0 && !Path.IsPathFullyQualified(arg))
403+
arg = Path.GetFullPath(arg);
404+
}
405+
406+
_ipcChannel.SendToFirstInstance(arg);
397407
Environment.Exit(0);
398408
}
399409
else

src/Commands/Add.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System.Collections.Generic;
2-
using System.Text;
3-
4-
namespace SourceGit.Commands
1+
namespace SourceGit.Commands
52
{
63
public class Add : Command
74
{
@@ -12,20 +9,11 @@ public Add(string repo, bool includeUntracked)
129
Args = includeUntracked ? "add ." : "add -u .";
1310
}
1411

15-
public Add(string repo, List<string> changes)
12+
public Add(string repo, Models.Change change)
1613
{
1714
WorkingDirectory = repo;
1815
Context = repo;
19-
20-
var builder = new StringBuilder();
21-
builder.Append("add --");
22-
foreach (var c in changes)
23-
{
24-
builder.Append(" \"");
25-
builder.Append(c);
26-
builder.Append("\"");
27-
}
28-
Args = builder.ToString();
16+
Args = $"add -- \"{change.Path}\"";
2917
}
3018

3119
public Add(string repo, string pathspecFromFile)

src/Commands/Checkout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public bool Branch(string branch, string basedOn, bool force, bool allowOverwrit
2727
{
2828
var builder = new StringBuilder();
2929
builder.Append("checkout --progress ");
30-
builder.Append(allowOverwrite ? "-B " : "-b ");
3130
if (force)
3231
builder.Append("--force ");
32+
builder.Append(allowOverwrite ? "-B " : "-b ");
3333
builder.Append(branch);
3434
builder.Append(" ");
3535
builder.Append(basedOn);

src/Commands/Commit.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ namespace SourceGit.Commands
44
{
55
public class Commit : Command
66
{
7-
public Commit(string repo, string message, bool amend, bool signOff)
7+
public Commit(string repo, string message, bool signOff, bool amend, bool resetAuthor)
88
{
99
_tmpFile = Path.GetTempFileName();
1010
File.WriteAllText(_tmpFile, message);
1111

1212
WorkingDirectory = repo;
1313
Context = repo;
1414
Args = $"commit --allow-empty --file=\"{_tmpFile}\"";
15-
if (amend)
16-
Args += " --amend --no-edit";
1715
if (signOff)
1816
Args += " --signoff";
17+
if (amend)
18+
Args += resetAuthor ? " --amend --reset-author --no-edit" : " --amend --no-edit";
1919
}
2020

2121
public bool Run()

src/Commands/Discard.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ namespace SourceGit.Commands
88
{
99
public static class Discard
1010
{
11+
/// <summary>
12+
/// Discard all local changes (unstaged & staged)
13+
/// </summary>
14+
/// <param name="repo"></param>
15+
/// <param name="includeIgnored"></param>
16+
/// <param name="log"></param>
1117
public static void All(string repo, bool includeIgnored, Models.ICommandLog log)
1218
{
1319
var changes = new QueryLocalChanges(repo).Result();
@@ -36,11 +42,18 @@ public static void All(string repo, bool includeIgnored, Models.ICommandLog log)
3642
});
3743
}
3844

39-
new Restore(repo) { Log = log }.Exec();
45+
new Reset(repo, "HEAD", "--hard") { Log = log }.Exec();
46+
4047
if (includeIgnored)
4148
new Clean(repo) { Log = log }.Exec();
4249
}
4350

51+
/// <summary>
52+
/// Discard selected changes (only unstaged).
53+
/// </summary>
54+
/// <param name="repo"></param>
55+
/// <param name="changes"></param>
56+
/// <param name="log"></param>
4457
public static void Changes(string repo, List<Models.Change> changes, Models.ICommandLog log)
4558
{
4659
var restores = new List<string>();
@@ -71,10 +84,12 @@ public static void Changes(string repo, List<Models.Change> changes, Models.ICom
7184
});
7285
}
7386

74-
for (int i = 0; i < restores.Count; i += 10)
87+
if (restores.Count > 0)
7588
{
76-
var count = Math.Min(10, restores.Count - i);
77-
new Restore(repo, restores.GetRange(i, count), "--worktree --recurse-submodules") { Log = log }.Exec();
89+
var pathSpecFile = Path.GetTempFileName();
90+
File.WriteAllLines(pathSpecFile, restores);
91+
new Restore(repo, pathSpecFile, false) { Log = log }.Exec();
92+
File.Delete(pathSpecFile);
7893
}
7994
}
8095
}

src/Commands/FormatPatch.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public FormatPatch(string repo, string commit, string saveTo)
66
{
77
WorkingDirectory = repo;
88
Context = repo;
9+
Editor = EditorType.None;
910
Args = $"format-patch {commit} -1 --output=\"{saveTo}\"";
1011
}
1112
}

src/Commands/QueryBranches.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public QueryBranches(string repo)
5858

5959
if (b.TrackStatus == null)
6060
b.TrackStatus = new Models.BranchTrackStatus();
61-
}
61+
}
6262
}
6363
}
6464

src/Commands/QueryLocalChanges.cs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Text.RegularExpressions;
4+
45
using Avalonia.Threading;
56

67
namespace SourceGit.Commands
@@ -121,19 +122,32 @@ public QueryLocalChanges(string repo, bool includeUntracked = true)
121122
case "CD":
122123
change.Set(Models.ChangeState.Copied, Models.ChangeState.Deleted);
123124
break;
124-
case "DR":
125-
change.Set(Models.ChangeState.Deleted, Models.ChangeState.Renamed);
126-
break;
127-
case "DC":
128-
change.Set(Models.ChangeState.Deleted, Models.ChangeState.Copied);
129-
break;
130125
case "DD":
126+
change.ConflictReason = Models.ConflictReason.BothDeleted;
127+
change.Set(Models.ChangeState.None, Models.ChangeState.Conflicted);
128+
break;
131129
case "AU":
130+
change.ConflictReason = Models.ConflictReason.AddedByUs;
131+
change.Set(Models.ChangeState.None, Models.ChangeState.Conflicted);
132+
break;
132133
case "UD":
134+
change.ConflictReason = Models.ConflictReason.DeletedByThem;
135+
change.Set(Models.ChangeState.None, Models.ChangeState.Conflicted);
136+
break;
133137
case "UA":
138+
change.ConflictReason = Models.ConflictReason.AddedByThem;
139+
change.Set(Models.ChangeState.None, Models.ChangeState.Conflicted);
140+
break;
134141
case "DU":
142+
change.ConflictReason = Models.ConflictReason.DeletedByUs;
143+
change.Set(Models.ChangeState.None, Models.ChangeState.Conflicted);
144+
break;
135145
case "AA":
146+
change.ConflictReason = Models.ConflictReason.BothAdded;
147+
change.Set(Models.ChangeState.None, Models.ChangeState.Conflicted);
148+
break;
136149
case "UU":
150+
change.ConflictReason = Models.ConflictReason.BothModified;
137151
change.Set(Models.ChangeState.None, Models.ChangeState.Conflicted);
138152
break;
139153
case "??":

0 commit comments

Comments
 (0)