Skip to content

Commit d89a00e

Browse files
committed
code_style: using avalonia's editorconfig and run dotnet format.
1 parent 3c38f68 commit d89a00e

File tree

233 files changed

+1798
-1246
lines changed

Some content is hidden

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

233 files changed

+1798
-1246
lines changed

.editorconfig

Lines changed: 234 additions & 308 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
1-
# SourceGit
2-
3-
Opensource Git GUI client.
4-
5-
## Highlights
6-
7-
* Supports Windows/macOS/Linux
8-
* Opensource/Free
9-
* Fast
10-
* English/简体中文
11-
* Built-in light/dark themes
12-
* Visual commit graph
13-
* Supports SSH access with each remote
14-
* GIT commands with GUI
15-
* Clone/Fetch/Pull/Push...
16-
* Branches
17-
* Remotes
18-
* Tags
19-
* Stashes
20-
* Submodules
21-
* Archive
22-
* Diff
23-
* Save as patch/apply
24-
* File histories
25-
* Blame
26-
* Revision Diffs
27-
* GitFlow support
28-
29-
> **Linux** only tested on **Ubuntu 22.04** on **X11**.
30-
31-
## How to use
32-
33-
**To use this tool, you need to install Git first.**
34-
35-
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 each commits.
36-
37-
For **macOS** users:
38-
39-
* Download `SourceGit.osx-x64.zip` or `SourceGit.osx-arm64.zip` from Releases. `x64` for Intel and `arm64` for Apple Silicon.
40-
* Move `SourceGit.app` to `Applications` folder.
41-
* Make sure your mac trusts all software from anywhere. For more information, search `spctl --master-disable`.
42-
* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your mac.
43-
* You may need to run `sudo xattr -cr /Applications/SourceGit.app` to make sure the software works.
44-
45-
For **Linux** users:
46-
47-
* `xdg-open` must be installed to support open native file manager.
48-
* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your linux, and it requires `ttf-mscorefonts-installer` installed.
49-
* Maybe you need to set environment variable `AVALONIA_SCREEN_SCALE_FACTORS`. See https://github.com/AvaloniaUI/Avalonia/wiki/Configuring-X11-per-monitor-DPI.
50-
* Modify `SourceGit.desktop.template` (replace SOURCEGIT_LOCAL_FOLDER with real path) and move it into `~/.local/share/applications`.
51-
52-
## Screen Shots
53-
54-
* Dark Theme
55-
56-
![Theme Dark](./screenshots/theme_dark.png)
57-
58-
* Light Theme
59-
60-
![Theme Light](./screenshots/theme_light.png)
61-
62-
## Contributing
63-
64-
Thanks to all the people who contribute.
65-
66-
<a href="https://github.com/sourcegit-scm/sourcegit/graphs/contributors">
67-
<img src="https://contrib.rocks/image?repo=sourcegit-scm/sourcegit" />
68-
</a>
1+
# SourceGit
2+
3+
Opensource Git GUI client.
4+
5+
## Highlights
6+
7+
* Supports Windows/macOS/Linux
8+
* Opensource/Free
9+
* Fast
10+
* English/简体中文
11+
* Built-in light/dark themes
12+
* Visual commit graph
13+
* Supports SSH access with each remote
14+
* GIT commands with GUI
15+
* Clone/Fetch/Pull/Push...
16+
* Branches
17+
* Remotes
18+
* Tags
19+
* Stashes
20+
* Submodules
21+
* Archive
22+
* Diff
23+
* Save as patch/apply
24+
* File histories
25+
* Blame
26+
* Revision Diffs
27+
* GitFlow support
28+
29+
> **Linux** only tested on **Ubuntu 22.04** on **X11**.
30+
31+
## How to use
32+
33+
**To use this tool, you need to install Git first.**
34+
35+
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 each commits.
36+
37+
For **macOS** users:
38+
39+
* Download `SourceGit.osx-x64.zip` or `SourceGit.osx-arm64.zip` from Releases. `x64` for Intel and `arm64` for Apple Silicon.
40+
* Move `SourceGit.app` to `Applications` folder.
41+
* Make sure your mac trusts all software from anywhere. For more information, search `spctl --master-disable`.
42+
* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your mac.
43+
* You may need to run `sudo xattr -cr /Applications/SourceGit.app` to make sure the software works.
44+
45+
For **Linux** users:
46+
47+
* `xdg-open` must be installed to support open native file manager.
48+
* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your linux, and it requires `ttf-mscorefonts-installer` installed.
49+
* Maybe you need to set environment variable `AVALONIA_SCREEN_SCALE_FACTORS`. See https://github.com/AvaloniaUI/Avalonia/wiki/Configuring-X11-per-monitor-DPI.
50+
* Modify `SourceGit.desktop.template` (replace SOURCEGIT_LOCAL_FOLDER with real path) and move it into `~/.local/share/applications`.
51+
52+
## Screen Shots
53+
54+
* Dark Theme
55+
56+
![Theme Dark](./screenshots/theme_dark.png)
57+
58+
* Light Theme
59+
60+
![Theme Light](./screenshots/theme_light.png)
61+
62+
## Contributing
63+
64+
Thanks to all the people who contribute.
65+
66+
<a href="https://github.com/sourcegit-scm/sourcegit/graphs/contributors">
67+
<img src="https://contrib.rocks/image?repo=sourcegit-scm/sourcegit" />
68+
</a>

src/SourceGit/App.JsonCodeGen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ namespace SourceGit
66
[JsonSerializable(typeof(Models.Version))]
77
[JsonSerializable(typeof(ViewModels.Preference))]
88
internal partial class JsonCodeGen : JsonSerializerContext { }
9-
}
9+
}

src/SourceGit/App.axaml.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ public static async void CopyText(string data)
143143
public static string Text(string key, params object[] args)
144144
{
145145
var fmt = Current.FindResource($"Text.{key}") as string;
146-
if (string.IsNullOrWhiteSpace(fmt)) return $"Text.{key}";
146+
if (string.IsNullOrWhiteSpace(fmt))
147+
return $"Text.{key}";
147148
return string.Format(fmt, args);
148149
}
149150

@@ -178,27 +179,31 @@ public static void Check4Update(bool manually = false)
178179

179180
// Parse json into Models.Version.
180181
var ver = JsonSerializer.Deserialize(data, JsonCodeGen.Default.Version);
181-
if (ver == null) return;
182+
if (ver == null)
183+
return;
182184

183185
// Check if already up-to-date.
184186
if (!ver.IsNewVersion)
185187
{
186-
if (manually) ShowSelfUpdateResult(new Models.AlreadyUpToDate());
188+
if (manually)
189+
ShowSelfUpdateResult(new Models.AlreadyUpToDate());
187190
return;
188191
}
189192

190193
// Should not check ignored tag if this is called manually.
191194
if (!manually)
192195
{
193196
var pref = ViewModels.Preference.Instance;
194-
if (ver.TagName == pref.IgnoreUpdateTag) return;
197+
if (ver.TagName == pref.IgnoreUpdateTag)
198+
return;
195199
}
196200

197201
ShowSelfUpdateResult(ver);
198202
}
199203
catch (Exception e)
200204
{
201-
if (manually) ShowSelfUpdateResult(e);
205+
if (manually)
206+
ShowSelfUpdateResult(e);
202207
}
203208
});
204209
}
@@ -232,7 +237,8 @@ public override void OnFrameworkInitializationCompleted()
232237
_notificationReceiver = launcher;
233238
desktop.MainWindow = launcher;
234239

235-
if (ViewModels.Preference.Instance.Check4UpdatesOnStartup) Check4Update();
240+
if (ViewModels.Preference.Instance.Check4UpdatesOnStartup)
241+
Check4Update();
236242
}
237243

238244
base.OnFrameworkInitializationCompleted();
@@ -260,4 +266,4 @@ private static void ShowSelfUpdateResult(object data)
260266
private ResourceDictionary _activeLocale = null;
261267
private Models.INotificationReceiver _notificationReceiver = null;
262268
}
263-
}
269+
}

src/SourceGit/Commands/Add.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ public Add(string repo, List<Models.Change> changes = null)
2828
}
2929
}
3030
}
31-
}
31+
}

src/SourceGit/Commands/Apply.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ public Apply(string repo, string file, bool ignoreWhitespace, string whitespaceM
77
WorkingDirectory = repo;
88
Context = repo;
99
Args = "apply ";
10-
if (ignoreWhitespace) Args += "--ignore-whitespace ";
11-
else Args += $"--whitespace={whitespaceMode} ";
12-
if (!string.IsNullOrEmpty(extra)) Args += $"{extra} ";
10+
if (ignoreWhitespace)
11+
Args += "--ignore-whitespace ";
12+
else
13+
Args += $"--whitespace={whitespaceMode} ";
14+
if (!string.IsNullOrEmpty(extra))
15+
Args += $"{extra} ";
1316
Args += $"\"{file}\"";
1417
}
1518
}
16-
}
19+
}

src/SourceGit/Commands/Archive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ protected override void OnReadline(string line)
2020

2121
private readonly Action<string> _outputHandler;
2222
}
23-
}
23+
}

src/SourceGit/Commands/AssumeUnchanged.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ public partial class AssumeUnchanged
77
{
88
partial class ViewCommand : Command
99
{
10-
1110
[GeneratedRegex(@"^(\w)\s+(.+)$")]
1211
private static partial Regex REG();
1312

@@ -27,7 +26,8 @@ public List<string> Result()
2726
protected override void OnReadline(string line)
2827
{
2928
var match = REG().Match(line);
30-
if (!match.Success) return;
29+
if (!match.Success)
30+
return;
3131

3232
if (match.Groups[1].Value == "h")
3333
{
@@ -72,4 +72,4 @@ public void Remove(string file)
7272

7373
private readonly string _repo;
7474
}
75-
}
75+
}

src/SourceGit/Commands/Blame.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ public Models.BlameData Result()
4646

4747
protected override void OnReadline(string line)
4848
{
49-
if (_result.IsBinary) return;
50-
if (string.IsNullOrEmpty(line)) return;
49+
if (_result.IsBinary)
50+
return;
51+
if (string.IsNullOrEmpty(line))
52+
return;
5153

5254
if (line.IndexOf('\0', StringComparison.Ordinal) >= 0)
5355
{
@@ -57,7 +59,8 @@ protected override void OnReadline(string line)
5759
}
5860

5961
var match = REG_FORMAT().Match(line);
60-
if (!match.Success) return;
62+
if (!match.Success)
63+
return;
6164

6265
_content.AppendLine(match.Groups[4].Value);
6366

@@ -90,4 +93,4 @@ protected override void OnReadline(string line)
9093
private bool _needUnifyCommitSHA = false;
9194
private int _minSHALen = 64;
9295
}
93-
}
96+
}

src/SourceGit/Commands/Branch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ public static bool Delete(string repo, string name)
4545
return cmd.Exec();
4646
}
4747
}
48-
}
48+
}

0 commit comments

Comments
 (0)