diff --git a/.editorconfig b/.editorconfig index 3ad9d05b..22c741b9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -206,6 +206,9 @@ dotnet_diagnostic.CA1854.severity = warning #CA2211:Non-constant fields should not be visible dotnet_diagnostic.CA2211.severity = error +# IDE0005: remove used namespace using +dotnet_diagnostic.IDE0005.severity = error + # Wrapping preferences csharp_wrap_before_ternary_opsigns = false @@ -293,6 +296,10 @@ end_of_line = lf [*.{cmd,bat}] end_of_line = crlf +# Package manifests +[{*.spec,control}] +end_of_line = lf + # YAML files [*.{yml,yaml}] indent_size = 2 diff --git a/.gitattributes b/.gitattributes index 7410eb08..bd1dfea9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,10 +3,12 @@ *.png binary *.ico binary *.sh text eol=lf +*.spec text eol=lf +control text eol=lf *.bat text eol=crlf *.cmd text eol=crlf *.ps1 text eol=crlf *.json text .gitattributes export-ignore -.gitignore export-ignore \ No newline at end of file +.gitignore export-ignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad62efb6..d4117364 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Configure arm64 packages if: ${{ matrix.runtime == 'linux-arm64' }} run: | diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 53affe3d..e973c1ab 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -3,7 +3,7 @@ on: workflow_call: inputs: version: - description: Source Git package version + description: SourceGit package version required: true type: string jobs: diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml new file mode 100644 index 00000000..9e465fe7 --- /dev/null +++ b/.github/workflows/publish-packages.yml @@ -0,0 +1,39 @@ +name: Publish to Buildkite +on: + workflow_call: + secrets: + BUILDKITE_TOKEN: + required: true +jobs: + publish: + name: Publish to Buildkite + runs-on: ubuntu-latest + strategy: + matrix: + runtime: [linux-x64, linux-arm64] + steps: + - name: Download package artifacts + uses: actions/download-artifact@v4 + with: + name: package.${{ matrix.runtime }} + path: packages + + - name: Publish DEB package + env: + BUILDKITE_TOKEN: ${{ secrets.BUILDKITE_TOKEN }} + run: | + FILE=$(echo packages/*.deb) + curl -X POST https://api.buildkite.com/v2/packages/organizations/sourcegit/registries/sourcegit-deb/packages \ + -H "Authorization: Bearer $BUILDKITE_TOKEN" \ + -F "file=@$FILE" \ + --fail + + - name: Publish RPM package + env: + BUILDKITE_TOKEN: ${{ secrets.BUILDKITE_TOKEN }} + run: | + FILE=$(echo packages/*.rpm) + curl -X POST https://api.buildkite.com/v2/packages/organizations/sourcegit/registries/sourcegit-rpm/packages \ + -H "Authorization: Bearer $BUILDKITE_TOKEN" \ + -F "file=@$FILE" \ + --fail diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c19103e3..223fe75f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,12 @@ jobs: uses: ./.github/workflows/package.yml with: version: ${{ needs.version.outputs.version }} + publish-packages: + needs: [package, version] + name: Publish Packages + uses: ./.github/workflows/publish-packages.yml + secrets: + BUILDKITE_TOKEN: ${{ secrets.BUILDKITE_TOKEN }} release: needs: [package, version] name: Release diff --git a/README.md b/README.md index a0fe4147..6916edbc 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * Supports Windows/macOS/Linux * Opensource/Free * Fast -* Deutsch/English/Español/Français/Português/Русский/简体中文/繁體中文 +* Deutsch/English/Español/Français/Italiano/Português/Русский/简体中文/繁體中文 * Built-in light/dark themes * Customize theme * Visual commit graph @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-98.41%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-99.57%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-86.31%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.57%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) +[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-97.50%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-97.78%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-95.00%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-95.56%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-96.81%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-97.92%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) ## How to Use @@ -98,9 +98,37 @@ For **macOS** users: For **Linux** users: +* For Debian/Ubuntu based distributions, you can add the `sourcegit` repository by following: + You may need to install curl and/or gpg first, if you're on a very minimal host: + ```shell + apt update && apt install curl gpg -y + ``` + Install the registry signing key: + ```shell + curl -fsSL "https://packages.buildkite.com/sourcegit/sourcegit-deb/gpgkey" | gpg --dearmor -o /etc/apt/keyrings/sourcegit_sourcegit-deb-archive-keyring.gpg + ``` + Configure the source: + ```shell + echo -e "deb [signed-by=/etc/apt/keyrings/sourcegit_sourcegit-deb-archive-keyring.gpg] https://packages.buildkite.com/sourcegit/sourcegit-deb/any/ any main\ndeb-src [signed-by=/etc/apt/keyrings/sourcegit_sourcegit-deb-archive-keyring.gpg] https://packages.buildkite.com/sourcegit/sourcegit-deb/any/ any main" > /etc/apt/sources.list.d/buildkite-sourcegit-sourcegit-deb.list + ``` + Update your local repository and install the package: + ```shell + apt update && apt install sourcegit + ``` +* For RHEL/Fedora based distributions, you can add the `sourcegit` repository by following: + Configure the source: + ```shell + sudo sh -c 'echo -e "[sourcegit-rpm]\nname=sourcegit-rpm\nbaseurl=https://packages.buildkite.com/sourcegit/sourcegit-rpm/rpm_any/rpm_any/\$basearch\nenabled=1\nrepo_gpgcheck=1\ngpgcheck=0\ngpgkey=https://packages.buildkite.com/sourcegit/sourcegit-rpm/gpgkey\npriority=1"' > /etc/yum.repos.d/sourcegit-rpm.repo + ``` + Install the package with this command: + ```shell + sudo dnf install -y sourcegit + ``` +* `Appimage` files can be found on [AppimageHub](https://appimage.github.io/SourceGit/) * `xdg-open` must be installed to support open native file manager. * Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your linux. * Maybe you need to set environment variable `AVALONIA_SCREEN_SCALE_FACTORS`. See https://github.com/AvaloniaUI/Avalonia/wiki/Configuring-X11-per-monitor-DPI. +* If you can NOT type accented characters, such as `ê`, `ó`, try to set the environment variable `AVALONIA_IM_MODULE` to `none`. ## OpenAI diff --git a/SourceGit.sln b/SourceGit.sln index 9799a09e..3eeb8a54 100644 --- a/SourceGit.sln +++ b/SourceGit.sln @@ -13,10 +13,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{F45A EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{67B6D05F-A000-40BA-ADB4-C9065F880D7B}" ProjectSection(SolutionItems) = preProject + .github\workflows\build.yml = .github\workflows\build.yml .github\workflows\ci.yml = .github\workflows\ci.yml .github\workflows\package.yml = .github\workflows\package.yml .github\workflows\release.yml = .github\workflows\release.yml .github\workflows\localization-check.yml = .github\workflows\localization-check.yml + .github\workflows\publish-packages.yml = .github\workflows\publish-packages.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{49A7C2D6-558C-4FAA-8F5D-EEE81497AED7}" diff --git a/TRANSLATION.md b/TRANSLATION.md index b85511df..6e743f14 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,158 +1,194 @@ -### de_DE.axaml: 98.41% +### de_DE.axaml: 97.50%
Missing Keys -- Text.Diff.SaveAsPatch -- Text.Diff.VisualLines.All -- Text.Hotkeys.Repo.CreateBranchOnCommit -- Text.Hotkeys.Repo.Fetch -- Text.Hotkeys.Repo.Pull -- Text.Hotkeys.Repo.Push -- Text.IssueLinkCM.OpenInBrowser -- Text.IssueLinkCM.CopyLink -- Text.Preference.Appearance.FontSize -- Text.Preference.Appearance.FontSize.Default -- Text.Preference.Appearance.FontSize.Editor +- Text.BranchCM.MergeMultiBranches +- Text.CommitCM.Merge +- Text.CommitCM.MergeMultiple +- Text.CommitDetail.Files.Search +- Text.Diff.UseBlockNavigation +- Text.FileCM.ResolveUsing +- Text.Hotkeys.Global.Clone +- Text.InProgress.CherryPick.Head +- Text.InProgress.Merge.Operating +- Text.InProgress.Rebase.StoppedAt +- Text.InProgress.Revert.Head +- Text.Merge.Source +- Text.MergeMultiple +- Text.MergeMultiple.CommitChanges +- Text.MergeMultiple.Strategy +- Text.MergeMultiple.Targets +- Text.Repository.Skip +- Text.WorkingCopy.CommitToEdit
-### es_ES.axaml: 99.57% +### es_ES.axaml: 97.78%
Missing Keys -- Text.Preference.Appearance.FontSize -- Text.Preference.Appearance.FontSize.Default -- Text.Preference.Appearance.FontSize.Editor +- Text.BranchCM.MergeMultiBranches +- Text.CommitCM.Merge +- Text.CommitCM.MergeMultiple +- Text.Diff.UseBlockNavigation +- Text.FileCM.ResolveUsing +- Text.Hotkeys.Global.Clone +- Text.InProgress.CherryPick.Head +- Text.InProgress.Merge.Operating +- Text.InProgress.Rebase.StoppedAt +- Text.InProgress.Revert.Head +- Text.Merge.Source +- Text.MergeMultiple +- Text.MergeMultiple.CommitChanges +- Text.MergeMultiple.Strategy +- Text.MergeMultiple.Targets +- Text.Repository.Skip
-### fr_FR.axaml: 86.31% +### fr_FR.axaml: 95.00%
Missing Keys -- Text.About.Chart -- Text.AIAssistant -- Text.AIAssistant.Tip -- Text.BranchCM.FetchInto -- Text.ChangeCM.GenerateCommitMessage +- Text.BranchCM.MergeMultiBranches - Text.CherryPick.AppendSourceToMessage -- Text.CherryPick.Mainline - Text.CherryPick.Mainline.Tips - Text.CommitCM.CherryPickMultiple -- Text.CommitCM.CustomAction -- Text.CommitCM.SquashCommitsSinceThis -- Text.CommitDetail.Info.WebLinks -- Text.Configure.CustomAction -- Text.Configure.CustomAction.Arguments -- Text.Configure.CustomAction.Arguments.Tip -- Text.Configure.CustomAction.Executable -- Text.Configure.CustomAction.Name -- Text.Configure.CustomAction.Scope -- Text.Configure.CustomAction.Scope.Commit -- Text.Configure.CustomAction.Scope.Repository -- Text.Configure.Git.DefaultRemote -- Text.Configure.Git.EnablePruneOnFetch -- Text.Configure.Git.EnableSignOff -- Text.Configure.IssueTracker.AddSampleGitLabIssue -- Text.Configure.IssueTracker.AddSampleGitLabMergeRequest -- Text.Configure.OpenAI -- Text.Configure.OpenAI.Prefered -- Text.Configure.OpenAI.Prefered.Tip -- Text.ConfigureWorkspace -- Text.ConfigureWorkspace.Color -- Text.ConfigureWorkspace.Restore -- Text.ConventionalCommit -- Text.ConventionalCommit.BreakingChanges -- Text.ConventionalCommit.ClosedIssue -- Text.ConventionalCommit.Detail -- Text.ConventionalCommit.Scope -- Text.ConventionalCommit.ShortDescription -- Text.ConventionalCommit.Type -- Text.Diff.IgnoreWhitespace -- Text.Diff.SaveAsPatch -- Text.Diff.VisualLines.All -- Text.Discard.IncludeIgnored -- Text.ExecuteCustomAction -- Text.ExecuteCustomAction.Name -- Text.FileHistory.FileChange -- Text.GitLFS.Locks.OnlyMine -- Text.Histories.Header.AuthorTime -- Text.Histories.Tips -- Text.Histories.Tips.MacOS -- Text.Histories.Tips.Prefix -- Text.Hotkeys.Repo.CommitWithAutoStage -- Text.Hotkeys.Repo.CreateBranchOnCommit -- Text.Hotkeys.Repo.DiscardSelected -- Text.Hotkeys.Repo.Fetch -- Text.Hotkeys.Repo.Pull -- Text.Hotkeys.Repo.Push -- Text.IssueLinkCM.OpenInBrowser -- Text.IssueLinkCM.CopyLink -- Text.MoveRepositoryNode -- Text.MoveRepositoryNode.Target -- Text.Preference.AI -- Text.Preference.AI.AnalyzeDiffPrompt -- Text.Preference.AI.ApiKey -- Text.Preference.AI.GenerateSubjectPrompt -- Text.Preference.AI.Model -- Text.Preference.AI.Name -- Text.Preference.AI.Server +- Text.CommitCM.Merge +- Text.CommitCM.MergeMultiple +- Text.CommitDetail.Files.Search +- Text.Diff.UseBlockNavigation +- Text.Fetch.Force +- Text.FileCM.ResolveUsing +- Text.Hotkeys.Global.Clone +- Text.InProgress.CherryPick.Head +- Text.InProgress.Merge.Operating +- Text.InProgress.Rebase.StoppedAt +- Text.InProgress.Revert.Head +- Text.Merge.Source +- Text.MergeMultiple +- Text.MergeMultiple.CommitChanges +- Text.MergeMultiple.Strategy +- Text.MergeMultiple.Targets - Text.Preference.Appearance.FontSize - Text.Preference.Appearance.FontSize.Default - Text.Preference.Appearance.FontSize.Editor -- Text.Preference.General.ShowAuthorTime -- Text.Preference.Integration -- Text.Preference.Shell -- Text.Preference.Shell.Type -- Text.Preference.Shell.Path -- Text.Repository.AutoFetching +- Text.Preference.General.ShowChildren - Text.Repository.CustomActions -- Text.Repository.CustomActions.Empty -- Text.Repository.EnableReflog -- Text.Repository.Search.InCurrentBranch +- Text.Repository.FilterCommits +- Text.Repository.FilterCommits.Default +- Text.Repository.FilterCommits.Exclude +- Text.Repository.FilterCommits.Include +- Text.Repository.HistoriesOrder +- Text.Repository.HistoriesOrder.ByDate +- Text.Repository.HistoriesOrder.Topo +- Text.Repository.Skip - Text.ScanRepositories -- Text.ScanRepositories.RootDir -- Text.Squash.Into -- Text.Stash.KeepIndex -- Text.Stash.OnlyStagedChanges -- Text.Stash.TipForSelectedFiles -- Text.Statistics.Overview -- Text.TagCM.CopyMessage -- Text.Welcome.Move -- Text.Welcome.ScanDefaultCloneDir -- Text.WorkingCopy.CommitTip -- Text.WorkingCopy.CommitWithAutoStage -- Text.WorkingCopy.ConfirmCommitWithoutFiles -- Text.Workspace -- Text.Workspace.Configure +- Text.SHALinkCM.NavigateTo +- Text.WorkingCopy.CommitToEdit
-### pt_BR.axaml: 99.57% +### it_IT.axaml: 95.56%
Missing Keys -- Text.Preference.Appearance.FontSize -- Text.Preference.Appearance.FontSize.Default -- Text.Preference.Appearance.FontSize.Editor +- Text.BranchCM.MergeMultiBranches +- Text.CommitCM.Merge +- Text.CommitCM.MergeMultiple +- Text.CommitDetail.Files.Search +- Text.CommitDetail.Info.Children +- Text.Configure.IssueTracker.AddSampleGitLabMergeRequest +- Text.Configure.OpenAI.Preferred +- Text.Configure.OpenAI.Preferred.Tip +- Text.Diff.UseBlockNavigation +- Text.Fetch.Force +- Text.FileCM.ResolveUsing +- Text.InProgress.CherryPick.Head +- Text.InProgress.Merge.Operating +- Text.InProgress.Rebase.StoppedAt +- Text.InProgress.Revert.Head +- Text.Merge.Source +- Text.MergeMultiple +- Text.MergeMultiple.CommitChanges +- Text.MergeMultiple.Strategy +- Text.MergeMultiple.Targets +- Text.Preference.General.ShowChildren +- Text.Repository.FilterCommits +- Text.Repository.FilterCommits.Default +- Text.Repository.FilterCommits.Exclude +- Text.Repository.FilterCommits.Include +- Text.Repository.HistoriesOrder +- Text.Repository.HistoriesOrder.ByDate +- Text.Repository.HistoriesOrder.Topo +- Text.Repository.Skip +- Text.SHALinkCM.CopySHA +- Text.SHALinkCM.NavigateTo +- Text.WorkingCopy.CommitToEdit
-### ru_RU.axaml: 100.00% +### pt_BR.axaml: 96.81%
Missing Keys +- Text.BranchCM.MergeMultiBranches +- Text.CommitCM.Merge +- Text.CommitCM.MergeMultiple +- Text.CommitDetail.Files.Search +- Text.CommitDetail.Info.Children +- Text.Diff.UseBlockNavigation +- Text.Fetch.Force +- Text.FileCM.ResolveUsing +- Text.Hotkeys.Global.Clone +- Text.InProgress.CherryPick.Head +- Text.InProgress.Merge.Operating +- Text.InProgress.Rebase.StoppedAt +- Text.InProgress.Revert.Head +- Text.Merge.Source +- Text.MergeMultiple +- Text.MergeMultiple.CommitChanges +- Text.MergeMultiple.Strategy +- Text.MergeMultiple.Targets +- Text.Preference.General.ShowChildren +- Text.Repository.FilterCommits +- Text.Repository.Skip +- Text.SHALinkCM.NavigateTo +- Text.WorkingCopy.CommitToEdit +
+ +### ru_RU.axaml: 97.92% + + +
+Missing Keys + +- Text.BranchCM.MergeMultiBranches +- Text.CommitCM.Merge +- Text.CommitCM.MergeMultiple +- Text.FileCM.ResolveUsing +- Text.Hotkeys.Global.Clone +- Text.InProgress.CherryPick.Head +- Text.InProgress.Merge.Operating +- Text.InProgress.Rebase.StoppedAt +- Text.InProgress.Revert.Head +- Text.Merge.Source +- Text.MergeMultiple +- Text.MergeMultiple.CommitChanges +- Text.MergeMultiple.Strategy +- Text.MergeMultiple.Targets +- Text.Repository.Skip
diff --git a/VERSION b/VERSION index 833d11c8..d72e21bd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.38 \ No newline at end of file +8.42 \ No newline at end of file diff --git a/build/README.md b/build/README.md index a75f4d73..b4358a55 100644 --- a/build/README.md +++ b/build/README.md @@ -5,7 +5,7 @@ ## How to build this project manually -1. Make sure [.NET SDK 8](https://dotnet.microsoft.com/en-us/download) is installed on your machine. +1. Make sure [.NET SDK 9](https://dotnet.microsoft.com/en-us/download) is installed on your machine. 2. Clone this project 3. Run the follow command under the project root dir ```sh diff --git a/build/resources/_common/applications/sourcegit.desktop b/build/resources/_common/applications/sourcegit.desktop index ff7ef135..bcf9c813 100644 --- a/build/resources/_common/applications/sourcegit.desktop +++ b/build/resources/_common/applications/sourcegit.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Name=Source Git +Name=SourceGit Comment=Open-source & Free Git GUI Client Exec=/opt/sourcegit/sourcegit Icon=/usr/share/icons/sourcegit.png diff --git a/build/resources/rpm/SPECS/build.spec b/build/resources/rpm/SPECS/build.spec index 9dda5f96..bc10ca48 100644 --- a/build/resources/rpm/SPECS/build.spec +++ b/build/resources/rpm/SPECS/build.spec @@ -5,8 +5,9 @@ Summary: Open-source & Free Git Gui Client License: MIT URL: https://sourcegit-scm.github.io/ Source: https://github.com/sourcegit-scm/sourcegit/archive/refs/tags/v%_version.tar.gz -Requires: (libX11 or libX11-6) -Requires: (libSM or libSM6) +Requires: libX11.so.6()(%{__isa_bits}bit) +Requires: libSM.so.6()(%{__isa_bits}bit) +Requires: libicu %define _build_id_links none diff --git a/build/scripts/package.linux.sh b/build/scripts/package.linux.sh index 5ffd5a27..5abb058b 100755 --- a/build/scripts/package.linux.sh +++ b/build/scripts/package.linux.sh @@ -5,16 +5,6 @@ set -o set -u set pipefail -if [[ -z "$VERSION" ]]; then - echo "Provide the version as environment variable VERSION" - exit 1 -fi - -if [[ -z "$RUNTIME" ]]; then - echo "Provide the runtime as environment variable RUNTIME" - exit 1 -fi - arch= appimage_arch= target= diff --git a/build/scripts/package.osx-app.sh b/build/scripts/package.osx-app.sh index 4a50a860..2d43e24a 100755 --- a/build/scripts/package.osx-app.sh +++ b/build/scripts/package.osx-app.sh @@ -5,16 +5,6 @@ set -o set -u set pipefail -if [[ -z "$VERSION" ]]; then - echo "Provide the version as environment variable VERSION" - exit 1 -fi - -if [[ -z "$RUNTIME" ]]; then - echo "Provide the runtime as environment variable RUNTIME" - exit 1 -fi - cd build mkdir -p SourceGit.app/Contents/Resources diff --git a/build/scripts/package.windows-portable.sh b/build/scripts/package.windows-portable.sh index 9ba29216..6bd3879b 100755 --- a/build/scripts/package.windows-portable.sh +++ b/build/scripts/package.windows-portable.sh @@ -5,16 +5,6 @@ set -o set -u set pipefail -if [[ -z "$VERSION" ]]; then - echo "Provide the version as environment variable VERSION" - exit 1 -fi - -if [[ -z "$RUNTIME" ]]; then - echo "Provide the runtime as environment variable RUNTIME" - exit 1 -fi - cd build rm -rf SourceGit/*.pdb diff --git a/global.json b/global.json index b5b37b60..a27a2b82 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.0", + "version": "9.0.0", "rollForward": "latestMajor", "allowPrerelease": false } diff --git a/src/App.axaml b/src/App.axaml index 0b809a84..59418965 100644 --- a/src/App.axaml +++ b/src/App.axaml @@ -14,6 +14,7 @@ + diff --git a/src/App.axaml.cs b/src/App.axaml.cs index dfec763b..0615724a 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -478,17 +478,20 @@ namespace SourceGit if (args.Length <= 1 || !args[0].Equals("--rebase-message-editor", StringComparison.Ordinal)) return false; + exitCode = 0; + var file = args[1]; var filename = Path.GetFileName(file); if (!filename.Equals("COMMIT_EDITMSG", StringComparison.OrdinalIgnoreCase)) return true; - var jobsFile = Path.Combine(Path.GetDirectoryName(file)!, "sourcegit_rebase_jobs.json"); + var gitDir = Path.GetDirectoryName(file)!; + var jobsFile = Path.Combine(gitDir, "sourcegit_rebase_jobs.json"); if (!File.Exists(jobsFile)) return true; var collection = JsonSerializer.Deserialize(File.ReadAllText(jobsFile), JsonCodeGen.Default.InteractiveRebaseJobCollection); - var doneFile = Path.Combine(Path.GetDirectoryName(file)!, "rebase-merge", "done"); + var doneFile = Path.Combine(gitDir, "rebase-merge", "done"); if (!File.Exists(doneFile)) return true; @@ -499,7 +502,6 @@ namespace SourceGit var job = collection.Jobs[done.Length - 1]; File.WriteAllText(file, job.Message); - exitCode = 0; return true; } diff --git a/src/Commands/Branch.cs b/src/Commands/Branch.cs index 890b54ee..391aeeb2 100644 --- a/src/Commands/Branch.cs +++ b/src/Commands/Branch.cs @@ -2,6 +2,15 @@ { public static class Branch { + public static string ShowCurrent(string repo) + { + var cmd = new Command(); + cmd.WorkingDirectory = repo; + cmd.Context = repo; + cmd.Args = $"branch --show-current"; + return cmd.ReadToEnd().StdOut.Trim(); + } + public static bool Create(string repo, string name, string basedOn) { var cmd = new Command(); @@ -48,8 +57,18 @@ var cmd = new Command(); cmd.WorkingDirectory = repo; cmd.Context = repo; - cmd.SSHKey = new Config(repo).Get($"remote.{remote}.sshkey"); - cmd.Args = $"push {remote} --delete {name}"; + + bool exists = new Remote(repo).HasBranch(remote, name); + if (exists) + { + cmd.SSHKey = new Config(repo).Get($"remote.{remote}.sshkey"); + cmd.Args = $"push {remote} --delete {name}"; + } + else + { + cmd.Args = $"branch -D -r {remote}/{name}"; + } + return cmd.Exec(); } } diff --git a/src/Commands/Command.cs b/src/Commands/Command.cs index 8d304410..96a5b9c9 100644 --- a/src/Commands/Command.cs +++ b/src/Commands/Command.cs @@ -74,7 +74,11 @@ namespace SourceGit.Commands } if (string.IsNullOrEmpty(e.Data)) + { + errs.Add(string.Empty); return; + } + if (TraitErrorAsOutput) OnReadline(e.Data); @@ -89,6 +93,7 @@ namespace SourceGit.Commands return; if (REG_PROGRESS().IsMatch(e.Data)) return; + errs.Add(e.Data); }; @@ -99,12 +104,8 @@ namespace SourceGit.Commands catch (Exception e) { if (RaiseError) - { - Dispatcher.UIThread.Invoke(() => - { - App.RaiseException(Context, e.Message); - }); - } + Dispatcher.UIThread.Post(() => App.RaiseException(Context, e.Message)); + return false; } @@ -115,15 +116,15 @@ namespace SourceGit.Commands int exitCode = proc.ExitCode; proc.Close(); - if (!isCancelled && exitCode != 0 && errs.Count > 0) + if (!isCancelled && exitCode != 0) { if (RaiseError) { - Dispatcher.UIThread.Invoke(() => - { - App.RaiseException(Context, string.Join("\n", errs)); - }); + var errMsg = string.Join("\n", errs); + if (!string.IsNullOrWhiteSpace(errMsg)) + Dispatcher.UIThread.Post(() => App.RaiseException(Context, errMsg)); } + return false; } diff --git a/src/Commands/Diff.cs b/src/Commands/Diff.cs index cb9e6a18..da971e58 100644 --- a/src/Commands/Diff.cs +++ b/src/Commands/Diff.cs @@ -28,9 +28,9 @@ namespace SourceGit.Commands Context = repo; if (ignoreWhitespace) - Args = $"diff --patch --ignore-cr-at-eol --ignore-all-space --unified={unified} {opt}"; + Args = $"-c core.autocrlf=false diff --no-ext-diff --patch --ignore-cr-at-eol --ignore-all-space --unified={unified} {opt}"; else - Args = $"diff --patch --ignore-cr-at-eol --unified={unified} {opt}"; + Args = $"-c core.autocrlf=false diff --no-ext-diff --patch --ignore-cr-at-eol --unified={unified} {opt}"; } public Models.DiffResult Result() diff --git a/src/Commands/Fetch.cs b/src/Commands/Fetch.cs index 08d2d1c6..1c3e78cb 100644 --- a/src/Commands/Fetch.cs +++ b/src/Commands/Fetch.cs @@ -4,7 +4,7 @@ namespace SourceGit.Commands { public class Fetch : Command { - public Fetch(string repo, string remote, bool noTags, bool prune, Action outputHandler) + public Fetch(string repo, string remote, bool noTags, bool prune, bool force, Action outputHandler) { _outputHandler = outputHandler; WorkingDirectory = repo; @@ -16,6 +16,9 @@ namespace SourceGit.Commands if (noTags) Args += "--no-tags "; else + Args += "--tags "; + + if (force) Args += "--force "; if (prune) diff --git a/src/Commands/FormatPatch.cs b/src/Commands/FormatPatch.cs index 2c7359c0..b3ec2e4a 100644 --- a/src/Commands/FormatPatch.cs +++ b/src/Commands/FormatPatch.cs @@ -6,7 +6,7 @@ { WorkingDirectory = repo; Context = repo; - Args = $"format-patch {commit} -1 -o \"{saveTo}\""; + Args = $"format-patch {commit} -1 --output=\"{saveTo}\""; } } } diff --git a/src/Commands/Merge.cs b/src/Commands/Merge.cs index cf2e285f..bd1f3653 100644 --- a/src/Commands/Merge.cs +++ b/src/Commands/Merge.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Text; namespace SourceGit.Commands { @@ -13,6 +15,29 @@ namespace SourceGit.Commands Args = $"merge --progress {source} {mode}"; } + public Merge(string repo, List targets, bool autoCommit, string strategy, Action outputHandler) + { + _outputHandler = outputHandler; + WorkingDirectory = repo; + Context = repo; + TraitErrorAsOutput = true; + + var builder = new StringBuilder(); + builder.Append("merge --progress "); + if (!string.IsNullOrEmpty(strategy)) + builder.Append($"--strategy={strategy} "); + if (!autoCommit) + builder.Append("--no-commit "); + + foreach (var t in targets) + { + builder.Append(t); + builder.Append(' '); + } + + Args = builder.ToString(); + } + protected override void OnReadline(string line) { _outputHandler?.Invoke(line); diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs new file mode 100644 index 00000000..bef09abb --- /dev/null +++ b/src/Commands/QueryCommitChildren.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; + +namespace SourceGit.Commands +{ + public class QueryCommitChildren : Command + { + public QueryCommitChildren(string repo, string commit, int max) + { + WorkingDirectory = repo; + Context = repo; + _commit = commit; + Args = $"rev-list -{max} --parents --branches --remotes ^{commit}"; + } + + public IEnumerable Result() + { + Exec(); + return _lines; + } + + protected override void OnReadline(string line) + { + if (line.Contains(_commit)) + _lines.Add(line.Substring(0, 40)); + } + + private string _commit; + private List _lines = new List(); + } +} diff --git a/src/Commands/QueryCommits.cs b/src/Commands/QueryCommits.cs index 5875301e..80497a90 100644 --- a/src/Commands/QueryCommits.cs +++ b/src/Commands/QueryCommits.cs @@ -6,11 +6,13 @@ namespace SourceGit.Commands { public class QueryCommits : Command { - public QueryCommits(string repo, string limits, bool needFindHead = true) + public QueryCommits(string repo, bool useTopoOrder, string limits, bool needFindHead = true) { + var order = useTopoOrder ? "--topo-order" : "--date-order"; + WorkingDirectory = repo; Context = repo; - Args = "log --date-order --no-show-signature --decorate=full --pretty=format:%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%s " + limits; + Args = $"log {order} --no-show-signature --decorate=full --pretty=format:%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%s {limits}"; _findFirstMerged = needFindHead; } diff --git a/src/Commands/QueryCommitsWithFullMessage.cs b/src/Commands/QueryCommitsWithFullMessage.cs index 116cb3cd..c15cdbe1 100644 --- a/src/Commands/QueryCommitsWithFullMessage.cs +++ b/src/Commands/QueryCommitsWithFullMessage.cs @@ -52,16 +52,28 @@ namespace SourceGit.Commands _current.Commit.CommitterTime = ulong.Parse(line); break; default: - if (line.Equals(_boundary, StringComparison.Ordinal)) - nextPartIdx = -1; + var boundary = rs.StdOut.IndexOf(_boundary, end + 1); + if (boundary > end) + { + _current.Message = rs.StdOut.Substring(start, boundary - start - 1); + end = boundary + _boundary.Length; + } else - _current.Message += line; + { + _current.Message = rs.StdOut.Substring(start); + end = rs.StdOut.Length - 2; + } + + nextPartIdx = -1; break; } nextPartIdx++; start = end + 1; + if (start >= rs.StdOut.Length - 1) + break; + end = rs.StdOut.IndexOf('\n', start); } diff --git a/src/Commands/QueryLocalChanges.cs b/src/Commands/QueryLocalChanges.cs index bdef9bf8..ea422215 100644 --- a/src/Commands/QueryLocalChanges.cs +++ b/src/Commands/QueryLocalChanges.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Text.RegularExpressions; namespace SourceGit.Commands diff --git a/src/Commands/QueryCurrentRevisionFiles.cs b/src/Commands/QueryRevisionFileNames.cs similarity index 55% rename from src/Commands/QueryCurrentRevisionFiles.cs rename to src/Commands/QueryRevisionFileNames.cs index 217ea20e..d2d69614 100644 --- a/src/Commands/QueryCurrentRevisionFiles.cs +++ b/src/Commands/QueryRevisionFileNames.cs @@ -1,19 +1,19 @@ namespace SourceGit.Commands { - public class QueryCurrentRevisionFiles : Command + public class QueryRevisionFileNames : Command { - public QueryCurrentRevisionFiles(string repo) + public QueryRevisionFileNames(string repo, string revision) { WorkingDirectory = repo; Context = repo; - Args = "ls-tree -r --name-only HEAD"; + Args = $"ls-tree -r -z --name-only {revision}"; } public string[] Result() { var rs = ReadToEnd(); if (rs.IsSuccess) - return rs.StdOut.Split('\n', System.StringSplitOptions.RemoveEmptyEntries); + return rs.StdOut.Split('\0', System.StringSplitOptions.RemoveEmptyEntries); return []; } diff --git a/src/Commands/QueryRevisionObjects.cs b/src/Commands/QueryRevisionObjects.cs index bcad9129..de3406e8 100644 --- a/src/Commands/QueryRevisionObjects.cs +++ b/src/Commands/QueryRevisionObjects.cs @@ -12,7 +12,7 @@ namespace SourceGit.Commands { WorkingDirectory = repo; Context = repo; - Args = $"ls-tree {sha}"; + Args = $"ls-tree -z {sha}"; if (!string.IsNullOrEmpty(parentFolder)) Args += $" -- \"{parentFolder}\""; @@ -20,11 +20,27 @@ namespace SourceGit.Commands public List Result() { - Exec(); + var rs = ReadToEnd(); + if (rs.IsSuccess) + { + var start = 0; + var end = rs.StdOut.IndexOf('\0', start); + while (end > 0) + { + var line = rs.StdOut.Substring(start, end - start); + Parse(line); + start = end + 1; + end = rs.StdOut.IndexOf('\0', start); + } + + if (start < rs.StdOut.Length) + Parse(rs.StdOut.Substring(start)); + } + return _objects; } - protected override void OnReadline(string line) + private void Parse(string line) { var match = REG_FORMAT().Match(line); if (!match.Success) diff --git a/src/Commands/Remote.cs b/src/Commands/Remote.cs index f2e8d09e..beaf412b 100644 --- a/src/Commands/Remote.cs +++ b/src/Commands/Remote.cs @@ -45,5 +45,14 @@ Args = "remote set-url" + (isPush ? " --push " : " ") + $"{name} {url}"; return Exec(); } + + public bool HasBranch(string remote, string branch) + { + SSHKey = new Config(WorkingDirectory).Get($"remote.{remote}.sshkey"); + Args = $"ls-remote {remote} {branch}"; + + var rs = ReadToEnd(); + return rs.IsSuccess && rs.StdOut.Trim().Length > 0; + } } } diff --git a/src/Commands/Statistics.cs b/src/Commands/Statistics.cs index adfcc574..511c43e8 100644 --- a/src/Commands/Statistics.cs +++ b/src/Commands/Statistics.cs @@ -4,11 +4,11 @@ namespace SourceGit.Commands { public class Statistics : Command { - public Statistics(string repo) + public Statistics(string repo, int max) { WorkingDirectory = repo; Context = repo; - Args = $"log --date-order --branches --remotes -40000 --pretty=format:\"%ct$%aN\""; + Args = $"log --date-order --branches --remotes -{max} --pretty=format:\"%ct$%aN\""; } public Models.Statistics Result() diff --git a/src/Converters/FilterModeConverters.cs b/src/Converters/FilterModeConverters.cs new file mode 100644 index 00000000..c486af5e --- /dev/null +++ b/src/Converters/FilterModeConverters.cs @@ -0,0 +1,22 @@ +using Avalonia.Data.Converters; +using Avalonia.Media; + +namespace SourceGit.Converters +{ + public static class FilterModeConverters + { + public static readonly FuncValueConverter ToBorderBrush = + new FuncValueConverter(v => + { + switch (v) + { + case Models.FilterMode.Included: + return Brushes.Green; + case Models.FilterMode.Excluded: + return Brushes.Red; + default: + return Brushes.Transparent; + } + }); + } +} diff --git a/src/Models/Branch.cs b/src/Models/Branch.cs index ac6b8c67..0ba320c1 100644 --- a/src/Models/Branch.cs +++ b/src/Models/Branch.cs @@ -7,6 +7,8 @@ namespace SourceGit.Models public List Ahead { get; set; } = new List(); public List Behind { get; set; } = new List(); + public bool IsVisible => Ahead.Count > 0 || Behind.Count > 0; + public override string ToString() { if (Ahead.Count == 0 && Behind.Count == 0) diff --git a/src/Models/CommitTemplate.cs b/src/Models/CommitTemplate.cs index b34fa5a5..56e1992c 100644 --- a/src/Models/CommitTemplate.cs +++ b/src/Models/CommitTemplate.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.RegularExpressions; +using System.Collections.Generic; using CommunityToolkit.Mvvm.ComponentModel; @@ -9,9 +6,6 @@ namespace SourceGit.Models { public partial class CommitTemplate : ObservableObject { - [GeneratedRegex(@"\$\{files(\:\d+)?\}")] - private static partial Regex REG_COMMIT_TEMPLATE_FILES(); - public string Name { get => _name; @@ -26,55 +20,8 @@ namespace SourceGit.Models public string Apply(Branch branch, List changes) { - var content = _content - .Replace("${files_num}", $"{changes.Count}") - .Replace("${branch_name}", branch.Name); - - var matches = REG_COMMIT_TEMPLATE_FILES().Matches(content); - if (matches.Count == 0) - return content; - - var builder = new StringBuilder(); - var last = 0; - for (int i = 0; i < matches.Count; i++) - { - var match = matches[i]; - if (!match.Success) - continue; - - var start = match.Index; - if (start != last) - builder.Append(content.Substring(last, start - last)); - - var countStr = match.Groups[1].Value; - var paths = new List(); - var more = string.Empty; - if (countStr is { Length: <= 1 }) - { - foreach (var c in changes) - paths.Add(c.Path); - } - else - { - var count = Math.Min(int.Parse(countStr.Substring(1)), changes.Count); - for (int j = 0; j < count; j++) - paths.Add(changes[j].Path); - - if (count < changes.Count) - more = $" and {changes.Count - count} other files"; - } - - builder.Append(string.Join(", ", paths)); - if (!string.IsNullOrEmpty(more)) - builder.Append(more); - - last = start + match.Length; - } - - if (last != content.Length - 1) - builder.Append(content.Substring(last)); - - return builder.ToString(); + var te = new TemplateEngine(); + return te.Eval(_content, branch, changes); } private string _name = string.Empty; diff --git a/src/Models/ExternalMerger.cs b/src/Models/ExternalMerger.cs index b5398835..a09f808c 100644 --- a/src/Models/ExternalMerger.cs +++ b/src/Models/ExternalMerger.cs @@ -39,7 +39,7 @@ namespace SourceGit.Models new ExternalMerger(4, "tortoise_merge", "Tortoise Merge", "TortoiseMerge.exe;TortoiseGitMerge.exe", "-base:\"$BASE\" -theirs:\"$REMOTE\" -mine:\"$LOCAL\" -merged:\"$MERGED\"", "-base:\"$LOCAL\" -theirs:\"$REMOTE\""), new ExternalMerger(5, "kdiff3", "KDiff3", "kdiff3.exe", "\"$REMOTE\" -b \"$BASE\" \"$LOCAL\" -o \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""), new ExternalMerger(6, "beyond_compare", "Beyond Compare", "BComp.exe", "\"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"", "\"$LOCAL\" \"$REMOTE\""), - new ExternalMerger(7, "win_merge", "WinMerge", "WinMergeU.exe", "-u -e \"$REMOTE\" \"$LOCAL\" \"$MERGED\"", "-u -e \"$LOCAL\" \"$REMOTE\""), + new ExternalMerger(7, "win_merge", "WinMerge", "WinMergeU.exe", "\"$MERGED\"", "-u -e \"$LOCAL\" \"$REMOTE\""), new ExternalMerger(8, "codium", "VSCodium", "VSCodium.exe", "-n --wait \"$MERGED\"", "-n --wait --diff \"$LOCAL\" \"$REMOTE\""), new ExternalMerger(9, "p4merge", "P4Merge", "p4merge.exe", "-tw 4 \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"", "-tw 4 \"$LOCAL\" \"$REMOTE\""), }; diff --git a/src/Models/Filter.cs b/src/Models/Filter.cs new file mode 100644 index 00000000..af4569fa --- /dev/null +++ b/src/Models/Filter.cs @@ -0,0 +1,60 @@ +using CommunityToolkit.Mvvm.ComponentModel; + +namespace SourceGit.Models +{ + public enum FilterType + { + LocalBranch = 0, + LocalBranchFolder, + RemoteBranch, + RemoteBranchFolder, + Tag, + } + + public enum FilterMode + { + None = 0, + Included, + Excluded, + } + + public class Filter : ObservableObject + { + public string Pattern + { + get => _pattern; + set => SetProperty(ref _pattern, value); + } + + public FilterType Type + { + get; + set; + } = FilterType.LocalBranch; + + public FilterMode Mode + { + get => _mode; + set => SetProperty(ref _mode, value); + } + + public bool IsBranch + { + get => Type != FilterType.Tag; + } + + public Filter() + { + } + + public Filter(string pattern, FilterType type, FilterMode mode) + { + _pattern = pattern; + _mode = mode; + Type = type; + } + + private string _pattern = string.Empty; + private FilterMode _mode = FilterMode.None; + } +} diff --git a/src/Models/Locales.cs b/src/Models/Locales.cs index f68bfd7e..802e88ef 100644 --- a/src/Models/Locales.cs +++ b/src/Models/Locales.cs @@ -12,6 +12,7 @@ namespace SourceGit.Models new Locale("English", "en_US"), new Locale("Español", "es_ES"), new Locale("Français", "fr_FR"), + new Locale("Italiano", "it_IT"), new Locale("Português (Brasil)", "pt_BR"), new Locale("Русский", "ru_RU"), new Locale("简体中文", "zh_CN"), diff --git a/src/Models/MergeStrategy.cs b/src/Models/MergeStrategy.cs new file mode 100644 index 00000000..ab1d446b --- /dev/null +++ b/src/Models/MergeStrategy.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; + +namespace SourceGit.Models +{ + public class MergeStrategy + { + public string Name { get; internal set; } + public string Desc { get; internal set; } + public string Arg { get; internal set; } + + public static List ForMultiple { get; private set; } = [ + new MergeStrategy("Default", "Let Git automatically select a strategy", string.Empty), + new MergeStrategy("Octopus", "Attempt merging multiple heads", "octopus"), + new MergeStrategy("Ours", "Record the merge without modifying the tree", "ours"), + ]; + + public MergeStrategy(string n, string d, string a) + { + Name = n; + Desc = d; + Arg = a; + } + } +} diff --git a/src/Models/OpenAI.cs b/src/Models/OpenAI.cs index e9c7b5ed..df67ff66 100644 --- a/src/Models/OpenAI.cs +++ b/src/Models/OpenAI.cs @@ -150,12 +150,17 @@ namespace SourceGit.Models public OpenAIChatResponse Chat(string prompt, string question, CancellationToken cancellation) { var chat = new OpenAIChatRequest() { Model = Model }; - chat.AddMessage("system", prompt); + chat.AddMessage("user", prompt); chat.AddMessage("user", question); var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(60) }; if (!string.IsNullOrEmpty(ApiKey)) - client.DefaultRequestHeaders.Add("Authorization", $"Bearer {ApiKey}"); + { + if (Server.Contains("openai.azure.com/", StringComparison.Ordinal)) + client.DefaultRequestHeaders.Add("api-key", ApiKey); + else + client.DefaultRequestHeaders.Add("Authorization", $"Bearer {ApiKey}"); + } var req = new StringContent(JsonSerializer.Serialize(chat, JsonCodeGen.Default.OpenAIChatRequest), Encoding.UTF8, "application/json"); try @@ -164,12 +169,15 @@ namespace SourceGit.Models task.Wait(cancellation); var rsp = task.Result; - if (!rsp.IsSuccessStatusCode) - throw new Exception($"AI service returns error code {rsp.StatusCode}"); - var reader = rsp.Content.ReadAsStringAsync(cancellation); reader.Wait(cancellation); + var body = reader.Result; + if (!rsp.IsSuccessStatusCode) + { + throw new Exception($"AI service returns error code {rsp.StatusCode}. Body: {body ?? string.Empty}"); + } + return JsonSerializer.Deserialize(reader.Result, JsonCodeGen.Default.OpenAIChatResponse); } catch diff --git a/src/Models/Remote.cs b/src/Models/Remote.cs index dcf30ddc..3c452460 100644 --- a/src/Models/Remote.cs +++ b/src/Models/Remote.cs @@ -1,11 +1,12 @@ using System; +using System.IO; using System.Text.RegularExpressions; namespace SourceGit.Models { public partial class Remote { - [GeneratedRegex(@"^http[s]?://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/~%]+/[\w\-\.%]+(\.git)?$")] + [GeneratedRegex(@"^https?://([-a-zA-Z0-9:%._\+~#=]+@)?[-a-zA-Z0-9:%._\+~#=]{1,256}(\.[a-zA-Z0-9()]{1,6})?(:[0-9]{1,5})?\b(/[-a-zA-Z0-9()@:%_\+.~#?&=]+)+(\.git)?$")] private static partial Regex REG_HTTPS(); [GeneratedRegex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-/~%]+/[\w\-\.%]+(\.git)?$")] private static partial Regex REG_SSH1(); @@ -49,7 +50,7 @@ namespace SourceGit.Models return true; } - return false; + return url.EndsWith(".git", StringComparison.Ordinal) && Directory.Exists(url); } public bool TryGetVisitURL(out string url) diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs index 77c58ee7..5b3aa331 100644 --- a/src/Models/RepositorySettings.cs +++ b/src/Models/RepositorySettings.cs @@ -1,4 +1,8 @@ -using Avalonia.Collections; +using System; +using System.Collections.Generic; +using System.Text; + +using Avalonia.Collections; namespace SourceGit.Models { @@ -76,11 +80,11 @@ namespace SourceGit.Models set; } = true; - public AvaloniaList Filters + public AvaloniaList HistoriesFilters { get; set; - } = new AvaloniaList(); + } = new AvaloniaList(); public AvaloniaList CommitTemplates { @@ -148,6 +152,214 @@ namespace SourceGit.Models set; } = "---"; + public Dictionary CollectHistoriesFilters() + { + var map = new Dictionary(); + foreach (var filter in HistoriesFilters) + map.Add(filter.Pattern, filter.Mode); + return map; + } + + public bool UpdateHistoriesFilter(string pattern, FilterType type, FilterMode mode) + { + // Clear all filters when there's a filter that has different mode. + if (mode != FilterMode.None) + { + var clear = false; + foreach (var filter in HistoriesFilters) + { + if (filter.Mode != mode) + { + clear = true; + break; + } + } + + if (clear) + { + HistoriesFilters.Clear(); + HistoriesFilters.Add(new Filter(pattern, type, mode)); + return true; + } + } + else + { + for (int i = 0; i < HistoriesFilters.Count; i++) + { + var filter = HistoriesFilters[i]; + if (filter.Type == type && filter.Pattern.Equals(pattern, StringComparison.Ordinal)) + { + HistoriesFilters.RemoveAt(i); + return true; + } + } + + return false; + } + + for (int i = 0; i < HistoriesFilters.Count; i++) + { + var filter = HistoriesFilters[i]; + if (filter.Type != type) + continue; + + if (filter.Pattern.Equals(pattern, StringComparison.Ordinal)) + return false; + } + + HistoriesFilters.Add(new Filter(pattern, type, mode)); + return true; + } + + public void RemoveChildrenBranchFilters(string pattern) + { + var dirty = new List(); + var prefix = $"{pattern}/"; + + foreach (var filter in HistoriesFilters) + { + if (filter.Type == FilterType.Tag) + continue; + + if (filter.Pattern.StartsWith(prefix, StringComparison.Ordinal)) + dirty.Add(filter); + } + + foreach (var filter in dirty) + HistoriesFilters.Remove(filter); + } + + public string BuildHistoriesFilter() + { + var excludedBranches = new List(); + var excludedRemotes = new List(); + var excludedTags = new List(); + var includedBranches = new List(); + var includedRemotes = new List(); + var includedTags = new List(); + foreach (var filter in HistoriesFilters) + { + if (filter.Type == FilterType.LocalBranch) + { + var name = filter.Pattern.Substring(11); + var b = $"{name.Substring(0, name.Length - 1)}[{name[^1]}]"; + + if (filter.Mode == FilterMode.Included) + includedBranches.Add(b); + else if (filter.Mode == FilterMode.Excluded) + excludedBranches.Add(b); + } + else if (filter.Type == FilterType.LocalBranchFolder) + { + if (filter.Mode == FilterMode.Included) + includedBranches.Add($"{filter.Pattern.Substring(11)}/*"); + else if (filter.Mode == FilterMode.Excluded) + excludedBranches.Add($"{filter.Pattern.Substring(11)}/*"); + } + else if (filter.Type == FilterType.RemoteBranch) + { + var name = filter.Pattern.Substring(13); + var r = $"{name.Substring(0, name.Length - 1)}[{name[^1]}]"; + + if (filter.Mode == FilterMode.Included) + includedRemotes.Add(r); + else if (filter.Mode == FilterMode.Excluded) + excludedRemotes.Add(r); + } + else if (filter.Type == FilterType.RemoteBranchFolder) + { + if (filter.Mode == FilterMode.Included) + includedRemotes.Add($"{filter.Pattern.Substring(13)}/*"); + else if (filter.Mode == FilterMode.Excluded) + excludedRemotes.Add($"{filter.Pattern.Substring(13)}/*"); + } + else if (filter.Type == FilterType.Tag) + { + var name = filter.Pattern; + var t = $"{name.Substring(0, name.Length - 1)}[{name[^1]}]"; + + if (filter.Mode == FilterMode.Included) + includedTags.Add(t); + else if (filter.Mode == FilterMode.Excluded) + excludedTags.Add(t); + } + } + + bool hasIncluded = includedBranches.Count > 0 || includedRemotes.Count > 0 || includedTags.Count > 0; + bool hasExcluded = excludedBranches.Count > 0 || excludedRemotes.Count > 0 || excludedTags.Count > 0; + + var builder = new StringBuilder(); + if (hasIncluded) + { + foreach (var b in includedBranches) + { + builder.Append("--branches="); + builder.Append(b); + builder.Append(' '); + } + + foreach (var r in includedRemotes) + { + builder.Append("--remotes="); + builder.Append(r); + builder.Append(' '); + } + + foreach (var t in includedTags) + { + builder.Append("--tags="); + builder.Append(t); + builder.Append(' '); + } + } + else if (hasExcluded) + { + if (excludedBranches.Count > 0) + { + foreach (var b in excludedBranches) + { + builder.Append("--exclude="); + builder.Append(b); + builder.Append(" --decorate-refs-exclude=refs/heads/"); + builder.Append(b); + builder.Append(' '); + } + } + + builder.Append("--exclude=HEA[D] --branches "); + + if (excludedRemotes.Count > 0) + { + foreach (var r in excludedRemotes) + { + builder.Append("--exclude="); + builder.Append(r); + builder.Append(" --decorate-refs-exclude=refs/remotes/"); + builder.Append(r); + builder.Append(' '); + } + } + + builder.Append("--exclude=origin/HEA[D] --remotes "); + + if (excludedTags.Count > 0) + { + foreach (var t in excludedTags) + { + builder.Append("--exclude="); + builder.Append(t); + builder.Append(" --decorate-refs-exclude=refs/tags/"); + builder.Append(t); + builder.Append(' '); + } + } + + builder.Append("--tags "); + } + + return builder.ToString(); + } + public void PushCommitMessage(string message) { var existIdx = CommitMessages.IndexOf(message); diff --git a/src/Models/ResetMode.cs b/src/Models/ResetMode.cs index 735533c2..827ccaa9 100644 --- a/src/Models/ResetMode.cs +++ b/src/Models/ResetMode.cs @@ -6,23 +6,25 @@ namespace SourceGit.Models { public static readonly ResetMode[] Supported = [ - new ResetMode("Soft", "Keep all changes. Stage differences", "--soft", Brushes.Green), - new ResetMode("Mixed", "Keep all changes. Unstage differences", "--mixed", Brushes.Orange), - new ResetMode("Merge", "Reset while keeping unmerged changes", "--merge", Brushes.Purple), - new ResetMode("Keep", "Reset while keeping local modifications", "--keep", Brushes.Purple), - new ResetMode("Hard", "Discard all changes", "--hard", Brushes.Red), + new ResetMode("Soft", "Keep all changes. Stage differences", "--soft", "S", Brushes.Green), + new ResetMode("Mixed", "Keep all changes. Unstage differences", "--mixed", "M", Brushes.Orange), + new ResetMode("Merge", "Reset while keeping unmerged changes", "--merge", "G", Brushes.Purple), + new ResetMode("Keep", "Reset while keeping local modifications", "--keep", "K", Brushes.Purple), + new ResetMode("Hard", "Discard all changes", "--hard", "H", Brushes.Red), ]; public string Name { get; set; } public string Desc { get; set; } public string Arg { get; set; } + public string Key { get; set; } public IBrush Color { get; set; } - public ResetMode(string n, string d, string a, IBrush b) + public ResetMode(string n, string d, string a, string k, IBrush b) { Name = n; Desc = d; Arg = a; + Key = k; Color = b; } } diff --git a/src/Models/Statistics.cs b/src/Models/Statistics.cs index b669eb55..969d3945 100644 --- a/src/Models/Statistics.cs +++ b/src/Models/Statistics.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using LiveChartsCore; using LiveChartsCore.Defaults; @@ -138,7 +139,8 @@ namespace SourceGit.Models public Statistics() { _today = DateTime.Now.ToLocalTime().Date; - _thisWeekStart = _today.AddSeconds(-(int)_today.DayOfWeek * 3600 * 24); + var weekOffset = (7 + (int)_today.DayOfWeek - (int)CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek) % 7; + _thisWeekStart = _today.AddDays(-weekOffset); _thisMonthStart = _today.AddDays(1 - _today.Day); All = new StatisticsReport(StaticsticsMode.All, DateTime.MinValue); diff --git a/src/Models/Tag.cs b/src/Models/Tag.cs index 2ec9e093..2e8f2c8e 100644 --- a/src/Models/Tag.cs +++ b/src/Models/Tag.cs @@ -1,10 +1,19 @@ -namespace SourceGit.Models +using CommunityToolkit.Mvvm.ComponentModel; + +namespace SourceGit.Models { - public class Tag + public class Tag : ObservableObject { - public string Name { get; set; } - public string SHA { get; set; } - public string Message { get; set; } - public bool IsFiltered { get; set; } + public string Name { get; set; } = string.Empty; + public string SHA { get; set; } = string.Empty; + public string Message { get; set; } = string.Empty; + + public FilterMode FilterMode + { + get => _filterMode; + set => SetProperty(ref _filterMode, value); + } + + private FilterMode _filterMode = FilterMode.None; } } diff --git a/src/Models/TemplateEngine.cs b/src/Models/TemplateEngine.cs new file mode 100644 index 00000000..6b5f525d --- /dev/null +++ b/src/Models/TemplateEngine.cs @@ -0,0 +1,410 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; + +namespace SourceGit.Models +{ + public class TemplateEngine + { + private class Context(Branch branch, IReadOnlyList changes) + { + public Branch branch = branch; + public IReadOnlyList changes = changes; + } + + private class Text(string text) + { + public string text = text; + } + + private class Variable(string name) + { + public string name = name; + } + + private class SlicedVariable(string name, int count) + { + public string name = name; + public int count = count; + } + + private class RegexVariable(string name, Regex regex, string replacement) + { + public string name = name; + public Regex regex = regex; + public string replacement = replacement; + } + + private const char ESCAPE = '\\'; + private const char VARIABLE_ANCHOR = '$'; + private const char VARIABLE_START = '{'; + private const char VARIABLE_END = '}'; + private const char VARIABLE_SLICE = ':'; + private const char VARIABLE_REGEX = '/'; + private const char NEWLINE = '\n'; + private const RegexOptions REGEX_OPTIONS = RegexOptions.Singleline | RegexOptions.IgnoreCase; + + public string Eval(string text, Branch branch, IReadOnlyList changes) + { + Reset(); + + _chars = text.ToCharArray(); + Parse(); + + var context = new Context(branch, changes); + var sb = new StringBuilder(); + sb.EnsureCapacity(text.Length); + foreach (var token in _tokens) + { + switch (token) + { + case Text text_token: + sb.Append(text_token.text); + break; + case Variable var_token: + sb.Append(EvalVariable(context, var_token)); + break; + case SlicedVariable sliced_var: + sb.Append(EvalVariable(context, sliced_var)); + break; + case RegexVariable regex_var: + sb.Append(EvalVariable(context, regex_var)); + break; + } + } + + return sb.ToString(); + } + + private void Reset() + { + _pos = 0; + _chars = []; + _tokens.Clear(); + } + + private char? Next() + { + var c = Peek(); + if (c is not null) + { + _pos++; + } + return c; + } + + private char? Peek() + { + return (_pos >= _chars.Length) ? null : _chars[_pos]; + } + + private int? Integer() + { + var start = _pos; + while (Peek() is char c && c >= '0' && c <= '9') + { + _pos++; + } + if (start >= _pos) + return null; + + var chars = new ReadOnlySpan(_chars, start, _pos - start); + return int.Parse(chars); + } + + private void Parse() + { + // text token start + var tok = _pos; + bool esc = false; + while (Next() is char c) + { + if (esc) + { + esc = false; + continue; + } + switch (c) + { + case ESCAPE: + // allow to escape only \ and $ + if (Peek() is char nc && (nc == ESCAPE || nc == VARIABLE_ANCHOR)) + { + esc = true; + FlushText(tok, _pos - 1); + tok = _pos; + } + break; + case VARIABLE_ANCHOR: + // backup the position + var bak = _pos; + var variable = TryParseVariable(); + if (variable is null) + { + // no variable found, rollback + _pos = bak; + } + else + { + // variable found, flush a text token + FlushText(tok, bak - 1); + _tokens.Add(variable); + tok = _pos; + } + break; + } + } + // flush text token + FlushText(tok, _pos); + } + + private void FlushText(int start, int end) + { + int len = end - start; + if (len <= 0) + return; + var text = new string(_chars, start, len); + _tokens.Add(new Text(text)); + } + + private object TryParseVariable() + { + if (Next() != VARIABLE_START) + return null; + int name_start = _pos; + while (Next() is char c) + { + // name character, continue advancing + if (IsNameChar(c)) + continue; + + var name_end = _pos - 1; + // not a name character but name is empty, cancel + if (name_start >= name_end) + return null; + var name = new string(_chars, name_start, name_end - name_start); + + return c switch + { + // variable + VARIABLE_END => new Variable(name), + // sliced variable + VARIABLE_SLICE => TryParseSlicedVariable(name), + // regex variable + VARIABLE_REGEX => TryParseRegexVariable(name), + _ => null, + }; + } + + return null; + } + + private object TryParseSlicedVariable(string name) + { + int? n = Integer(); + if (n is null) + return null; + if (Next() != VARIABLE_END) + return null; + + return new SlicedVariable(name, (int)n); + } + + private object TryParseRegexVariable(string name) + { + var regex = ParseRegex(); + if (regex == null) + return null; + var replacement = ParseReplacement(); + if (replacement == null) + return null; + + return new RegexVariable(name, regex, replacement); + } + + private Regex ParseRegex() + { + var sb = new StringBuilder(); + var tok = _pos; + var esc = false; + while (Next() is char c) + { + if (esc) + { + esc = false; + continue; + } + switch (c) + { + case ESCAPE: + // allow to escape only / as \ and { used frequently in regexes + if (Peek() == VARIABLE_REGEX) + { + esc = true; + sb.Append(_chars, tok, _pos - 1 - tok); + tok = _pos; + } + break; + case VARIABLE_REGEX: + // goto is fine + goto Loop_exit; + case NEWLINE: + // no newlines allowed + return null; + } + } + Loop_exit: + sb.Append(_chars, tok, _pos - 1 - tok); + + try + { + var pattern = sb.ToString(); + if (pattern.Length == 0) + return null; + var regex = new Regex(pattern, REGEX_OPTIONS); + + return regex; + } + catch (RegexParseException) + { + return null; + } + } + + private string ParseReplacement() + { + var sb = new StringBuilder(); + var tok = _pos; + var esc = false; + while (Next() is char c) + { + if (esc) + { + esc = false; + continue; + } + switch (c) + { + case ESCAPE: + // allow to escape only } + if (Peek() == VARIABLE_END) + { + esc = true; + sb.Append(_chars, tok, _pos - 1 - tok); + tok = _pos; + } + break; + case VARIABLE_END: + // goto is fine + goto Loop_exit; + case NEWLINE: + // no newlines allowed + return null; + } + } + Loop_exit: + sb.Append(_chars, tok, _pos - 1 - tok); + + var replacement = sb.ToString(); + + return replacement; + } + + private static bool IsNameChar(char c) + { + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9'); + } + + // (?) notice or log if variable is not found + private static string EvalVariable(Context context, string name) + { + if (!s_variables.TryGetValue(name, out var getter)) + { + return string.Empty; + } + return getter(context); + } + + private static string EvalVariable(Context context, Variable variable) + { + return EvalVariable(context, variable.name); + } + + private static string EvalVariable(Context context, SlicedVariable variable) + { + if (!s_slicedVariables.TryGetValue(variable.name, out var getter)) + { + return string.Empty; + } + return getter(context, variable.count); + } + + private static string EvalVariable(Context context, RegexVariable variable) + { + var str = EvalVariable(context, variable.name); + if (string.IsNullOrEmpty(str)) + return str; + return variable.regex.Replace(str, variable.replacement); + } + + private int _pos = 0; + private char[] _chars = []; + private readonly List _tokens = []; + + private delegate string VariableGetter(Context context); + + private static readonly IReadOnlyDictionary s_variables = new Dictionary() { + // legacy variables + {"branch_name", GetBranchName}, + {"files_num", GetFilesCount}, + {"files", GetFiles}, + // + {"BRANCH", GetBranchName}, + {"FILES_COUNT", GetFilesCount}, + {"FILES", GetFiles}, + }; + + private static string GetBranchName(Context context) + { + return context.branch.Name; + } + + private static string GetFilesCount(Context context) + { + return context.changes.Count.ToString(); + } + + private static string GetFiles(Context context) + { + var paths = new List(); + foreach (var c in context.changes) + paths.Add(c.Path); + return string.Join(", ", paths); + } + + private delegate string VariableSliceGetter(Context context, int count); + + private static readonly IReadOnlyDictionary s_slicedVariables = new Dictionary() { + // legacy variables + {"files", GetFilesSliced}, + // + {"FILES", GetFilesSliced}, + }; + + private static string GetFilesSliced(Context context, int count) + { + var sb = new StringBuilder(); + var paths = new List(); + var max = Math.Min(count, context.changes.Count); + for (int i = 0; i < max; i++) + paths.Add(context.changes[i].Path); + + sb.AppendJoin(", ", paths); + if (max < context.changes.Count) + sb.AppendFormat(" and {0} other files", context.changes.Count - max); + + return sb.ToString(); + } + } +} diff --git a/src/Models/Watcher.cs b/src/Models/Watcher.cs index 6665250c..710b307d 100644 --- a/src/Models/Watcher.cs +++ b/src/Models/Watcher.cs @@ -113,22 +113,11 @@ namespace SourceGit.Models if (_updateTags > 0) { _updateTags = 0; - Task.Run(() => - { - _repo.RefreshTags(); - _repo.RefreshBranches(); - _repo.RefreshCommits(); - }); - } - else - { - Task.Run(() => - { - _repo.RefreshBranches(); - _repo.RefreshCommits(); - }); + Task.Run(_repo.RefreshTags); } + Task.Run(_repo.RefreshBranches); + Task.Run(_repo.RefreshCommits); Task.Run(_repo.RefreshWorkingCopyChanges); Task.Run(_repo.RefreshWorktrees); } diff --git a/src/Native/Linux.cs b/src/Native/Linux.cs index 55b7b43b..a24f1b65 100644 --- a/src/Native/Linux.cs +++ b/src/Native/Linux.cs @@ -13,10 +13,7 @@ namespace SourceGit.Native { public void SetupApp(AppBuilder builder) { - builder.With(new X11PlatformOptions() - { - EnableIme = true, - }); + builder.With(new X11PlatformOptions() { EnableIme = true }); } public string FindGitExecutable() diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml index 53b2b3d3..3eeb4b41 100644 --- a/src/Resources/Icons.axaml +++ b/src/Resources/Icons.axaml @@ -15,8 +15,9 @@ M797 829a49 49 0 1049 49 49 49 0 00-49-49zm147-114A49 49 0 10992 764a49 49 0 00-49-49zM928 861a49 49 0 1049 49A49 49 0 00928 861zm-5-586L992 205 851 64l-71 71a67 67 0 00-94 0l235 235a67 67 0 000-94zm-853 128a32 32 0 00-32 50 1291 1291 0 0075 112L288 552c20 0 25 21 8 37l-93 86a1282 1282 0 00120 114l100-32c19-6 28 15 14 34l-40 55c26 19 53 36 82 53a89 89 0 00115-20 1391 1391 0 00256-485l-188-188s-306 224-595 198z M1280 704c0 141-115 256-256 256H288C129 960 0 831 0 672c0-126 80-232 192-272A327 327 0 01192 384c0-177 143-320 320-320 119 0 222 64 277 160C820 204 857 192 896 192c106 0 192 86 192 192 0 24-5 48-13 69C1192 477 1280 580 1280 704zm-493-128H656V352c0-18-14-32-32-32h-96c-18 0-32 14-32 32v224h-131c-29 0-43 34-23 55l211 211c12 12 33 12 45 0l211-211c20-20 6-55-23-55z M853 102H171C133 102 102 133 102 171v683C102 891 133 922 171 922h683C891 922 922 891 922 853V171C922 133 891 102 853 102zM390 600l-48 48L205 512l137-137 48 48L301 512l88 88zM465 819l-66-18L559 205l66 18L465 819zm218-171L634 600 723 512l-88-88 48-48L819 512 683 649z + M684 736 340 736l0-53 344 1-0 53zM552 565l-213-2 0-53 212 2-0 53zM684 392 340 392l0-53 344 1-0 53zM301 825c-45 0-78-9-100-27-22-18-33-43-33-75v-116c0-22-4-37-12-45-7-9-20-13-40-13v-61c19 0 32-4 40-12 8-9 12-24 12-46v-116c0-32 11-57 33-75 22-18 56-27 100-27h24v61h-24a35 35 0 00-27 12 41 41 0 00-11 29v116c0 35-10 60-31 75a66 66 0 01-31 14c11 2 22 6 31 14 20 17 31 42 31 75v116c0 12 4 22 11 29 7 8 16 12 27 12h24v61h-24zM701 764h24c10 0 19-4 27-12a41 41 0 0011-29v-116c0-33 10-58 31-75 9-7 19-12 31-14a66 66 0 01-31-14c-20-15-31-40-31-75v-116a41 41 0 00-11-29 35 35 0 00-27-12h-24v-61h24c45 0 78 9 100 27 22 18 33 43 33 75v116c0 22 4 37 11 46 8 8 21 12 40 12v61c-19 0-33 4-40 13-7 8-11 23-11 45v116c0 32-11 57-33 75-22 18-55 27-100 27h-24v-61z M128 854h768v86H128zM390 797c13 13 29 19 48 19s35-6 45-19l291-288c26-22 26-64 0-90L435 83l-61 61L426 192l-272 269c-22 22-22 64 0 90l237 246zm93-544 211 211-32 32H240l243-243zM707 694c0 48 38 86 86 86 48 0 86-38 86-86 0-22-10-45-26-61L794 576l-61 61c-13 13-26 35-26 58z - M796 471A292 292 0 00512 256a293 293 0 00-284 215H0v144h228A293 293 0 00512 832a291 291 0 00284-217H1024V471h-228M512 688A146 146 0 01366 544A145 145 0 01512 400c80 0 146 63 146 144A146 146 0 01512 688 + M0 512M1024 512M512 0M512 1024M796 471A292 292 0 00512 256a293 293 0 00-284 215H0v144h228A293 293 0 00512 832a291 291 0 00284-217H1024V471h-228M512 688A146 146 0 01366 544A145 145 0 01512 400c80 0 146 63 146 144A146 146 0 01512 688 M796 561a5 5 0 014 7l-39 90a5 5 0 004 7h100a5 5 0 014 8l-178 247a5 5 0 01-9-4l32-148a5 5 0 00-5-6h-89a5 5 0 01-4-7l86-191a5 5 0 014-3h88zM731 122a73 73 0 0173 73v318a54 54 0 00-8-1H731V195H244v634h408l-16 73H244a73 73 0 01-73-73V195a73 73 0 0173-73h488zm-219 366v73h-195v-73h195zm146-146v73H317v-73h341z M645 448l64 64 220-221L704 64l-64 64 115 115H128v90h628zM375 576l-64-64-220 224L314 960l64-64-116-115H896v-90H262z M608 0q48 0 88 23t63 63 23 87v70h55q35 0 67 14t57 38 38 57 14 67V831q0 34-14 66t-38 57-57 38-67 13H426q-34 0-66-13t-57-38-38-57-14-66v-70h-56q-34 0-66-14t-57-38-38-57-13-67V174q0-47 23-87T109 23 196 0h412m175 244H426q-46 0-86 22T278 328t-26 85v348H608q47 0 86-22t63-62 25-85l1-348m-269 318q18 0 31 13t13 31-13 31-31 13-31-13-13-31 13-31 31-13m0-212q13 0 22 9t11 22v125q0 14-9 23t-22 10-23-7-11-22l-1-126q0-13 10-23t23-10z @@ -32,7 +33,7 @@ M469 235V107h85v128h-85zm-162-94 85 85-60 60-85-85 60-60zm469 60-85 85-60-60 85-85 60 60zm-549 183A85 85 0 01302 341H722a85 85 0 0174 42l131 225A85 85 0 01939 652V832a85 85 0 01-85 85H171a85 85 0 01-85-85v-180a85 85 0 0112-43l131-225zM722 427H302l-100 171h255l10 29a59 59 0 002 5c2 4 5 9 9 14 8 9 18 17 34 17 16 0 26-7 34-17a72 72 0 0011-18l0-0 10-29h255l-100-171zM853 683H624a155 155 0 01-12 17C593 722 560 747 512 747c-48 0-81-25-99-47a155 155 0 01-12-17H171v149h683v-149z M576 832C576 867 547 896 512 896 477 896 448 867 448 832 448 797 477 768 512 768 547 768 576 797 576 832ZM512 256C477 256 448 285 448 320L448 640C448 675 477 704 512 704 547 704 576 675 576 640L576 320C576 285 547 256 512 256ZM1024 896C1024 967 967 1024 896 1024L128 1024C57 1024 0 967 0 896 0 875 5 855 14 837L14 837 398 69 398 69C420 28 462 0 512 0 562 0 604 28 626 69L1008 835C1018 853 1024 874 1024 896ZM960 896C960 885 957 875 952 865L952 864 951 863 569 98C557 77 536 64 512 64 488 64 466 77 455 99L452 105 92 825 93 825 71 867C66 876 64 886 64 896 64 931 93 960 128 960L896 960C931 960 960 931 960 896Z M928 128l-416 0-32-64-352 0-64 128 896 0zM904 704l75 0 45-448-1024 0 64 640 484 0c-105-38-180-138-180-256 0-150 122-272 272-272s272 122 272 272c0 22-3 43-8 64zM1003 914l-198-175c17-29 27-63 27-99 0-106-86-192-192-192s-192 86-192 192 86 192 192 192c36 0 70-10 99-27l175 198c23 27 62 28 87 3l6-6c25-25 23-64-3-87zM640 764c-68 0-124-56-124-124s56-124 124-124 124 56 124 124-56 124-124 124z - M520 168C291 168 95 311 16 512c79 201 275 344 504 344 229 0 425-143 504-344-79-201-275-344-504-344zm0 573c-126 0-229-103-229-229s103-229 229-229c126 0 229 103 229 229s-103 229-229 229zm0-367c-76 0-137 62-137 137s62 137 137 137S657 588 657 512s-62-137-137-137z + M0 512M1024 512M512 0M512 1024M520 168C291 168 95 311 16 512c79 201 275 344 504 344 229 0 425-143 504-344-79-201-275-344-504-344zm0 573c-126 0-229-103-229-229s103-229 229-229c126 0 229 103 229 229s-103 229-229 229zm0-367c-76 0-137 62-137 137s62 137 137 137S657 588 657 512s-62-137-137-137z M734 128c-33-19-74-8-93 25l-41 70c-28-6-58-9-90-9-294 0-445 298-445 298s82 149 231 236l-31 54c-19 33-8 74 25 93 33 19 74 8 93-25L759 222C778 189 767 147 734 128zM305 512c0-115 93-208 207-208 14 0 27 1 40 4l-37 64c-1 0-2 0-2 0-77 0-140 63-140 140 0 26 7 51 20 71l-37 64C324 611 305 564 305 512zM771 301 700 423c13 27 20 57 20 89 0 110-84 200-192 208l-51 89c12 1 24 2 36 2 292 0 446-298 446-298S895 388 771 301z M826 498 538 250c-11-9-26-1-26 14v496c0 15 16 23 26 14L826 526c8-7 8-21 0-28zm-320 0L218 250c-11-9-26-1-26 14v496c0 15 16 23 26 14L506 526c4-4 6-9 6-14 0-5-2-10-6-14z M1024 896v128H0V704h128v192h768V704h128v192zM576 555 811 320 896 405l-384 384-384-384L213 320 448 555V0h128v555z @@ -79,6 +80,7 @@ M299 811 299 725 384 725 384 811 299 811M469 811 469 725 555 725 555 811 469 811M640 811 640 725 725 725 725 811 640 811M299 640 299 555 384 555 384 640 299 640M469 640 469 555 555 555 555 640 469 640M640 640 640 555 725 555 725 640 640 640M299 469 299 384 384 384 384 469 299 469M469 469 469 384 555 384 555 469 469 469M640 469 640 384 725 384 725 469 640 469M299 299 299 213 384 213 384 299 299 299M469 299 469 213 555 213 555 299 469 299M640 299 640 213 725 213 725 299 640 299Z M64 363l0 204 265 0L329 460c0-11 6-18 14-20C349 437 355 437 362 441c93 60 226 149 226 149 33 22 34 60 0 82 0 0-133 89-226 149-14 9-32-3-32-18l-1-110L64 693l0 117c0 41 34 75 75 75l746 0c41 0 75-34 75-74L960 364c0-0 0-1 0-1L64 363zM64 214l0 75 650 0-33-80c-16-38-62-69-103-69l-440 0C97 139 64 173 64 214z M683 409v204L1024 308 683 0v191c-413 0-427 526-427 526c117-229 203-307 427-307zm85 492H102V327h153s38-63 114-122H51c-28 0-51 27-51 61v697c0 34 23 61 51 61h768c28 0 51-27 51-61V614l-102 100v187z + M841 627A43 43 0 00811 555h-299v85h196l-183 183A43 43 0 00555 896h299v-85h-196l183-183zM299 170H213v512H85l171 171 171-171H299zM725 128h-85c-18 0-34 11-40 28l-117 313h91L606 384h154l32 85h91l-117-313A43 43 0 00725 128zm-88 171 32-85h26l32 85h-90z M640 96c-158 0-288 130-288 288 0 17 3 31 5 46L105 681 96 691V928h224v-96h96v-96h96v-95c38 18 82 31 128 31 158 0 288-130 288-288s-130-288-288-288zm0 64c123 0 224 101 224 224s-101 224-224 224a235 235 0 01-109-28l-8-4H448v96h-96v96H256v96H160v-146l253-254 12-11-3-17C419 417 416 400 416 384c0-123 101-224 224-224zm64 96a64 64 0 100 128 64 64 0 100-128z M544 85c49 0 90 37 95 85h75a96 96 0 0196 89L811 267a32 32 0 01-28 32L779 299a32 32 0 01-32-28L747 267a32 32 0 00-28-32L715 235h-91a96 96 0 01-80 42H395c-33 0-62-17-80-42L224 235a32 32 0 00-32 28L192 267v576c0 16 12 30 28 32l4 0h128a32 32 0 0132 28l0 4a32 32 0 01-32 32h-128a96 96 0 01-96-89L128 843V267a96 96 0 0189-96L224 171h75a96 96 0 0195-85h150zm256 256a96 96 0 0196 89l0 7v405a96 96 0 01-89 96L800 939h-277a96 96 0 01-96-89L427 843v-405a96 96 0 0189-96L523 341h277zm-256-192H395a32 32 0 000 64h150a32 32 0 100-64z m186 532 287 0 0 287c0 11 9 20 20 20s20-9 20-20l0-287 287 0c11 0 20-9 20-20s-9-20-20-20l-287 0 0-287c0-11-9-20-20-20s-20 9-20 20l0 287-287 0c-11 0-20 9-20 20s9 20 20 20z diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index c7cd3200..2045a229 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -58,7 +58,7 @@ Lösche alle ausgewählten {0} Branches Alle Änderungen verwerfen Fast-Forward zu ${0}$ - Fetche ${0}$ nach ${1}$... + Fetche ${0}$ in ${1}$ hinein... Git Flow - Abschließen ${0}$ Merge ${0}$ in ${1}$ hinein... Pull ${0}$ @@ -128,6 +128,7 @@ INFORMATION AUTOR GEÄNDERT + NACHFOLGER COMMITTER Prüfe Refs, die diesen Commit enthalten COMMIT ENTHALTEN IN @@ -162,16 +163,16 @@ TICKETSYSTEM Beispiel für Github-Regel hinzufügen Beispiel für Jira-Regel hinzufügen - Beispiel für eine Gitlab Issue Regel einfügen - Beispiel für einen Gitlab Merge Request einfügen + Beispiel für Gitlab Issue Regel einfügen + Beispiel für Gitlab Merge Request einfügen Neue Regel Ticketnummer Regex-Ausdruck: Name: Ergebnis-URL: Verwende bitte $1, $2 um auf Regex-Gruppenwerte zuzugreifen. OPEN AI - Bevorzugter Service: - Wenn der 'Bevorzugte Service' aktiviert ist, wird SourceGit nur dieses Repository nutzen. Ansonsten wird, wenn mehrere Services verfügbar sind, eine Kontextmenü zur Auswahl angezeigt. + Bevorzugter Service: + Der ausgewählte 'Bevorzugte Service' wird nur in diesem Repository gesetzt und verwendet. Wenn keiner gesetzt ist und mehrere Servies verfügbar sind wird ein Kontextmenü zur Auswahl angezeigt. HTTP Proxy HTTP Proxy für dieses Repository Benutzername @@ -240,6 +241,7 @@ Nächste Änderung KEINE ÄNDERUNG ODER NUR ZEILEN-ENDE ÄNDERUNGEN Vorherige Änderung + Als Patch speichern Zeige versteckte Symbole Nebeneinander SUBMODUL @@ -248,6 +250,7 @@ Syntax Hervorhebung Zeilenumbruch Öffne in Merge Tool + Alle Zeilen anzeigen Weniger Zeilen anzeigen Mehr Zeilen anzeigen WÄHLE EINE DATEI AUS UM ÄNDERUNGEN ANZUZEIGEN @@ -263,11 +266,12 @@ Ziel: Ausgewählte Gruppe bearbeiten Ausgewähltes Repository bearbeiten - Führe benutzerte Aktion aus + Führe benutzerdefinierte Aktion aus Name der Aktion: Fast-Forward (ohne Auschecken) Fetch Alle Remotes fetchen + Aktiviere '--force' Option Ohne Tags fetchen Remote: Remote-Änderungen fetchen @@ -290,7 +294,6 @@ Datei Historie INHALT ÄNDERUNGEN - FILTER Git-Flow Development-Branch: Feature: @@ -364,8 +367,12 @@ Gestagte Änderungen committen Gestagte Änderungen committen und pushen Alle Änderungen stagen und committen + Neuen Branch basierend auf ausgewählten Commit erstellen Ausgewählte Änderungen verwerfen + Fetch, wird direkt ausgeführt Dashboard Modus (Standard) + Pull, wird direkt ausgeführt + Push, wird direkt ausgeführt Erzwinge Neuladen des Repositorys Ausgewählte Änderungen stagen/unstagen Commit-Suchmodus @@ -382,19 +389,20 @@ Verwerfen Initialisiere Repository Pfad: - Cherry-Pick wird durchgeführt. Drücke 'Abbrechen' um den originalen HEAD wiederherzustellen. - Merge request wird durchgeführt. Drücke 'Abbrechen' um den originalen HEAD wiederherzustellen. - Rebase wird durchgeführt. Drücke 'Abbrechen' um den originalen HEAD wiederherzustellen. - Revert wird durchgeführt. Drücke 'Abbrechen' um den originalen HEAD wiederherzustellen. + Cherry-Pick wird durchgeführt. + Merge request wird durchgeführt. + Rebase wird durchgeführt. + Revert wird durchgeführt. Interaktiver Rebase Ziel Branch: Auf: + In Browser öffnen + Link kopieren FEHLER INFO Branch mergen Ziel-Branch: Merge Option: - Quell-Branch: Bewege Repository Knoten Wähle Vorgänger-Knoten für: Name: @@ -429,6 +437,9 @@ Modell DARSTELLUNG Standardschriftart + Schriftgröße + Standard + Texteditor Monospace-Schriftart Verwende die Monospace-Schriftart nur im Texteditor Design @@ -444,6 +455,7 @@ Sprache Commit-Historie Zeige Autor Zeitpunkt anstatt Commit Zeitpunkt + Zeige Nachfolger in den Commit Details Längenvorgabe für Commit-Nachrichten GIT Aktiviere Auto-CRLF @@ -525,7 +537,7 @@ Änderungen automatisch von Remote fetchen... Aufräumen (GC & Prune) Führt `git gc` auf diesem Repository aus. - Alles löschen + Filter aufheben Repository Einstellungen WEITER Benutzerdefinierte Aktionen @@ -533,7 +545,13 @@ Aktiviere '--reflog' Option Öffne im Datei-Browser Suche Branches/Tags/Submodule - GEFILTERT: + Sichtbarkeit im Graphen + Aufheben + Im Graph ausblenden + Im Graph filtern + Sortierungsmodus wechseln + Commit Zeitpunkt (--date-order) + Topologie (--topo-order) LOKALE BRANCHES Zum HEAD wechseln Aktiviere '--first-parent' Option @@ -543,7 +561,6 @@ Aktualisiern REMOTES REMOTE HINZUFÜGEN - KONFLIKTE BEHEBEN Commit suchen Dateiname Commit-Nachricht @@ -585,6 +602,8 @@ Diese Version überspringen Software Update Es sind momentan kein Updates verfügbar. + SHA kopieren + Zum Commit wechseln Squash Commits In: SSH privater Schlüssel: @@ -592,7 +611,7 @@ START Stash Inklusive nicht-verfolgter Dateien - Behalte Dateien des Stages + Behalte gestagte Dateien Name: Optional. Name dieses Stashes Nur gestagte Änderungen diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 281f13a3..65b4dd96 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -58,6 +58,7 @@ Fetch ${0}$ into ${1}$... Git Flow - Finish ${0}$ Merge ${0}$ into ${1}$... + Merge selected {0} branches into current Pull ${0}$ Pull ${0}$ into ${1}$... Push ${0}$ @@ -101,7 +102,7 @@ Repository URL: CLOSE Editor - Cherry-Pick This Commit + Cherry-Pick Commit Cherry-Pick ... Checkout Commit Compare with HEAD @@ -109,22 +110,26 @@ Copy Info Copy SHA Custom Action - Interactive Rebase ${0}$ to Here - Rebase ${0}$ to Here + Interactively Rebase ${0}$ on Here + Merge to ${0}$ + Merge ... + Rebase ${0}$ on Here Reset ${0}$ to Here Revert Commit Reword Save as Patch... - Squash Into Parent - Squash Child Commits to Here + Squash into Parent + Squash Children into Here CHANGES Search Changes... FILES LFS File + Search Files... Submodule INFORMATION AUTHOR CHANGED + CHILDREN COMMITTER Check refs that contains this commit COMMIT IS CONTAINED BY @@ -167,8 +172,8 @@ Result URL: Please use $1, $2 to access regex groups values. AI - Prefered Service: - If the 'Prefered Service' is set, SourceGit will only use it in this repository. Otherwise, if there is more than one service available, a context menu to choose one of them will be shown. + Preferred Service: + If the 'Preferred Service' is set, SourceGit will only use it in this repository. Otherwise, if there is more than one service available, a context menu to choose one of them will be shown. HTTP Proxy HTTP proxy used by this repository User Name @@ -245,6 +250,7 @@ Swap Syntax Highlighting Line Word Wrap + Enable Block-Navigation Open in Merge Tool Show All Lines Decrease Number of Visible Lines @@ -267,6 +273,7 @@ Fast-Forward (without checkout) Fetch Fetch all remotes + Enable '--force' option Fetch without tags Remote: Fetch Remote Changes @@ -275,6 +282,7 @@ Discard {0} files... Discard Changes in Selected Line(s) Open External Merge Tool + Resolve Using ${0}$ Save as Patch... Stage Stage {0} files @@ -289,7 +297,6 @@ File History CONTENT CHANGE - FILTER Git-Flow Development Branch: Feature: @@ -340,7 +347,7 @@ Remote: Track files named '{0}' Track all *{0} files - Histories + HISTORY Switch Horizontal/Vertical Layout AUTHOR AUTHOR TIME @@ -354,6 +361,7 @@ Keyboard Shortcuts Reference GLOBAL Cancel current popup + Clone new repository Close current page Go to previous page Go to next page @@ -385,10 +393,14 @@ Discard Initialize Repository Path: - Cherry-Pick in progress. Press 'Abort' to restore original HEAD. - Merge request in progress. Press 'Abort' to restore original HEAD. - Rebase in progress. Press 'Abort' to restore original HEAD. - Revert in progress. Press 'Abort' to restore original HEAD. + Cherry-Pick in progress. + Processing commit + Merge request in progress. + Operating + Rebase in progress. + Stopped at + Revert in progress. + Reverting commit Interactive Rebase Target Branch: On: @@ -399,7 +411,11 @@ Merge Branch Into: Merge Option: - Source Branch: + Source: + Merge (Multiple) + Commit all changes + Strategy: + Targets: Move Repository Node Select parent node for: Name: @@ -451,7 +467,8 @@ Check for updates on startup Language History Commits - Show author time intead of commit time in graph + Show author time instead of commit time in graph + Show children in the commit details Subject Guide Length GIT Enable Auto CRLF @@ -541,7 +558,13 @@ Enable '--reflog' Option Open in File Browser Search Branches/Tags/Submodules - FILTERED BY: + Visibility in Graph + Unset + Hide in commit graph + Filter in commit graph + Switch Order Mode + Commit Date (--date-order) + Topologically (--topo-order) LOCAL BRANCHES Navigate to HEAD Enable '--first-parent' Option @@ -551,7 +574,6 @@ Refresh REMOTES ADD REMOTE - RESOLVE Search Commit File Message @@ -559,6 +581,7 @@ Author & Committer Current Branch Show Tags as Tree + SKIP Statistics SUBMODULES ADD SUBMODULE @@ -593,6 +616,8 @@ Skip This Version Software Update There are currently no updates available. + Copy SHA + Go to Squash Commits Into: SSH Private Key: @@ -611,7 +636,7 @@ Pop Drop Stash Drop: - Stashes + STASHES CHANGES STASHES Statistics @@ -658,7 +683,7 @@ Rescan Repositories in Default Clone Dir Search Repositories... Sort - Changes + LOCAL CHANGES Git Ignore Ignore all *{0} files Ignore *{0} files in the same folder @@ -670,6 +695,7 @@ COMMIT & PUSH Template/Histories Trigger click event + Commit (Edit) Stage all changes and commit Empty commit detected! Do you want to continue (--allow-empty)? CONFLICTS DETECTED diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 365cebfb..cf0f05b5 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -126,10 +126,12 @@ Buscar Cambios... ARCHIVOS Archivo LFS + Buscar Archivos... Submódulo INFORMACIÓN AUTOR CAMBIADO + HIJOS COMMITTER Ver refs que contienen este commit COMMIT ESTÁ CONTENIDO EN @@ -172,8 +174,8 @@ URL Resultante: Por favor, use $1, $2 para acceder a los valores de los grupos regex. OPEN AI - Servicio Preferido: - Si el 'Servicio Preferido' está establecido, SourceGit sólo lo usará en este repositorio. De lo contrario, si hay más de un servicio disponible, se mostrará un menú de contexto para elegir uno. + Servicio Preferido: + Si el 'Servicio Preferido' está establecido, SourceGit sólo lo usará en este repositorio. De lo contrario, si hay más de un servicio disponible, se mostrará un menú de contexto para elegir uno. Proxy HTTP Proxy HTTP utilizado por este repositorio Nombre de Usuario @@ -272,6 +274,7 @@ Fast-Forward (sin checkout) Fetch Fetch todos los remotos + Utilizar opción '--force' Fetch sin etiquetas Remoto: Fetch Cambios Remotos @@ -294,7 +297,6 @@ Historial de Archivos CONTENIDO CAMBIO - FILTRO Git-Flow Rama de Desarrollo: Feature: @@ -390,10 +392,10 @@ Descartar Inicializar Repositorio Ruta: - Cherry-Pick en progreso. Presiona 'Abort' para restaurar el HEAD original. - Merge en progreso. Presiona 'Abort' para restaurar el HEAD original. - Rebase en progreso. Presiona 'Abort' para restaurar el HEAD original. - Revert en progreso. Presiona 'Abort' para restaurar el HEAD original. + Cherry-Pick en progreso. + Merge en progreso. + Rebase en progreso. + Revert en progreso. Rebase Interactivo Rama Objetivo: En: @@ -402,7 +404,6 @@ Merge Rama En: Opción de Merge: - Rama Fuente: Mover Nodo del Repositorio Seleccionar nodo padre para: Nombre: @@ -438,6 +439,9 @@ Servidor APARIENCIA Fuente por defecto + Tamaño de fuente + Por defecto + Editor Fuente Monospace Usar solo fuente monospace en el editor de texto Tema @@ -453,6 +457,7 @@ Idioma Commits en el historial Mostrar hora del autor en lugar de la hora del commit en el gráfico + Mostrar hijos en los detalles de commit Longitud de la guía del asunto GIT Habilitar Auto CRLF @@ -542,7 +547,13 @@ Habilitar Opción '--reflog' Abrir en el Explorador Buscar Ramas/Etiquetas/Submódulos - FILTRAR POR: + Visibilidad en el Gráfico + Desestablecer + Ocultar en el Gráfico de Commits + Filtrar en el Gráfico de Commits + Cambiar Modo de Ordenación + Fecha de Commit (--date-order) + Topológicamente (--topo-order) RAMAS LOCALES Navegar a HEAD Habilitar Opción '--first-parent' @@ -552,7 +563,6 @@ Refrescar REMOTOS AÑADIR REMOTO - RESOLVER Buscar Commit Archivo Mensaje @@ -594,6 +604,8 @@ Omitir Esta Versión Actualización de Software Actualmente no hay actualizaciones disponibles. + Copiar SHA + Ir a Squash Commits En: Clave Privada SSH: @@ -671,6 +683,7 @@ COMMIT & PUSH Plantilla/Historias Activar evento de clic + Commit (Editar) Stagear todos los cambios y commit ¡Commit vacío detectado! ¿Quieres continuar (--allow-empty)? CONFLICTOS DETECTADOS diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 5668db44..20237bb9 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -3,23 +3,26 @@ À propos + À propos de SourceGit • Compilé avec + • Le graphique est rendu par © 2024 sourcegit-scm • TextEditor de • Les polices Monospace proviennent de - À propos de SourceGit • Le code source est disponible sur Client Git Open Source et Gratuit Ajouter un Worktree + What to Checkout: + Créer une nouvelle branche + Branche existante Emplacement : Chemin vers ce worktree. Relatif supporté. Nom de branche: Optionnel. Nom du dossier de destination par défaut. Suivre la branche : Suivi de la branche distante - What to Checkout: - Créer une nouvelle branche - Branche existante + Assistant IA + Utiliser l'IA pour générer un message de commit Appliquer Erreur Soulever les erreurs et refuser d'appliquer le patch @@ -55,6 +58,7 @@ Supprimer {0} branches sélectionnées Rejeter tous les changements Fast-Forward vers ${0}$ + Fetch ${0}$ vers ${1}$... Git Flow - Terminer ${0}$ Fusionner ${0}$ dans ${1}$... Tirer ${0}$ @@ -69,6 +73,7 @@ ANNULER Réinitialiser à la révision parente Réinitialiser à cette révision + Générer un message de commit CHANGER LE MODE D'AFFICHAGE Afficher comme liste de dossiers/fichiers Afficher comme liste de chemins @@ -77,24 +82,25 @@ Checkout ce commit Commit : Avertissement: un checkout vers un commit aboutiera vers un HEAD détaché + Branche : Changements locaux : Annuler Ne rien faire Mettre en stash et réappliquer - Branche : Cherry-Pick de ce commit Commit : Commit tous les changements + Ligne principale : Cherry Pick Supprimer les stashes Vous essayez de supprimer tous les stashes. Êtes-vous sûr de vouloir continuer ? + Cloner repository distant Paramètres supplémentaires : Arguments additionnels au clônage. Optionnel. Nom local : Nom de dépôt. Optionnel. Dossier parent : URL du dépôt : - Cloner le dépôt distant FERMER Éditeur Changer de commit @@ -103,6 +109,7 @@ Comparer avec le worktree Copier les informations Copier le SHA + Action personnalisée Rebase interactif de ${0}$ ici Rebaser ${0}$ ici Réinitialiser ${0}$ ici @@ -110,6 +117,7 @@ Reformuler Enregistrer en tant que patch... Squash dans le parent + Squash les commits enfants ici CHANGEMENTS Rechercher les changements... FICHIERS @@ -118,6 +126,7 @@ INFORMATIONS AUTEUR CHANGÉ + ENFANTS COMMITTER Vérifier les références contenant ce commit LE COMMIT EST CONTENU PAR @@ -126,29 +135,56 @@ PARENTS REFS SHA - Description + Ouvrir dans le navigateur Entrez le message du commit + Description Configurer le dépôt MODÈLE DE COMMIT - Contenu de modèle: Nom de modèle: + Contenu de modèle: + ACTION PERSONNALISÉE + Arguments : + ${REPO} - Chemin du repository; ${SHA} - SHA du commit sélectionné + Fichier exécutable : + Nom : + Portée : + Commit + Repository Adresse e-mail Adresse e-mail GIT Fetch les dépôts distants automatiquement minute(s) + Dépôt par défaut + Activer --prune pour fetch + Activer --signoff pour commit SUIVI DES PROBLÈMES Ajouter une règle d'exemple Github Ajouter une règle d'exemple Jira + Ajouter une règle d'exemple pour Incidents GitLab + Ajouter une règle d'exemple pour Merge Request GitLab Nouvelle règle Issue Regex Expression: Nom de règle : - Veuillez utiliser $1, $2 pour accéder aux valeurs des groupes regex. URL résultant: + Veuillez utiliser $1, $2 pour accéder aux valeurs des groupes regex. + IA + Service préféré: + Si le 'Service préféré' est défini, SourceGit l'utilisera seulement dans ce repository. Sinon, si plus d'un service est disponible, un menu contextuel permettant de choisir l'un d'eux sera affiché. Proxy HTTP Proxy HTTP utilisé par ce dépôt Nom d'utilisateur Nom d'utilisateur pour ce dépôt + Espaces de travail + Couleur + Restaurer les onglets au démarrage + Assistant Commits Conventionnels + Changement Radical : + Incident Clos : + Détail des Modifications : + Portée : + Courte Description : + Type de Changement : Copier Copier tout le texte Copier le nom de fichier @@ -198,10 +234,12 @@ ANCIEN Copier Mode de fichier changé + Ignorer les changements d'espaces CHANGEMENT D'OBJET LFS Différence suivante PAS DE CHANGEMENT OU SEULEMENT EN FIN DE LIGNE Différence précédente + Enregistrer en tant que patch Afficher les caractères invisibles Diff côte-à-côte SOUS-MODULE @@ -210,6 +248,7 @@ Coloration syntaxique Retour à la ligne Ouvrir dans l'outil de fusion + Voir toutes les lignes Réduit le nombre de ligne visibles Augmente le nombre de ligne visibles SÉLECTIONNEZ UN FICHIER POUR VOIR LES CHANGEMENTS @@ -217,6 +256,7 @@ Rejeter les changements Tous les changements dans la copie de travail. Changements : + Inclure les fichiers ignorés {0} changements seront rejetés Vous ne pouvez pas annuler cette action !!! Signet : @@ -224,6 +264,8 @@ Cible : Éditer le groupe sélectionné Éditer le dépôt sélectionné + Lancer action personnalisée + Nom de l'action : Fast-Forward (sans checkout) Fetch Fetch toutes les branches distantes @@ -248,63 +290,68 @@ Utiliser les leurs (checkout --theirs) Historique du fichier CONTENU - FILTRER + MODIFICATION Git-Flow - Development Branch: + Branche de développement : Feature: Feature Prefix: - FLOW - Finish Feature - FLOW - Finish Hotfix - FLOW - Finish Release - Target: + FLOW - Terminer Feature + FLOW - Terminer Hotfix + FLOW - Terminer Release + Cible: Hotfix: Hotfix Prefix: - Initialize Git-Flow - Keep branch - Production Branch: - Release: - Release Prefix: - Start Feature... - FLOW - Start Feature - Start Hotfix... - FLOW - Start Hotfix - Enter name - Start Release... - FLOW - Start Release - Version Tag Prefix: + Initialiser Git-Flow + Garder la branche + Branche de production : + Release : + Release Prefix : + Commencer Feature... + FLOW - Commencer Feature + Commencer Hotfix... + FLOW - Commencer Hotfix + Saisir le nom + Commencer Release... + FLOW - Commencer Release + Préfixe Tag de Version : Git LFS - Add Track Pattern... - Pattern is file name - Custom Pattern: - Add Track Pattern to Git LFS + Ajouter un pattern de suivi... + Le pattern est un nom de fichier + Pattern personnalisé : + Ajouter un pattern de suivi à Git LFS Fetch - Fetch LFS Objects - Run `git lfs fetch` to download Git LFS objects. This does not update the working copy. - Install Git LFS hooks - Show Locks - No Locked Files - Lock - LFS Locks - Unlock - Force Unlock + Fetch les objets LFS + Lancer `git lfs fetch` pour télécharger les objets Git LFS. Cela ne met pas à jour la copie de travail. + Installer les hooks Git LFS + Afficher les verrous + Pas de fichiers verrouillés + Verrouiller + Afficher seulement mes verrous + Verrous LFS + Déverouiller + Forcer le déverouillage Prune - Run `git lfs prune` to delete old LFS files from local storage + Lancer `git lfs prune` pour supprimer les anciens fichier LFS du stockage local Pull - Pull LFS Objects - Run `git lfs pull` to download all Git LFS files for current ref & checkout + Pull les objets LFS + Lancer `git lfs pull` pour télécharger tous les fichier Git LFS de la référence actuelle & checkout Push - Push LFS Objects - Push queued large files to the Git LFS endpoint - Remote: - Track files named '{0}' - Track all *{0} files + Push les objets LFS + Transférer les fichiers volumineux en file d'attente vers le point de terminaison Git LFS + Dépôt : + Suivre les fichiers appelés '{0}' + Suivre tous les fichiers *{0} Historique Basculer entre dispositions Horizontal/Vertical AUTEUR + HEURE DE L'AUTEUR GRAPHE & SUJET SHA HEURE DE COMMIT {0} COMMITS SÉLECTIONNÉS + Maintenir 'Ctrl' ou 'Shift' enfoncée pour sélectionner plusieurs commits. + Maintenir ⌘ ou ⇧ enfoncée pour sélectionner plusieurs commits. + CONSEILS: Référence des raccourcis clavier GLOBAL Annuler le popup en cours @@ -316,7 +363,13 @@ DÉPÔT Commit les changements de l'index Commit et pousser les changements de l'index + Ajouter tous les changements et commit + Créer une nouvelle branche basée sur le commit actuel + Rejeter les changements sélectionnés + Fetch, démarre directement Mode tableau de bord (Défaut) + Pull, démarre directement + Push, démarre directement Forcer le rechargement du dépôt Ajouter/Retirer les changements sélectionnés de l'index Recherche de commit @@ -331,26 +384,29 @@ Stage Retirer de l'index Rejeter - Initialize Repository - Path: - Cherry-Pick in progress. Press 'Abort' to restore original HEAD. - Merge request in progress. Press 'Abort' to restore original HEAD. - Rebase in progress. Press 'Abort' to restore original HEAD. - Revert in progress. Press 'Abort' to restore original HEAD. - Interactive Rebase - Target Branch: - On: - ERROR + Initialiser le repository + Chemin : + Cherry-Pick en cours. + Merge request in progress. + Rebase in progress. + Revert in progress. + Rebase interactif + Branche cible : + Sur : + Ouvrir dans le navigateur + Copier le lien + ERREUR NOTICE - Merge Branch - Into: - Merge Option: - Source Branch: + Merger la branche + Dans : + Option de merge: + Déplacer le noeud du repository + Sélectionnier le noeud parent pour : Nom : Git n'a PAS été configuré. Veuillez d'abord le faire dans le menu Préférence. Ouvrir le dossier AppData - Open With... - Optional. + Ouvrir avec... + Optionnel. Créer un nouvel onglet Bookmark Fermer l'onglet @@ -369,8 +425,17 @@ L'an dernier il y a {0} ans Préférences + IA + Analyser Diff Prompt + Clé d'API + Générer le sujet de Prompt + Modèle + Nom + Serveur APPARENCE Police par défaut + Taille de police par défaut + Taille de police de l'éditeur Police monospace N'utiliser que des polices monospace pour l'éditeur de texte Thème @@ -385,6 +450,7 @@ Vérifier les mises à jour au démarrage Language Historique de commits + Afficher l'heure de l'auteur au lieu de l'heure de validation dans le graphique Guide de longueur du sujet GIT Activer auto CRLF @@ -404,6 +470,10 @@ Saisir le chemin d'installation vers le programme GPG Clé de signature de l'utilisateur Clé de signature GPG de l'utilisateur + INTEGRATION + SHELL/TERMINAL + Shell/Terminal + Chemin Élaguer une branche distant Cible : Élaguer les Worktrees @@ -417,87 +487,89 @@ Ne rien faire Stash & Réappliquer Fetch sans les tags - Distant : + Dépôt distant : Pull (Fetch & Merge) - Use rebase instead of merge + Utiliser rebase au lieu de merge Push - Make sure submodules have been pushed + Assurez-vous que les submodules ont été poussés Force push - Local Branch: - Remote: - Push Changes To Remote - Remote Branch: - Set as tracking branch - Push all tags + Branche locale : + Dépôt distant : + Pousser les changements vers le dépôt distant + Branche distante : + Définir comme branche de suivi + Push tous les tags Push Tag To Remote - Push to all remotes - Remote: - Tag: - Quit - Rebase Current Branch - Stash & reapply local changes - On: - Rebase: - Refresh - Add Remote - Edit Remote - Name: - Remote name - Repository URL: - Remote git repository URL - Copy URL - Delete... - Edit... + Push tous les dépôts distants + Dépôt distant : + Tag : + Quitter + Rebase la branche actuelle + Stash & réappliquer changements locaux + Sur : + Rebase : + Rafraîchir + Ajouter dépôt distant + Modifier dépôt distant + Nom : + Nom du dépôt distant + URL du repository : + URL du dépôt distant + Copier l'URL + Supprimer... + Editer... Fetch - Open In Browser + Ouvrir dans le navigateur Prune - Confirm to Remove Worktree - Enable `--force` Option - Target: - Rename Branch - New Name: - Unique name for this branch - Branch: + Confirmer la suppression du Worktree + Activer l'option `--force` + Cible : + la branche + Nouveau nom : + Nom unique pour cette branche + Branche : ABORT - Cleanup(GC & Prune) - Run `git gc` command for this repository. - Clear all - Configure this repository - CONTINUE - Ouvrir dans l'explorateur Windows - Search Branches/Tags/Submodules - FILTERED BY: - LOCAL BRANCHES - Navigate To HEAD - Enable '--first-parent' Option - Create Branch - Open In {0} - Open In External Tools - Refresh - REMOTES - ADD REMOTE - RESOLVE - Search Commit - File + Fetch automatique des changements depuis les dépôts... + Nettoyage(GC & Prune) + Lancer `git gc` pour ce repository. + Tout effacer + Configurer ce repository + CONTINUER + Pas d'actions personnalisées + Activer l'option '--reflog' + Ouvrir dans l'explorateur de fichiers + Rechercher Branches/Tags/Submodules + BRANCHES LOCALES + Naviguer vers le HEAD + Activer l'option '--first-parent' + Créer une branche + Ouvrir dans {0} + Ouvrir dans un outil externe + Rafraîchir + DEPOTS DISTANTS + AJOUTER DEPOT DISTANT + Rechercher un commit + Fichier Message SHA - Author & Committer - Show Tags as Tree - Statistics + Auteur & Committer + Branche actuelle + Voir les Tags en tant qu'arbre + Statistiques SUBMODULES - ADD SUBMODULE - UPDATE SUBMODULE + AJOUTER SUBMODULE + METTRE A JOUR SUBMODULE TAGS - NEW TAG + NOUVEAU TAG Ouvrir dans un terminal WORKTREES - ADD WORKTREE + AJOUTER WORKTREE PRUNE - Git Repository URL - Reset Current Branch To Revision + URL du repository Git + Reset branche actuelle à la révision Reset Mode: - Move To: - Current Branch: + Déplacer vers : + Branche actuelle : Ouvrir dans l'explorateur de fichier Revert le Commit Commit : @@ -508,21 +580,27 @@ SAUVEGARDER Sauvegarder en tant que... Le patch a été sauvegardé ! - Vérifier les mises à jour... + Dossier racine : + Rechercher des mises à jour... Une nouvelle version du logiciel est disponible : La vérification de mise à jour à échouée ! Télécharger Passer cette version Mise à jour du logiciel Il n'y a pas de mise à jour pour le moment. + Copier le SHA Squash Commits + Dans : SSH Private Key: Private SSH key store path START Stash Include untracked files - Message: + Garder les fichiers staged + Message : Optionnel. Nom de ce stash + Seulement les changements staged + Les modifications staged et unstaged des fichiers sélectionnés seront stockées!!! Stash les changements locaux Appliquer Effacer @@ -539,6 +617,7 @@ WEEK COMMITS: AUTHORS: + APERCU SUBMODULES Add Submodule Copy Relative Path @@ -549,6 +628,7 @@ Delete Submodule OK Copy Tag Name + Copier le message du tag Delete ${0}$... Fusionner ${0}$ dans ${1}$... Push ${0}$... @@ -567,9 +647,11 @@ Supprimer GLISSER / DEPOSER DE DOSSIER SUPPORTÉ. GROUPAGE PERSONNALISÉ SUPPORTÉ. Éditer + Déplacer vers un autre groupe Ouvrir tous les dépôts Ouvrir un dépôt Ouvrir le terminal + Réanalyser les repositories dans le dossier de clonage par défaut Chercher des dépôts... Trier Changements @@ -583,6 +665,9 @@ COMMIT COMMIT & PUSH Modèles/Historiques + Trigger click event + Stage tous les changements et commit + Un commit vide a été détecté ! Voulez-vous continuer (--allow-empty) ? CONFLITS DÉTECTÉS LES CONFLITS DE FICHIER SONT RÉSOLUS INCLURE LES FICHIERS NON-SUIVIS @@ -597,6 +682,8 @@ VOIR LES FICHIERS PRÉSUMÉS INCHANGÉS Modèle: ${0}$ Faites un clique droit sur les fichiers sélectionnés et faites vos choix pour la résoluion des conflits. + ESPACE DE TRAVAIL : + Configurer les espaces de travail... WORKTREE Copier le chemin Verrouiller diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml new file mode 100644 index 00000000..18754c8e --- /dev/null +++ b/src/Resources/Locales/it_IT.axaml @@ -0,0 +1,698 @@ + + + + + Informazioni + Informazioni su SourceGit + • Creato con + • Il grafico è reso da + © 2024 sourcegit-scm + • Editor di testo da + • I font monospaziati provengono da + • Il codice sorgente è disponibile su + Client GUI Git open source e gratuito + Aggiungi Worktree + Cosa fare il checkout: + Branch esistente + Crea nuovo branch + Posizione: + Percorso per questo worktree. Supportato il percorso relativo. + Nome Branch: + Facoltativo. Predefinito è il nome della cartella di destinazione. + Traccia Branch: + Traccia branch remoto + Assistente AI + Usa AI per generare il messaggio di commit + Applica + Errore + Genera errori e si rifiuta di applicare la patch + Tutti gli errori + Simile a 'errore', ma mostra di più + File Patch: + Seleziona file .patch da applicare + Ignora modifiche agli spazi + Nessun avviso + Disattiva l'avviso sugli spazi finali + Applica Patch + Avviso + Mostra avvisi per alcuni errori, ma applica comunque + Spazi: + Archivia... + Salva Archivio In: + Seleziona il percorso del file archivio + Revisione: + Archivia + Richiedi Password SourceGit + FILE ASSUNTI COME INVARIATI + NESSUN FILE ASSUNTO COME INVARIATO + RIMUOVI + FILE BINARIO NON SUPPORTATO!!! + Attribuisci + L'ATTRIBUZIONE SU QUESTO FILE NON È SUPPORTATA!!! + Checkout ${0}$... + Confronta con Branch + Confronta con HEAD + Confronta con Worktree + Copia Nome Branch + Elimina ${0}$... + Elimina i {0} branch selezionati + Scarta tutte le modifiche + Avanzamento Veloce a ${0}$ + Recupera ${0}$ in ${1}$... + Git Flow - Completa ${0}$ + Unisci ${0}$ in ${1}$... + Recupera ${0}$ + Recupera ${0}$ in ${1}$... + Invia ${0}$ + Riallinea ${0}$ su ${1}$... + Rinomina ${0}$... + Imposta Branch di Tracciamento + Rimuovi Tracciamento + Confronto Branch + Byte + ANNULLA + Ripristina Questa Revisione + Ripristina la Revisione Padre + Genera messaggio di commit + CAMBIA MODALITÀ DI VISUALIZZAZIONE + Mostra come elenco di file e directory + Mostra come elenco di percorsi + Mostra come albero del filesystem + Checkout Branch + Checkout Commit + Avviso: Effettuando un checkout del commit, la tua HEAD sarà separata + Commit: + Branch: + Modifiche Locali: + Scarta + Non fare nulla + Stash e Ripristina + Cherry Pick + Aggiungi sorgente al messaggio di commit + Commit(s): + Conferma tutte le modifiche + Mainline: + Di solito non è possibile cherry-pick su una fusione perché non si sa quale lato della fusione deve essere considerato il mainline. Questa opzione consente di riprodurre la modifica relativa al genitore specificato. + Cancella Stash + Stai per cancellare tutti gli stash. Sei sicuro di voler continuare? + Clona Repository Remoto + Parametri Extra: + Argomenti addizionali per clonare il repository. Facoltativo. + Nome Locale: + Nome del repository. Facoltativo. + Cartella Principale: + URL del Repository: + CHIUDI + Editor + Cherry-Pick Questo Commit + Cherry-Pick... + Checkout Commit + Confronta con HEAD + Confronta con Worktree + Copia Info + Copia SHA + Azione Personalizzata + Rebase Interattivo ${0}$ fino a Qui + Riallinea ${0}$ fino a Qui + Ripristina ${0}$ fino a Qui + Annulla Commit + Modifica + Salva come Patch... + Unisci al Genitore + Unisci Commit Figli fino a Qui + MODIFICHE + Cerca Modifiche... + FILE + File LFS + Sottomodulo + INFORMAZIONI + AUTORE + MODIFICATO + CHI HA COMMITTATO + Controlla i riferimenti che contengono questo commit + IL COMMIT È CONTENUTO DA + Mostra solo le prime 100 modifiche. Vedi tutte le modifiche nella scheda MODIFICHE. + MESSAGGIO + GENITORI + RIFERIMENTI + SHA + Apri nel Browser + Inserisci l'oggetto del commit + Descrizione + Configura Repository + TEMPLATE DI COMMIT + Nome Template: + Contenuto Template: + AZIONE PERSONALIZZATA + Argomenti: + ${REPO} - Percorso del repository; ${SHA} - SHA del commit selezionato + File Eseguibile: + Nome: + Ambito: + Commit + Repository + Indirizzo Email + Indirizzo email + GIT + Recupera automaticamente i remoti + Minuto/i + Remoto Predefinito + Abilita --prune durante il fetch + Abilita --signoff per i commit + TRACCIAMENTO ISSUE + Aggiungi Regola Esempio per GitHub + Aggiungi Regola Esempio per Jira + Aggiungi Regola Esempio per Issue GitLab + Aggiungi Regola Esempio per Merge Request GitLab + Nuova Regola + Espressione Regex Issue: + Nome Regola: + URL Risultato: + Utilizza $1, $2 per accedere ai valori dei gruppi regex. + AI + Servizio Preferito: + Se il 'Servizio Preferito' è impostato, SourceGit utilizzerà solo quello per questo repository. In caso contrario, se sono disponibili più servizi, verrà mostrato un menu contestuale per sceglierne uno. + Proxy HTTP + Proxy HTTP usato da questo repository + Nome Utente + Nome utente per questo repository + Spazi di Lavoro + Colore + Ripristina schede all'avvio + Guida Commit Convenzionali + Modifica Sostanziale: + Issue Chiusa: + Dettaglio Modifiche: + Ambito: + Descrizione Breve: + Tipo di Modifica: + Copia + Copia Tutto il Testo + Copia Percorso + Copia Nome File + Crea Branch... + Basato Su: + Checkout del Branch Creato + Modifiche Locali: + Scarta + Non Fare Nulla + Stash e Ripristina + Nome Nuovo Branch: + Inserisci il nome del branch. + Crea Branch Locale + Crea Tag... + Nuovo Tag Su: + Firma con GPG + Messaggio Tag: + Facoltativo. + Nome Tag: + Formato consigliato: v1.0.0-alpha + Invia a tutti i remoti dopo la creazione + Crea Nuovo Tag + Tipo: + annotato + leggero + Tieni premuto Ctrl per avviare direttamente + Taglia + Elimina Branch + Branch: + Stai per eliminare un branch remoto!!! + Elimina anche il branch remoto ${0}$ + Elimina Branch Multipli + Stai per eliminare più branch contemporaneamente. Controlla attentamente prima di procedere! + Elimina Remoto + Remoto: + Destinazione: + Conferma Eliminazione Gruppo + Conferma Eliminazione Repository + Elimina Sottomodulo + Percorso Sottomodulo: + Elimina Tag + Tag: + Elimina dai repository remoti + DIFF BINARIO + NUOVO + VECCHIO + Copia + Modalità File Modificata + Ignora Modifiche agli Spazi + MODIFICA OGGETTO LFS + Differenza Successiva + NESSUNA MODIFICA O SOLO CAMBIAMENTI DI FINE LINEA + Differenza Precedente + Salva come Patch + Mostra Simboli Nascosti + Diff Affiancato + SOTTOMODULO + NUOVO + Scambia + Evidenziazione Sintassi + Avvolgimento delle Parole + Apri nello Strumento di Merge + Mostra Tutte le Righe + Diminuisci Numero di Righe Visibili + Aumenta Numero di Righe Visibili + SELEZIONA UN FILE PER VISUALIZZARE LE MODIFICHE + Apri nello Strumento di Merge + Scarta Modifiche + Tutte le modifiche locali nella copia di lavoro. + Modifiche: + Includi file ignorati + Un totale di {0} modifiche saranno scartate + Questa azione non può essere annullata!!! + Segnalibro: + Nuovo Nome: + Destinazione: + Modifica Gruppo Selezionato + Modifica Repository Selezionato + Esegui Azione Personalizzata + Nome Azione: + Avanzamento Veloce (senza verifica) + Recupera + Recupera da tutti i remoti + Recupera senza tag + Remoto: + Recupera Modifiche Remote + Presumi invariato + Scarta... + Scarta {0} file... + Scarta Modifiche nelle Righe Selezionate + Apri Strumento di Merge Esterno + Salva come Patch... + Staging + Staging {0} file + Staging Modifiche nelle Righe Selezionate + Stash... + Stash {0} file... + Rimuovi dallo Staging + Rimuovi dallo Staging {0} file + Rimuovi dallo Staging Modifiche nelle Righe Selezionate + Usa Il Loro (checkout --theirs) + Usa Il Mio (checkout --ours) + Cronologia File + CONTENUTO + MODIFICA + FILTRO + Git-Flow + Branch di Sviluppo: + Feature: + Prefisso Feature: + FLOW - Completa Feature + FLOW - Completa Hotfix + FLOW - Completa Release + Target: + Hotfix: + Prefisso Hotfix: + Inizializza Git-Flow + Mantieni branch + Branch di Produzione: + Release: + Prefisso Release: + Inizia Feature... + FLOW - Inizia Feature + Inizia Hotfix... + FLOW - Inizia Hotfix + Inserisci nome + Inizia Release... + FLOW - Inizia Release + Prefisso Tag Versione: + Git LFS + Aggiungi Modello di Tracciamento... + Il modello è un nome file + Modello Personalizzato: + Aggiungi Modello di Tracciamento a Git LFS + Recupera + Recupera Oggetti LFS + Esegui `git lfs fetch` per scaricare gli oggetti Git LFS. Questo non aggiorna la copia di lavoro. + Installa hook di Git LFS + Mostra Bloccaggi + Nessun File Bloccato + Blocca + Mostra solo i miei bloccaggi + Bloccaggi LFS + Sblocca + Forza Sblocco + Elimina + Esegui `git lfs prune` per eliminare vecchi file LFS dallo storage locale + Pull + Pull Oggetti LFS + Esegui `git lfs pull` per scaricare tutti i file LFS per il ref corrente e fare il checkout + Push + Push Oggetti LFS + Invia grandi file in coda al punto finale di Git LFS + Remoto: + Traccia file con nome '{0}' + Traccia tutti i file *{0} + Storico + Passa Layout Orizzontale/Verticale + AUTORE + ORA AUTORE + GRAFICO & OGGETTO + SHA + ORA COMMIT + {0} COMMIT SELEZIONATI + Tieni premuto 'Ctrl' o 'Shift' per selezionare più commit. + Tieni premuto ⌘ o ⇧ per selezionare più commit. + SUGGERIMENTI: + Riferimento Scorciatoie da Tastiera + GLOBALE + Annulla il popup corrente + Clona una nuova repository + Chiudi la pagina corrente + Vai alla pagina precedente + Vai alla pagina successiva + Crea una nuova pagina + Apri la finestra di preferenze + REPOSITORY + Conferma le modifiche in fase + Conferma e invia le modifiche in fase + Aggiungi tutte le modifiche e conferma + Crea un nuovo branch dal commit selezionato + Scarta le modifiche selezionate + Recupera, avvia direttamente + Modalità Dashboard (Predefinita) + Recupera e integra, avvia direttamente + Invia, avvia direttamente + Forza il ricaricamento di questo repository + Aggiungi/Rimuovi le modifiche selezionate + Modalità ricerca commit + Passa a 'Modifiche' + Passa a 'Storico' + Passa a 'Stashes' + EDITOR TESTO + Chiudi il pannello di ricerca + Trova il prossimo risultato + Trova il risultato precedente + Apri il pannello di ricerca + Aggiungi + Rimuovi + Scarta + Inizializza Repository + Percorso: + Cherry-Pick in corso. + Richiesta di merge in corso. + Rebase in corso. + Revert in corso. + Rebase Interattivo + Branch di destinazione: + Su: + Apri nel Browser + Copia il Link + ERRORE + AVVISO + Unisci Branch + In: + Opzione di Merge: + Sposta Nodo Repository + Seleziona nodo padre per: + Nome: + Git NON è configurato. Vai su [Preferenze] e configurarlo prima. + Apri Cartella Dati App + Apri con... + Opzionale. + Crea Nuova Pagina + Segnalibro + Chiudi Tab + Chiudi Altri Tab + Chiudi i Tab a Destra + Copia Percorso Repository + Repository + Incolla + Proprio ora + {0} minuti fa + {0} ore fa + Ieri + {0} giorni fa + Il mese scorso + {0} mesi fa + L'anno scorso + {0} anni fa + Preferenze + AI + Analizza il Prompt Differenza + Chiave API + Genera Prompt Soggetto + Modello + Nome + Server + ASPETTO + Font Predefinito + Font Size + Dimensione Font Predefinita + Dimensione Font Editor + Font Monospaziato + Usa solo font monospaziato nell'editor + Tema + Sostituzioni Tema + Usa larghezza fissa per i tab nella barra del titolo + Usa cornice finestra nativa + STRUMENTO DI DIFFERENZA/UNIONE + Percorso Installazione + Inserisci il percorso per lo strumento di differenza/unione + Strumento + GENERALE + Controlla aggiornamenti all'avvio + Lingua + Numero massimo di commit nella cronologia + Mostra l'orario dell'autore anziché quello del commit nel grafico + Lunghezza Guida Soggetto + GIT + Abilita Auto CRLF + Cartella predefinita per cloni + Email Utente + Email globale utente Git + Percorso Installazione + Nome Utente + Nome globale utente Git + Versione di Git + Git (>= 2.23.0) è richiesto da questa applicazione + FIRMA GPG + Firma GPG per commit + Firma GPG per tag + Formato GPG + Percorso Programma Installato + Inserisci il percorso per il programma GPG installato + Chiave Firma Utente + Chiave GPG dell'utente per la firma + INTEGRAZIONE + SHELL/TERMINALE + Shell/Terminale + Percorso + Potatura Remota + Destinazione: + Potatura Worktrees + Potatura delle informazioni di worktree in `$GIT_DIR/worktrees` + Pull + Branch: + Recupera tutti i branch + In: + Modifiche Locali: + Scarta + Non fare nulla + Accantona e Riapplica + Recupera senza tag + Remoto: + Pull (Fetch & Merge) + Usa rebase anziché merge + Push + Assicurati che i submoduli siano stati spinti + Forza il push + Branch Locale: + Remoto: + Invia modifiche al remoto + Branch Remoto: + Imposta come branch di tracking + Invia tutti i tag + Invia Tag al Remoto + Invia a tutti i remoti + Remoto: + Tag: + Esci + Rebase Branch Corrente + Accantona & Riapplica modifiche locali + Su: + Rebase: + Aggiorna + Aggiungi Remoto + Modifica Remoto + Nome: + Nome del remoto + URL del Repository: + URL del repository Git remoto + Copia URL + Elimina... + Modifica... + Recupera + Apri nel Browser + Pota + Conferma Rimozione Worktree + Abilita opzione `--force` + Destinazione: + Rinomina Branch + Nuovo Nome: + Nome univoco per questo branch + Branch: + ANNULLA + Recupero automatico delle modifiche dai remoti... + Pulizia (GC & Potatura) + Esegui il comando `git gc` per questo repository. + Cancella tutto + Configura questo repository + CONTINUA + Azioni Personalizzate + Nessuna Azione Personalizzata + Abilita opzione '--reflog' + Apri nel Browser File + Cerca Branch/Tag/Submodule + FILTRATO DA: + BRANCH LOCALI + Vai a HEAD + Abilita opzione '--first-parent' + Crea Branch + Apri in {0} + Apri in Strumenti Esterni + Aggiorna + REMOTI + AGGIUNGI REMOTO + Cerca Commit + File + Messaggio + SHA + Autore & Committente + Branch Corrente + Mostra Tag come Albero + Statistiche + SUBMODULE + AGGIUNGI SUBMODULE + AGGIORNA SUBMODULE + TAG + NUOVO TAG + Apri nel Terminale + WORKTREE + AGGIUNGI WORKTREE + POTATURA + URL del Repository Git + Reset Branch Corrente alla Revisione + Modalità Reset: + Sposta a: + Branch Corrente: + Mostra nel File Explorer + Revert Commit + Commit: + Commit delle modifiche di revert + Modifica Messaggio di Commit + Usa 'Shift+Enter' per inserire una nuova riga. 'Enter' è il tasto rapido per il pulsante OK + In esecuzione. Attendere... + SALVA + Salva come... + La patch è stata salvata con successo! + Scansiona Repository + Cartella Principale: + Controlla Aggiornamenti... + È disponibile una nuova versione del software: + Errore durante il controllo degli aggiornamenti! + Scarica + Salta questa versione + Aggiornamento Software + Non ci sono aggiornamenti disponibili. + Squash Commit + In: + Chiave Privata SSH: + Percorso per la chiave SSH privata + AVVIA + Accantona + Includi file non tracciati + Mantieni file indicizzati + Messaggio: + Opzionale. Nome di questo accantonamento + Solo modifiche indicizzate + Sia le modifiche indicizzate che quelle non indicizzate dei file selezionati saranno accantonate!!! + Accantona Modifiche Locali + Applica + Elimina + Estrai + Elimina Accantonamento + Elimina: + Accantonamenti + MODIFICHE + ACCANTONAMENTI + Statistiche + COMMIT + COMMITTER + MESE + SETTIMANA + COMMIT: + AUTORI: + PANORAMICA + SUBMODULE + Aggiungi Submodule + Copia Percorso Relativo + Recupera submodule annidati + Apri Repository Submodule + Percorso Relativo: + Cartella relativa per memorizzare questo modulo. + Elimina Submodule + OK + Copia Nome Tag + Copia Messaggio Tag + Elimina ${0}$... + Unisci ${0}$ in ${1}$... + Invia ${0}$... + URL: + Aggiorna Submodule + Tutti i submodule + Inizializza se necessario + Ricorsivamente + Submodule: + Usa opzione --remote + Avviso + Pagina di Benvenuto + Crea Gruppo + Crea Sottogruppo + Clona Repository + Elimina + TRASCINA & RILASCIA CARTELLA SUPPORTATO. RAGGRUPPAMENTI PERSONALIZZATI SUPPORTATI. + Modifica + Sposta in un Altro Gruppo + Apri Tutti i Repository + Apri Repository + Apri Terminale + Riscansiona Repository nella Cartella Clone Predefinita + Cerca Repository... + Ordina + Modifiche + Git Ignore + Ignora tutti i file *{0} + Ignora i file *{0} nella stessa cartella + Ignora i file nella stessa cartella + Ignora solo questo file + Modifica + Puoi indicizzare questo file ora. + COMMIT + COMMIT & PUSH + Template/Storico + Attiva evento click + Indica tutte le modifiche e fai il commit + Commit vuoto rilevato! Vuoi continuare (--allow-empty)? + CONFLITTI RILEVATI + CONFLITTI NEI FILE RISOLTI + INCLUDI FILE NON TRACCIATI + NESSUN MESSAGGIO RECENTE INSERITO + NESSUN TEMPLATE DI COMMIT + INDICIZZATI + RIMUOVI DALL'INDICIZZAZIONE + RIMUOVI TUTTO DALL'INDICIZZAZIONE + NON INDICIZZATI + INDICIZZA + INDICIZZA TUTTO + VISUALIZZA COME NON MODIFICATO + Template: ${0}$ + Clicca con il tasto destro sul file(i) selezionato, quindi scegli come risolvere i conflitti. + WORKSPACE: + Configura Workspaces... + WORKTREE + Copia Percorso + Blocca + Rimuovi + Sblocca + diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index ecd1654c..d72dd370 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -2,6 +2,7 @@ + + Sobre + Sobre o SourceGit • Construído com • Gráfico desenhado por © 2024 sourcegit-scm • Editor de Texto de • Fontes monoespaçadas de - Sobre o SourceGit • Código-fonte pode ser encontrado em Cliente Git GUI Livre e de Código Aberto - Sobre - Caminho para este worktree. Caminho relativo é suportado. - Localização: - Opcional. O padrão é o nome da pasta de destino. - Nome do Branch: - Rastreando branch remoto - Rastrear Branch: - Criar Novo Branch - Branch Existente - O que Checar: Adicionar Worktree + O que Checar: + Branch Existente + Criar Novo Branch + Localização: + Caminho para este worktree. Caminho relativo é suportado. + Nome do Branch: + Opcional. O padrão é o nome da pasta de destino. + Rastrear Branch: + Rastreando branch remoto Assietente IA Utilizar IA para gerar mensagem de commit - Erros levantados e se recusa a aplicar o patch - Erro - Semelhante a 'erro', mas mostra mais - Erro Total - Selecione o arquivo .patch para aplicar - Arquivo de Patch: - Ignorar mudanças de espaço em branco - Desativa o aviso de espaço em branco no final - Sem Aviso - Aplicar Patch - Emite avisos para alguns erros, mas aplica - Aviso - Espaço em Branco: Patch - Selecione o caminho do arquivo de arquivo + Erro + Erros levantados e se recusa a aplicar o patch + Erro Total + Semelhante a 'erro', mas mostra mais + Arquivo de Patch: + Selecione o arquivo .patch para aplicar + Ignorar mudanças de espaço em branco + Sem Aviso + Desativa o aviso de espaço em branco no final + Aplicar Patch + Aviso + Emite avisos para alguns erros, mas aplica + Espaço em Branco: + Arquivar... Salvar Arquivo Como: + Selecione o caminho do arquivo de arquivo Revisão: Arquivar - Arquivar... SourceGit Askpass + ARQUIVOS CONSIDERADOS SEM ALTERAÇÕES NENHUM ARQUIVO CONSIDERADO SEM ALTERAÇÕES REMOVER - ARQUIVOS CONSIDERADOS SEM ALTERAÇÕES ARQUIVO BINÁRIO NÃO SUPORTADO!!! Blame BLAME NESTE ARQUIVO NÃO É SUPORTADO!!! @@ -95,42 +96,42 @@ Comparação de Branches Bytes CANCELAR - Resetar para Revisão Pai Resetar para Esta Revisão + Resetar para Revisão Pai Gerar mensagem de commit + ALTERAR MODO DE EXIBIÇÃO Exibir como Lista de Arquivos e Diretórios Exibir como Lista de Caminhos Exibir como Árvore de Sistema de Arquivos - ALTERAR MODO DE EXIBIÇÃO - Commit: - Aviso: Ao fazer o checkout de um commit, seu Head ficará desanexado + Checkout Branch Checkout Commit + Aviso: Ao fazer o checkout de um commit, seu Head ficará desanexado + Commit: + Branch: + Alterações Locais: Descartar Nada Stash & Reaplicar - Alterações Locais: - Branch: - Checkout Branch + Cherry-Pick Adicionar origem à mensagem de commit Commit(s): Commitar todas as alterações Mainline: Geralmente você não pode fazer cherry-pick de um merge commit porque você não sabe qual lado do merge deve ser considerado na mainline. Esta opção permite ao cherry-pick reaplicar a mudança relativa ao parent especificado. - Cherry-Pick - Você está tentando limpar todas as stashes. Tem certeza que deseja continuar? Limpar Stashes - Argumentos adicionais para clonar o repositório. Opcional. + Você está tentando limpar todas as stashes. Tem certeza que deseja continuar? + Clonar Repositório Remoto Parâmetros Extras: - Nome do repositório. Opcional. + Argumentos adicionais para clonar o repositório. Opcional. Nome Local: + Nome do repositório. Opcional. Pasta Pai: URL do Repositório: - Clonar Repositório Remoto FECHAR Editor - Checar Commit Cherry-Pick este commit Cherry-Pick ... + Checar Commit Comparar com HEAD Comparar com Worktree Copiar Informações @@ -144,11 +145,12 @@ Salvar como Patch... Mesclar ao Commit Pai Mesclar commits filhos para este - Buscar Alterações... ALTERAÇÕES + Buscar Alterações... + ARQUIVOS Arquivo LFS Submódulo - ARQUIVOS + INFORMAÇÃO AUTOR ALTERADO COMMITTER @@ -159,13 +161,13 @@ PAIS REFERÊNCIAS SHA - INFORMAÇÃO Abrir no navegador - Descrição Insira o assunto do commit - Conteúdo do Template: - Nome do Template: + Descrição + Configurar Repositório TEMPLATE DE COMMIT + Nome do Template: + Conteúdo do Template: AÇÃO CUSTOMIZADA Argumentos: ${REPO} - Caminho do repositório; ${SHA} - SHA do commit selecionado @@ -176,13 +178,13 @@ Repositório Endereço de email Endereço de email - Endereço de Email + GIT Buscar remotos automaticamente Minuto(s) Remoto padrão Habilita --prune ao buscar Habilita --signoff para commits - GIT + RASTREADOR DE PROBLEMAS Adicionar Regra de Exemplo do Github Adicionar Regra de Exemplo do Jira Adicionar Regra de Exemplo do GitLab @@ -190,17 +192,15 @@ Nova Regra Expressão Regex de Issue: Nome da Regra: - Por favor, use $1, $2 para acessar os valores de grupos do regex. URL de Resultado: - RASTREADOR DE PROBLEMAS + Por favor, use $1, $2 para acessar os valores de grupos do regex. IA - Serviço desejado: - Se o 'Serviço desejado' for definido, SourceGit usará ele neste Repositório. Senão, caso haja mais de um serviço disponível, será exibido um menu para seleção. - Proxy HTTP usado por este repositório + Serviço desejado: + Se o 'Serviço desejado' for definido, SourceGit usará ele neste Repositório. Senão, caso haja mais de um serviço disponível, será exibido um menu para seleção. Proxy HTTP - Nome de usuário para este repositório + Proxy HTTP usado por este repositório Nome de Usuário - Configurar Repositório + Nome de usuário para este repositório Workspaces Cor Restaurar abas ao inicializar @@ -213,51 +213,51 @@ Tipo de mudança: Copiar Copiar todo o texto - Copiar Nome do Arquivo Copiar Caminho + Copiar Nome do Arquivo + Criar Branch... Baseado Em: Checar o branch criado + Alterações Locais: Descartar Não Fazer Nada Guardar & Reaplicar - Alterações Locais: - Insira o nome do branch. Nome do Novo Branch: + Insira o nome do branch. Criar Branch Local - Criar Branch... + Criar Tag... Nova Tag Em: Assinatura GPG - Opcional. Mensagem da Tag: - Formato recomendado: v1.0.0-alpha + Opcional. Nome da Tag: + Formato recomendado: v1.0.0-alpha Enviar para todos os remotos após criação Criar Nova Tag + Tipo: anotada leve - Tipo: - Criar Tag... Pressione Ctrl para iniciar diretamente Recortar + Excluir Branch Branch: Você está prestes a excluir uma branch remota!!! Também excluir branch remoto ${0}$ - Excluir Branch - Você está tentando excluir vários branches de uma vez. Certifique-se de verificar antes de agir! Excluir Múltiplos Branches - Remoto: + Você está tentando excluir vários branches de uma vez. Certifique-se de verificar antes de agir! Excluir Remoto + Remoto: Alvo: Confirmar Exclusão do Grupo Confirmar Exclusão do Repositório - Caminho do Submódulo: Excluir Submódulo + Caminho do Submódulo: + Excluir Tag Tag: Excluir dos repositórios remotos - Excluir Tag + DIFERENÇA BINÁRIA NOVO ANTIGO - DIFERENÇA BINÁRIA Copiar Modo de Arquivo Alterado Ignorar mudanças de espaço em branco @@ -268,8 +268,8 @@ Salvar como um Patch Exibir símbolos ocultos Diferença Lado a Lado - NOVO SUBMÓDULO + NOVO Trocar Realce de Sintaxe Quebra de Linha @@ -279,12 +279,12 @@ Aumentar Número de Linhas Visíveis SELECIONE O ARQUIVO PARA VISUALIZAR AS MUDANÇAS Abrir na Ferramenta de Mesclagem + Descartar Alterações Todas as alterações locais na cópia de trabalho. Alterações: Incluir arquivos ignorados Um total de {0} alterações será descartado Você não pode desfazer esta ação!!! - Descartar Alterações Favorito: Novo Nome: Alvo: @@ -293,11 +293,11 @@ Executar ação customizada Nome da ação: Fast-Forward (sem checkout) + Buscar Buscar todos os remotos Buscar sem tags Remoto: Buscar Alterações Remotas - Buscar Assumir não alterado Descartar... Descartar {0} arquivos... @@ -312,12 +312,12 @@ Desfazer Preparação Desfazer Preparação de {0} arquivos Desfazer Preparação nas Linhas Selecionadas - Usar Meu (checkout --ours) Usar Deles (checkout --theirs) + Usar Meu (checkout --ours) Histórico de Arquivos CONTEUDO MUDANÇA - FILTRO + Git-Flow Branch de Desenvolvimento: Feature: Prefixo da Feature: @@ -340,34 +340,34 @@ Iniciar Release... FLOW - Iniciar Release Prefixo da Tag de Versão: - Git-Flow + Git LFS + Adicionar Padrão de Rastreamento... Padrão é nome do arquivo Padrão Personalizado: Adicionar Padrão de Rastreamento ao Git LFS - Adicionar Padrão de Rastreamento... - Execute `git lfs fetch` para baixar objetos Git LFS. Isso não atualiza a cópia de trabalho. - Buscar Objetos LFS Buscar + Buscar Objetos LFS + Execute `git lfs fetch` para baixar objetos Git LFS. Isso não atualiza a cópia de trabalho. Instalar hooks do Git LFS + Exibir bloqueios Sem Arquivos Bloqueados Bloquear Exibir apenas meus bloqueios Bloqueios LFS Desbloquear Forçar Desbloqueio - Exibir bloqueios - Execute `git lfs prune` para excluir arquivos LFS antigos do armazenamento local Prune - Execute `git lfs pull` para baixar todos os arquivos Git LFS para a referência atual e checkout - Puxar Objetos LFS + Execute `git lfs prune` para excluir arquivos LFS antigos do armazenamento local Puxar - Envie arquivos grandes enfileirados para o endpoint Git LFS - Enviar Objetos LFS + Puxar Objetos LFS + Execute `git lfs pull` para baixar todos os arquivos Git LFS para a referência atual e checkout Enviar + Enviar Objetos LFS + Envie arquivos grandes enfileirados para o endpoint Git LFS Remoto: Rastrear arquivos nomeados '{0}' Rastrear todos os arquivos *{0} - Git LFS + Históricos Alternar Layout Horizontal/Vertical AUTOR DATA DO AUTOR @@ -375,17 +375,18 @@ SHA HORA DO COMMIT SELECIONADO {0} COMMITS + Segure 'Ctrl' ou 'Shift' para selecionar múltiplos commits. Segure ⌘ ou ⇧ para selecionar múltiplos commits. DICAS: - Segure 'Ctrl' ou 'Shift' para selecionar múltiplos commits. - Históricos + Referência de Atalhos de Teclado + GLOBAL Cancelar popup atual Fechar página atual - Ir para a próxima página Ir para a página anterior + Ir para a próxima página Criar nova página Abrir diálogo de preferências - GLOBAL + REPOSITÓRIO Commitar mudanças preparadas Commitar e enviar mudanças preparadas Preparar todas as mudanças e commitar @@ -393,43 +394,40 @@ Descartar mudanças selecionadas Buscar, imediatamente Modo de Dashboard (Padrão) - Modo de busca de commits Puxar, imediatamente Enviar, imediatamente Forçar recarregamento deste repositório Preparar/Despreparar mudanças selecionadas + Modo de busca de commits Alternar para 'Mudanças' Alternar para 'Históricos' Alternar para 'Stashes' - REPOSITÓRIO + EDITOR DE TEXTO Fechar painel de busca Encontrar próxima correspondência Encontrar correspondência anterior Abrir painel de busca - EDITOR DE TEXTO - Referência de Atalhos de Teclado - Descartar Preparar Despreparar - Caminho: + Descartar Inicializar Repositório - Cherry-Pick em andamento. Pressione 'Abort' para restaurar o HEAD original. - Merge em andamento. Pressione 'Abort' para restaurar o HEAD original. - Rebase em andamento. Pressione 'Abort' para restaurar o HEAD original. - Revert em andamento. Pressione 'Abort' para restaurar o HEAD original. - Em: - Ramo Alvo: + Caminho: + Cherry-Pick em andamento. + Merge em andamento. + Rebase em andamento. + Revert em andamento. Rebase Interativo - Copiar link + Ramo Alvo: + Em: Abrir no navegador + Copiar link ERRO AVISO + Mesclar Ramo Para: Opção de Mesclagem: - Ramo de Origem: Mover nó do repositório Selecionar nó pai para: - Mesclar Ramo Nome: O Git NÃO foi configurado. Por favor, vá para [Preferências] e configure primeiro. Abrir Pasta de Dados do Aplicativo @@ -443,79 +441,83 @@ Copiar Caminho do Repositório Repositórios Colar - {0} dias atrás - {0} horas atrás Agora mesmo - Mês passado - Ano passado {0} minutos atrás - {0} meses atrás - {0} anos atrás + {0} horas atrás Ontem + {0} dias atrás + Mês passado + {0} meses atrás + Ano passado + {0} anos atrás + Preferências + INTELIGÊNCIA ARTIFICIAL Prompt para Analisar Diff Chave da API Prompt para Gerar Título Modelo Nome Servidor - INTELIGÊNCIA ARTIFICIAL + APARÊNCIA Fonte Padrão + Tamanho da Fonte + Padrão + Editor Fonte Monoespaçada Usar fonte monoespaçada apenas no editor de texto Tema Substituições de Tema Usar largura fixa de aba na barra de título Usar moldura de janela nativa - APARÊNCIA - Insira o caminho para a ferramenta de diff/merge - Caminho de Instalação - Ferramenta FERRAMENTA DE DIFF/MERGE + Caminho de Instalação + Insira o caminho para a ferramenta de diff/merge + Ferramenta + GERAL Verificar atualizações na inicialização Idioma Commits do Histórico Exibir data do autor em vez da data do commit no gráfico Comprimento do Guia de Assunto - GERAL + GIT Habilitar Auto CRLF Diretório de Clone Padrão - Email global do usuário git Email do Usuário - Git (>= 2.23.0) é necessário para este aplicativo + Email global do usuário git Caminho de Instalação - Nome global do usuário git Nome do Usuário + Nome global do usuário git Versão do Git - GIT - Assinatura GPG de commit - Formato GPG - Insira o caminho para o programa gpg instalado - Caminho de Instalação do Programa - Assinatura GPG de tag - Chave de assinatura gpg do usuário - Chave de Assinatura do Usuário + Git (>= 2.23.0) é necessário para este aplicativo ASSINATURA GPG + Assinatura GPG de commit + Assinatura GPG de tag + Formato GPG + Caminho de Instalação do Programa + Insira o caminho para o programa gpg instalado + Chave de Assinatura do Usuário + Chave de assinatura gpg do usuário INTEGRAÇÃO - Caminho - Shell/Terminal SHELL/TERMINAL - Preferências - Alvo: + Shell/Terminal + Caminho Prunar Remoto - Podar informações de worktree em `$GIT_DIR/worktrees` + Alvo: Podar Worktrees + Podar informações de worktree em `$GIT_DIR/worktrees` + Puxar Branch: Buscar todos os branches Para: + Alterações Locais: Descartar Não Fazer Nada Guardar & Reaplicar - Alterações Locais: Buscar sem tags Remoto: Puxar (Buscar & Mesclar) Usar rebase em vez de merge - Puxar + Empurrar Certifica de que submodules foram enviadas Forçar push Branch Local: @@ -524,36 +526,35 @@ Branch Remoto: Definir como branch de rastreamento Empurrar todas as tags - Empurrar + Empurrar Tag para o Remoto Empurrar para todos os remotos Remoto: Tag: - Empurrar Tag para o Remoto Sair + Rebase da Branch Atual Guardar & reaplicar alterações locais Em: Rebase: - Rebase da Branch Atual Atualizar Adicionar Remoto Editar Remoto - Nome do remoto Nome: - URL do repositório git remoto + Nome do remoto URL do Repositório: + URL do repositório git remoto Copiar URL Excluir... Editar... Buscar Abrir no Navegador Podar + Confirmar Remoção de Worktree Habilitar Opção `--force` Alvo: - Confirmar Remoção de Worktree - Nome único para este branch - Novo Nome: - Branch: Renomear Branch + Novo Nome: + Nome único para este branch + Branch: ABORTAR Buscando automaticamente mudanças dos remotos... Limpar (GC & Podar) @@ -566,109 +567,115 @@ Habilitar opção '--reflog' Abrir no Navegador de Arquivos Pesquisar Branches/Tags/Submódulos - FILTRADO POR: - Habilitar opção '--first-parent' + Desfazer + Esconder no gráfico de commit + Incluir no gráfico de commit + Alternar Modo de Ordenação + Data do Commit (--date-order) + Topologicamente (--topo-order) BRANCHES LOCAIS Navegar para HEAD + Habilitar opção '--first-parent' Criar Branch Abrir em {0} Abrir em Ferramentas Externas Atualizar - ADICIONAR REMOTO REMOTOS - RESOLVER + ADICIONAR REMOTO + Pesquisar Commit Arquivo Mensagem SHA Autor & Committer Branch Atual - Pesquisar Commit Exibir Tags como Árvore Estatísticas + SUBMÓDULOS ADICIONAR SUBMÓDULO ATUALIZAR SUBMÓDULO - SUBMÓDULOS - NOVA TAG TAGS + NOVA TAG Abrir no Terminal + WORKTREES ADICIONAR WORKTREE PODAR - WORKTREES URL do Repositório Git + Resetar Branch Atual para Revisão Modo de Reset: Mover Para: Branch Atual: - Resetar Branch Atual para Revisão Revelar no Explorador de Arquivos + Reverter Commit Commit: Commitar alterações de reversão - Reverter Commit - Use 'Shift+Enter' para inserir uma nova linha. 'Enter' é a tecla de atalho do botão OK Reescrever Mensagem do Commit + Use 'Shift+Enter' para inserir uma nova linha. 'Enter' é a tecla de atalho do botão OK Executando. Por favor, aguarde... SALVAR Salvar Como... Patch salvo com sucesso! - Diretório Raiz: Escanear Repositórios + Diretório Raiz: + Verificar atualizações... Nova versão deste software disponível: Falha ao verificar atualizações! Baixar Ignorar esta versão Atualização de Software Não há atualizações disponíveis no momento. - Verificar atualizações... + Copiar SHA Squash Commits Squash commits em: - Caminho para a chave SSH privada Chave SSH Privada: + Caminho para a chave SSH privada INICIAR + Stash Incluir arquivos não rastreados Manter arquivos em stage - Opcional. Nome deste stash Mensagem: + Opcional. Nome deste stash Apenas mudanças em stage Tanto mudanças em stage e fora de stage dos arquivos selecionados serão enviadas para stash!!! Guardar Alterações Locais - Stash Aplicar Descartar Pop - Descartar: Descartar Stash + Descartar: + Stashes ALTERAÇÕES STASHES - Stashes + Estatísticas COMMITS COMMITTER - VISÃO GERAL MÊS SEMANA - AUTORES: COMMITS: - Estatísticas + AUTORES: + VISÃO GERAL + SUBMÓDULOS Adicionar Submódulo Copiar Caminho Relativo Buscar submódulos aninhados Abrir Repositório do Submódulo - Pasta relativa para armazenar este módulo. Caminho Relativo: + Pasta relativa para armazenar este módulo. Excluir Submódulo - SUBMÓDULOS OK Copiar Nome da Tag Copiar mensage da Tag Excluir ${0}$... Mesclar ${0}$ em ${1}$... Enviar ${0}$... + URL: + Atualizar Submódulos Todos os submódulos Inicializar conforme necessário Recursivamente Submódulo: Usar opção --remote - Atualizar Submódulos - URL: Aviso + Página de Boas-vindas Criar Grupo Raíz Criar Subgrupo Clonar Repositório @@ -682,12 +689,12 @@ Reescanear Repositórios no Diretório de Clone Padrão Buscar Repositórios... Ordenar - Página de Boas-vindas + Alterações + Git Ignore Ignorar todos os arquivos *{0} Ignorar arquivos *{0} na mesma pasta Ignorar arquivos na mesma pasta Ignorar apenas este arquivo - Git Ignore Corrigir Você pode stagear este arquivo agora. COMMIT @@ -696,26 +703,25 @@ Acionar evento de clique Preparar todas as mudanças e commitar Commit vazio detectado! Deseja continuar (--allow-empty)? - CONFLITOS DE ARQUIVO RESOLVIDOS CONFLITOS DETECTADOS + CONFLITOS DE ARQUIVO RESOLVIDOS INCLUIR ARQUIVOS NÃO RASTREADOS SEM MENSAGENS DE ENTRADA RECENTES SEM MODELOS DE COMMIT - Clique com o botão direito nos arquivos selecionados e escolha como resolver conflitos. + STAGED UNSTAGE UNSTAGE TODOS - STAGED UNSTAGED STAGE STAGE TODOS VER SUPOR NÃO ALTERADO Template: ${0}$ - Alterações - Configurar workspaces... + Clique com o botão direito nos arquivos selecionados e escolha como resolver conflitos. Workspaces: + Configurar workspaces... + WORKTREE Copiar Caminho Bloquear Remover Desbloquear - WORKTREE diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index ac94ee77..76142274 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -62,7 +62,7 @@ Поток Git - Завершение ${0}$ Слить ${0}$ в ${1}$... Забрать ${0}$ - Перетащить ${0}$ в ${1}$... + Забрать ${0}$ в ${1}$... Выложить ${0}$ Переместить ${0}$ на ${1}$... Переименовать ${0}$... @@ -124,10 +124,12 @@ Найти изменения.... ФАЙЛЫ Файл ХБФ + Поиск файлов... Подмодуль ИНФОРМАЦИЯ АВТОР ИЗМЕНЁННЫЙ + ДОЧЕРНИЙ ИСПОЛНИТЕЛЬ Проверить ссылки, содержащие эту фиксацию ФИКСАЦИЯ СОДЕРЖИТСЯ В @@ -170,8 +172,8 @@ Адрес результата: Пожалуйста, используйте $1, $2 для доступа к значениям групп регулярных выражений. ОТКРЫТЬ ИИ - Предпочитаемый сервис: - Если «Предпочитаемый сервис» установлен, SourceGit будет использовать только этот хранилище. В противном случае, если доступно более одной услуги, будет отображено контекстное меню для выбора одной из них. + Предпочитаемый сервис: + Если «Предпочитаемый сервис» установлен, SourceGit будет использовать только этот хранилище. В противном случае, если доступно более одной услуги, будет отображено контекстное меню для выбора одной из них. HTTP-прокси HTTP-прокси, используемый этим хранилищем Имя пользователя @@ -213,7 +215,7 @@ Вид: Аннотированный Лёгкий - Удерживайте Ctrl, чтобы начать непосредственно + Удерживайте Ctrl, чтобы начать сразу Вырезать Удалить ветку Ветка: @@ -249,6 +251,7 @@ Обмен Подсветка синтаксиса Перенос слов в строке + Разрешить навигацию по блокам Открыть в инструменте слияния Показывать все линии Уменьшить количество видимых линий @@ -271,6 +274,7 @@ Быстрая перемотка вперёд (без проверки) Извлечь Извлечь все внешние хранилища + Разрешить опцию '--force' Извлечь без меток Внешнее хранилище: Извлечь внешние изменения @@ -293,7 +297,6 @@ История файлов СОДЕРЖИМОЕ ИЗМЕНИТЬ - ФИЛЬТР Git-поток Ветка разработчика: Свойство: @@ -369,11 +372,11 @@ Подготовить все изменения и зафиксировать Создать новую ветку на основе выбранной ветки Отклонить выбранные изменения - Извлечение, запускается непосредственно + Извлечение, запускается сразу Режим доски (по-умолчанию) Принудительно перезагрузить этот хранилище - Забрать, запускается непосредственно - Выложить, запускается непосредственно + Забрать, запускается сразу + Выложить, запускается сразу Подготовленные/Неподготовленные выбранные изменения Режим поиска фиксаций Переключить на «Изменения» @@ -389,10 +392,10 @@ Отклонить Инициализировать хранилище Путь: - Выполняется частичный забор. Нажмите «Отказ» для восстановления заголовка. - Выполняет запрос слияния. Нажмите «Отказ» для восстановления заголовка. - Выполняется перенос. Нажмите «Отказ» для восстановления заголовка. - Выполняется возврат. Нажмите «Отказ» для восстановления заголовка. + Выполняется частичный забор. + Выполняет запрос слияния. + Выполняется перенос. + Выполняется возврат. Интерактивное перемещение Целевая ветка: На: @@ -403,7 +406,6 @@ Слить ветку В: Опции слияния: - Исходная ветка: Переместить узел хранилища Выбрать родительский узел для: Имя: @@ -456,6 +458,7 @@ Язык История фиксаций Показывать время автора вместо времени фиксации на графике + Показать наследника в деталях комментария Длина темы фиксации GIT Включить автозавершение CRLF @@ -545,7 +548,14 @@ Разрешить опцию --reflog Открыть в файловом менеджере Поиск веток, меток и подмодулей - ОТФИЛЬТРОВАНО: + Видимость на графике + Не установлен (По-умолчанию) + Скрыть в графе фиксации + Фильтр в графе фиксации + ОТФИЛЬТРОВАНО: + Переключить режим запроса + Дата фиксации (--date-order) + Топологически (--topo-order) ЛОКАЛЬНЫЕ ВЕТКИ Навигация по заголовку Включить опцию --first-parent @@ -555,7 +565,6 @@ Обновить ВНЕШНИЕ ХРАНИЛИЩА ДОБАВИТЬ ВНЕШНЕЕ ХРАНИЛИЩЕ - РАЗРЕШИТЬ Поиск фиксации Файл Сообщение @@ -590,6 +599,8 @@ Исправление успешно сохранено! Сканирование хранилищ Корневой каталог: + Копировать SHA + Перейти Проверка для обновления... Доступна новая версия этого программного обеспечения: Не удалось проверить наличие обновлений! @@ -674,6 +685,7 @@ ЗАФИКСИРОВАТЬ и ОТПРАВИТЬ Шаблон/Истории Запустить событие щелчка + Зафиксировать (Редактировать) Подготовить все изменения и зафиксировать Обнаружена пустая фиксация! Вы хотите продолжить (--allow-empty)? ОБНАРУЖЕНЫ КОНФЛИКТЫ diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 5b1f1403..f711cdee 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -61,6 +61,7 @@ 拉取(fetch) ${0}$ 至 ${1}$... GIT工作流 - 完成 ${0}$ 合并 ${0}$ 到 ${1}$... + 合并 {0} 个分支到当前分支 拉回(pull) ${0}$ 拉回(pull) ${0}$ 内容至 ${1}$... 推送(push)${0}$ @@ -113,6 +114,8 @@ 复制提交指纹 自定义操作 交互式变基(rebase -i) ${0}$ 到此处 + 合并(merge)此提交至 ${0}$ + 合并(merge)... 变基(rebase) ${0}$ 到此处 重置(reset) ${0}$ 到此处 回滚此提交 @@ -124,10 +127,12 @@ 查找变更... 文件列表 LFS文件 + 查找文件... 子模块 基本信息 修改者 变更列表 + 子提交 提交者 查看包含此提交的分支/标签 本提交已被以下分支/标签包含 @@ -170,8 +175,8 @@ 为ISSUE生成的URL链接 : 可在URL中使用$1,$2等变量填入正则表达式匹配的内容 AI - 启用特定服务 : - 当【启用特定服务】被设置时,SourceGit将在本仓库中仅使用该服务。否则将弹出可用的AI服务列表供用户选择。 + 启用特定服务 : + 当【启用特定服务】被设置时,SourceGit将在本仓库中仅使用该服务。否则将弹出可用的AI服务列表供用户选择。 HTTP代理 HTTP网络代理 用户名 @@ -248,6 +253,7 @@ 交换比对双方 语法高亮 自动换行 + 启用基于变更块的跳转 使用外部合并工具查看 显示完整文件 减少可见的行数 @@ -270,6 +276,7 @@ 快进(fast-forward,无需checkout) 拉取(fetch) 拉取所有的远程仓库 + 启用 --force 选项 不拉取远程标签 远程仓库 : 拉取远程仓库内容 @@ -278,6 +285,7 @@ 放弃 {0} 个文件的更改... 放弃选中的更改 使用外部合并工具打开 + 应用 ${0}$ 另存为补丁... 暂存(add) 暂存(add){0} 个文件 @@ -292,7 +300,6 @@ 文件历史 文件内容 文件变更 - 过滤 GIT工作流 开发分支 : 特性分支 : @@ -357,6 +364,7 @@ 快捷键参考 全局快捷键 取消弹出面板 + 克隆远程仓库 关闭当前页面 切换到上一个页面 切换到下一个页面 @@ -388,10 +396,14 @@ 丢弃 初始化新仓库 路径 : - 挑选(Cherry-Pick)操作进行中。点击【终止】回滚到操作前的状态。 - 合并操作进行中。点击【终止】回滚到操作前的状态。 - 变基(Rebase)操作进行中。点击【终止】回滚到操作前的状态。 - 回滚提交操作进行中。点击【终止】回滚到操作前的状态。 + 挑选(Cherry-Pick)操作进行中。 + 正在处理提交 + 合并操作进行中。 + 正在处理 + 变基(Rebase)操作进行中。 + 当前停止于 + 回滚提交操作进行中。 + 正在回滚提交 交互式变基 目标分支 : 起始提交 : @@ -402,7 +414,11 @@ 合并分支 目标分支 : 合并方式 : - 合并分支 : + 合并目标 : + 合并(多目标) + 提交变化 + 合并策略 : + 目标列表 : 调整仓库分组 请选择目标分组: 名称 : @@ -456,6 +472,7 @@ 显示语言 最大历史提交数 在提交路线图中显示修改时间而非提交时间 + 在提交详情页中显示子提交列表 SUBJECT字数检测 GIT配置 自动换行转换 @@ -545,7 +562,13 @@ 启用 --reflog 选项 在文件浏览器中打开 快速查找分支/标签/子模块 - 过滤规则 : + 设置在列表中的可见性 + 不指定 + 在提交列表中隐藏 + 使用其对提交列表过滤 + 切换排序模式 + 按提交时间 (--date-order) + 按拓扑排序 (--topo-order) 本地分支 定位HEAD 启用 --first-parent 过滤选项 @@ -555,7 +578,6 @@ 重新加载 远程列表 添加远程 - 解决冲突 查找提交 文件 提交信息 @@ -563,6 +585,7 @@ 作者及提交者 仅在当前分支中查找 以树型结构展示 + 跳过此提交 提交统计 子模块列表 添加子模块 @@ -597,6 +620,8 @@ 忽略此版本 软件更新 当前已是最新版本。 + 复制提交指纹 + 跳转到提交 压缩为单个提交 合并入: SSH密钥 : @@ -674,6 +699,7 @@ 提交并推送 历史输入/模板 触发点击事件 + 提交(修改原始提交) 自动暂存所有变更并提交 提交未包含变更文件!是否继续(--allow-empty)? 检测到冲突 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 0587f089..90444967 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -61,6 +61,7 @@ 提取 (fetch) ${0}$ 到 ${1}$... Git 工作流 - 完成 ${0}$ 合併 ${0}$ 到 ${1}$... + 合併 {0} 個分支到目前分支 拉取 (pull) ${0}$ 拉取 (pull) ${0}$ 內容至 ${1}$... 推送 (push) ${0}$ @@ -113,6 +114,8 @@ 複製提交編號 自訂動作 互動式重定基底 (rebase -i) ${0}$ 到此處 + 合併 (merge) 此提交到 ${0}$ + 合併 (merge)... 重定基底 (rebase) ${0}$ 到此處 重設 (reset) ${0}$ 到此處 復原此提交 @@ -124,10 +127,12 @@ 搜尋變更... 檔案列表 LFS 檔案 + 搜尋檔案... 子模組 基本資訊 作者 變更列表 + 後續提交 提交者 檢視包含此提交的分支或標籤 本提交包含於以下分支或標籤 @@ -170,8 +175,8 @@ 為 Issue 產生的網址連結: 可在網址中使用 $1、$2 等變數填入正規表達式相符的內容 AI - 偏好服務: - 設定 [偏好服務] 後,SourceGit 將於此存放庫中使用該服務,否則會顯示 AI 服務列表供使用者選擇。 + 偏好服務: + 設定 [偏好服務] 後,SourceGit 將於此存放庫中使用該服務,否則會顯示 AI 服務列表供使用者選擇。 HTTP 代理 HTTP 網路代理 使用者名稱 @@ -240,7 +245,7 @@ 下一個差異 沒有變更或僅有換行字元差異 上一個差異 - 另存為修補檔 + 另存為修補檔 (patch) 顯示隱藏符號 並排對比 子模組 @@ -248,6 +253,7 @@ 交換比對雙方 語法上色 自動換行 + 啟用基於變更區塊的導航 使用外部合併工具檢視 顯示檔案的全部內容 減少可見的行數 @@ -270,6 +276,7 @@ 快進 (fast-forward,無需 checkout) 提取 (fetch) 提取所有的遠端存放庫 + 啟用 [--force] 選項 不提取遠端標籤 遠端存放庫: 提取遠端存放庫內容 @@ -278,6 +285,7 @@ 捨棄已選的 {0} 個檔案變更... 捨棄選取的變更 使用外部合併工具開啟 + 使用 ${0}$ 另存為修補檔 (patch)... 暫存 (add) 暫存 (add) 已選的 {0} 個檔案 @@ -292,7 +300,6 @@ 檔案歷史 檔案内容 檔案變更 - 篩選 Git 工作流 開發分支: 功能分支: @@ -357,6 +364,7 @@ 快速鍵參考 全域快速鍵 取消彈出面板 + 複製 (clone) 遠端存放庫 關閉目前頁面 切換到上一個頁面 切換到下一個頁面 @@ -366,12 +374,12 @@ 提交暫存區變更 提交暫存區變更並推送 自動暫存全部變更並提交 - 根據選取的提交建立新的分支 + 基於選取的提交建立新分支 捨棄選取的變更 提取 (fetch) 遠端的變更 切換左邊欄為分支/標籤等顯示模式 (預設) 拉取 (pull) 遠端的變更 - 推送 (push) 本地變更到遠端存放庫 + 推送 (push) 本機變更到遠端存放庫 強制重新載入存放庫 暫存或取消暫存選取的變更 切換左邊欄為歷史搜尋模式 @@ -388,21 +396,29 @@ 捨棄 初始化存放庫 路徑: - 揀選 (cherry-pick) 操作進行中。點選 [中止] 復原到操作前的狀態。 - 合併操作進行中。點選 [中止] 復原到操作前的狀態。 - 重定基底 (rebase) 操作進行中。點選 [中止] 復原到操作前的狀態。 - 復原提交操作進行中。點選 [中止] 復原到操作前的狀態。 + 揀選 (cherry-pick) 操作進行中。 + 正在處理提交 + 合併操作進行中。 + 正在處理 + 重定基底 (rebase) 操作進行中。 + 当前停止于 + 復原提交操作進行中。 + 正在復原提交 互動式重定基底 目標分支: 起始提交: - 在瀏覽器中存取網址 - 複製網址 + 在瀏覽器中開啟連結 + 複製連結 發生錯誤 系統提示 合併分支 目標分支: 合併方式: - 合併分支: + 合併目標: + 合併(多目標) + 提交變更 + 合併策略: + 目標列表: 調整存放庫分組 請選擇目標分組: 名稱: @@ -455,6 +471,7 @@ 顯示語言 最大歷史提交數 在提交路線圖中顯示修改時間而非提交時間 + 在提交詳細資訊中顯示後續提交 提交標題字數偵測 Git 設定 自動換行轉換 @@ -544,7 +561,13 @@ 啟用 [--reflog] 選項 在檔案瀏覽器中開啟 快速搜尋分支/標籤/子模組 - 篩選規則: + 篩選以顯示或隱藏 + 取消指定 + 在提交列表中隱藏 + 以其篩選提交列表 + 切換排序方式 + 依提交時間排序 (--date-order) + 依拓撲排序 (--topo-order) 本機分支 回到 HEAD 啟用 [--first-parent] 選項 @@ -554,7 +577,6 @@ 重新載入 遠端列表 新增遠端 - 解決衝突 搜尋提交 檔案 提交訊息 @@ -562,6 +584,7 @@ 作者及提交者 僅搜尋目前分支 以樹型結構展示 + 跳過此提交 提交統計 子模組列表 新增子模組 @@ -596,6 +619,8 @@ 忽略此版本 軟體更新 目前已是最新版本。 + 複製提交編號 + 前往此提交 壓縮為單個提交 合併入: SSH 金鑰: @@ -673,6 +698,7 @@ 提交並推送 歷史輸入/範本 觸發點擊事件 + 提交(修改現有提交) 自動暫存全部變更並提交 未包含任何檔案變更! 您是否仍要提交 (--allow-empty)? 檢測到衝突 diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index 50f4d830..2cc09e39 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -164,16 +164,18 @@ + + + + + + + + + - - - - + + @@ -67,15 +71,10 @@ Foreground="{DynamicResource Brush.BadgeFG}" Background="{DynamicResource Brush.Badge}"/> - - + + diff --git a/src/Views/BranchTree.axaml.cs b/src/Views/BranchTree.axaml.cs index e96b2594..d9588a0f 100644 --- a/src/Views/BranchTree.axaml.cs +++ b/src/Views/BranchTree.axaml.cs @@ -405,6 +405,17 @@ namespace SourceGit.Views ev.Handled = true; }; menu.Items.Add(deleteMulti); + + var mergeMulti = new MenuItem(); + mergeMulti.Header = App.Text("BranchCM.MergeMultiBranches", branches.Count); + mergeMulti.Icon = App.CreateMenuIcon("Icons.Merge"); + mergeMulti.Click += (_, ev) => + { + repo.MergeMultipleBranches(branches); + ev.Handled = true; + }; + menu.Items.Add(mergeMulti); + menu?.Open(this); } } @@ -428,28 +439,6 @@ namespace SourceGit.Views } } - private void OnToggleFilterClicked(object sender, RoutedEventArgs e) - { - if (DataContext is ViewModels.Repository repo && - sender is ToggleButton toggle && - toggle.DataContext is ViewModels.BranchTreeNode { Backend: Models.Branch branch } node) - { - bool filtered = toggle.IsChecked == true; - List filters = [branch.FullName]; - if (branch.IsLocal && !string.IsNullOrEmpty(branch.Upstream)) - { - filters.Add(branch.Upstream); - - node.IsFiltered = filtered; - UpdateUpstreamFilterState(repo.RemoteBranchTrees, branch.Upstream, filtered); - } - - repo.UpdateFilters(filters, filtered); - } - - e.Handled = true; - } - private void MakeRows(List rows, List nodes, int depth) { foreach (var node in nodes) @@ -477,23 +466,6 @@ namespace SourceGit.Views CollectBranchesInNode(outs, sub); } - private bool UpdateUpstreamFilterState(List collection, string upstream, bool isFiltered) - { - foreach (var node in collection) - { - if (node.Backend is Models.Branch b && b.FullName == upstream) - { - node.IsFiltered = isFiltered; - return true; - } - - if (node.Backend is Models.Remote r && upstream.StartsWith($"refs/remotes/{r.Name}/", StringComparison.Ordinal)) - return UpdateUpstreamFilterState(node.Children, upstream, isFiltered); - } - - return false; - } - private bool _disableSelectionChangingEvent = false; } } diff --git a/src/Views/Checkout.axaml b/src/Views/Checkout.axaml index eaf2e79e..eb1c9de0 100644 --- a/src/Views/Checkout.axaml +++ b/src/Views/Checkout.axaml @@ -32,22 +32,21 @@ HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,8,0" Text="{DynamicResource Text.Checkout.LocalChanges}"/> - - - - - + + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> diff --git a/src/Views/Checkout.axaml.cs b/src/Views/Checkout.axaml.cs index f8398a1d..da6e6b31 100644 --- a/src/Views/Checkout.axaml.cs +++ b/src/Views/Checkout.axaml.cs @@ -1,4 +1,5 @@ using Avalonia.Controls; +using Avalonia.Interactivity; namespace SourceGit.Views { @@ -8,5 +9,51 @@ namespace SourceGit.Views { InitializeComponent(); } + + protected override void OnLoaded(RoutedEventArgs e) + { + base.OnLoaded(e); + + var vm = DataContext as ViewModels.Checkout; + if (vm == null) + return; + + switch (vm.PreAction) + { + case Models.DealWithLocalChanges.DoNothing: + RadioDoNothing.IsChecked = true; + break; + case Models.DealWithLocalChanges.StashAndReaply: + RadioStashAndReply.IsChecked = true; + break; + default: + RadioDiscard.IsChecked = true; + break; + } + } + + private void OnLocalChangeActionIsCheckedChanged(object sender, RoutedEventArgs e) + { + var vm = DataContext as ViewModels.Checkout; + if (vm == null) + return; + + if (RadioDoNothing.IsChecked == true) + { + if (vm.PreAction != Models.DealWithLocalChanges.DoNothing) + vm.PreAction = Models.DealWithLocalChanges.DoNothing; + return; + } + + if (RadioStashAndReply.IsChecked == true) + { + if (vm.PreAction != Models.DealWithLocalChanges.StashAndReaply) + vm.PreAction = Models.DealWithLocalChanges.StashAndReaply; + return; + } + + if (vm.PreAction != Models.DealWithLocalChanges.Discard) + vm.PreAction = Models.DealWithLocalChanges.Discard; + } } } diff --git a/src/Views/CheckoutCommit.axaml b/src/Views/CheckoutCommit.axaml index 37021565..3ee3943f 100644 --- a/src/Views/CheckoutCommit.axaml +++ b/src/Views/CheckoutCommit.axaml @@ -18,7 +18,7 @@ Margin="0,0,8,0" Text="{DynamicResource Text.Checkout.Commit.Target}" /> - + diff --git a/src/Views/CherryPick.axaml b/src/Views/CherryPick.axaml index 1ba62ff7..779a0414 100644 --- a/src/Views/CherryPick.axaml +++ b/src/Views/CherryPick.axaml @@ -44,7 +44,7 @@ - + diff --git a/src/Views/CommitBaseInfo.axaml b/src/Views/CommitBaseInfo.axaml index 76ea0227..7b498b10 100644 --- a/src/Views/CommitBaseInfo.axaml +++ b/src/Views/CommitBaseInfo.axaml @@ -51,10 +51,10 @@ - + - - + + - - - - @@ -101,7 +95,7 @@ - + @@ -117,14 +111,68 @@ TextDecorations="Underline" Cursor="Hand" Margin="0,0,16,0" - PointerPressed="OnSHAPressed"/> + PointerEntered="OnSHAPointerEntered" + PointerPressed="OnSHAPressed" + ToolTip.ShowDelay="0"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - - + TextWrapping="Wrap"> + + + + + + + + + + + + + diff --git a/src/Views/CommitBaseInfo.axaml.cs b/src/Views/CommitBaseInfo.axaml.cs index 228fbe8e..0b4c1f2d 100644 --- a/src/Views/CommitBaseInfo.axaml.cs +++ b/src/Views/CommitBaseInfo.axaml.cs @@ -1,3 +1,5 @@ +using System.Threading.Tasks; + using Avalonia; using Avalonia.Collections; using Avalonia.Controls; @@ -53,6 +55,15 @@ namespace SourceGit.Views set => SetValue(IssueTrackerRulesProperty, value); } + public static readonly StyledProperty> ChildrenProperty = + AvaloniaProperty.Register>(nameof(Children)); + + public AvaloniaList Children + { + get => GetValue(ChildrenProperty); + set => SetValue(ChildrenProperty, value); + } + public CommitBaseInfo() { InitializeComponent(); @@ -88,7 +99,7 @@ namespace SourceGit.Views menu.Items.Add(item); } - menu?.Open(control); + menu.Open(control); } else if (links.Count == 1) { @@ -113,9 +124,32 @@ namespace SourceGit.Views e.Handled = true; } + private async void OnSHAPointerEntered(object sender, PointerEventArgs e) + { + if (DataContext is ViewModels.CommitDetail detail && sender is Control { DataContext: string sha } ctl) + { + var tooltip = ToolTip.GetTip(ctl); + if (tooltip is Models.Commit commit && commit.SHA == sha) + return; + + var c = await Task.Run(() => detail.GetParent(sha)); + if (c != null && ctl.IsVisible && ctl.DataContext is string newSHA && newSHA == sha) + { + ToolTip.SetTip(ctl, c); + + if (ctl.IsPointerOver) + ToolTip.SetIsOpen(ctl, true); + } + } + + e.Handled = true; + } + private void OnSHAPressed(object sender, PointerPressedEventArgs e) { - if (DataContext is ViewModels.CommitDetail detail && sender is Control { DataContext: string sha }) + var point = e.GetCurrentPoint(this); + + if (point.Properties.IsLeftButtonPressed && DataContext is ViewModels.CommitDetail detail && sender is Control { DataContext: string sha }) { detail.NavigateTo(sha); } diff --git a/src/Views/CommitDetail.axaml b/src/Views/CommitDetail.axaml index cb99b3d9..4c6fd5dc 100644 --- a/src/Views/CommitDetail.axaml +++ b/src/Views/CommitDetail.axaml @@ -24,6 +24,7 @@ SignInfo="{Binding SignInfo}" SupportsContainsIn="True" WebLinks="{Binding WebLinks}" + Children="{Binding Children}" IssueTrackerRules="{Binding IssueTrackerRules}"/> diff --git a/src/Views/CommitMessagePresenter.cs b/src/Views/CommitMessagePresenter.cs index 862ce9e1..a767b395 100644 --- a/src/Views/CommitMessagePresenter.cs +++ b/src/Views/CommitMessagePresenter.cs @@ -1,12 +1,14 @@ using System; using System.Collections.Generic; using System.Text.RegularExpressions; +using System.Threading.Tasks; using Avalonia; using Avalonia.Collections; using Avalonia.Controls; using Avalonia.Controls.Documents; using Avalonia.Input; +using Avalonia.Threading; using Avalonia.VisualTree; namespace SourceGit.Views @@ -43,7 +45,9 @@ namespace SourceGit.Views if (change.Property == MessageProperty || change.Property == IssueTrackerRulesProperty) { Inlines!.Clear(); + _inlineCommits.Clear(); _matches = null; + _lastHover = null; ClearHoveredIssueLink(); var message = Message; @@ -114,7 +118,7 @@ namespace SourceGit.Views { base.OnPointerMoved(e); - if (e.Pointer.Captured == this) + if (Equals(e.Pointer.Captured, this)) { var relativeSelfY = e.GetPosition(this).Y; if (relativeSelfY <= 0 || relativeSelfY > Bounds.Height) @@ -149,11 +153,15 @@ namespace SourceGit.Views SetCurrentValue(CursorProperty, Cursor.Parse("Hand")); _lastHover = match; - if (!_lastHover.IsCommitSHA) + if (!match.IsCommitSHA) { ToolTip.SetTip(this, match.Link); ToolTip.SetIsOpen(this, true); } + else + { + ProcessHoverCommitLink(match); + } return; } @@ -172,7 +180,40 @@ namespace SourceGit.Views { var parentView = this.FindAncestorOfType(); if (parentView is { DataContext: ViewModels.CommitDetail detail }) - detail.NavigateTo(_lastHover.Link); + { + var point = e.GetCurrentPoint(this); + var link = _lastHover.Link; + + if (point.Properties.IsLeftButtonPressed) + { + detail.NavigateTo(_lastHover.Link); + } + else if (point.Properties.IsRightButtonPressed) + { + var open = new MenuItem(); + open.Header = App.Text("SHALinkCM.NavigateTo"); + open.Icon = App.CreateMenuIcon("Icons.Commit"); + open.Click += (_, ev) => + { + detail.NavigateTo(link); + ev.Handled = true; + }; + + var copy = new MenuItem(); + copy.Header = App.Text("SHALinkCM.CopySHA"); + copy.Icon = App.CreateMenuIcon("Icons.Copy"); + copy.Click += (_, ev) => + { + App.CopyText(link); + ev.Handled = true; + }; + + var menu = new ContextMenu(); + menu.Items.Add(open); + menu.Items.Add(copy); + menu.Open(this); + } + } } else { @@ -223,6 +264,53 @@ namespace SourceGit.Views ClearHoveredIssueLink(); } + private void ProcessHoverCommitLink(Models.Hyperlink link) + { + var sha = link.Link; + + // If we have already queried this SHA, just use it. + if (_inlineCommits.TryGetValue(sha, out var exist)) + { + if (exist != null) + { + ToolTip.SetTip(this, exist); + ToolTip.SetIsOpen(this, true); + } + + return; + } + + var parentView = this.FindAncestorOfType(); + if (parentView is { DataContext: ViewModels.CommitDetail detail }) + { + // Record the SHA of current viewing commit in the CommitDetail panel to determine if it is changed after + // asynchronous queries. + var lastDetailCommit = detail.Commit.SHA; + Task.Run(() => + { + var c = detail.GetParent(sha); + Dispatcher.UIThread.Invoke(() => + { + // Make sure the DataContext of CommitBaseInfo is not changed. + var currentParent = this.FindAncestorOfType(); + if (currentParent is { DataContext: ViewModels.CommitDetail currentDetail } && + currentDetail.Commit.SHA == lastDetailCommit) + { + if (!_inlineCommits.ContainsKey(sha)) + _inlineCommits.Add(sha, c); + + // Make sure user still hovers the target SHA. + if (_lastHover == link && c != null) + { + ToolTip.SetTip(this, c); + ToolTip.SetIsOpen(this, true); + } + } + }); + }); + } + } + private void ClearHoveredIssueLink() { if (_lastHover != null) @@ -235,5 +323,6 @@ namespace SourceGit.Views private List _matches = null; private Models.Hyperlink _lastHover = null; + private Dictionary _inlineCommits = new(); } } diff --git a/src/Views/CommitMessageTextBox.axaml.cs b/src/Views/CommitMessageTextBox.axaml.cs index 91f8c47e..0811d97d 100644 --- a/src/Views/CommitMessageTextBox.axaml.cs +++ b/src/Views/CommitMessageTextBox.axaml.cs @@ -95,7 +95,7 @@ namespace SourceGit.Views if (change.Property == TextProperty && _changingWay == TextChangeWay.None) { _changingWay = TextChangeWay.FromSource; - var normalized = Text.ReplaceLineEndings("\n").Trim(); + var normalized = Text.ReplaceLineEndings("\n"); var subjectEnd = normalized.IndexOf("\n\n", StringComparison.Ordinal); if (subjectEnd == -1) { diff --git a/src/Views/CommitRefsPresenter.cs b/src/Views/CommitRefsPresenter.cs index fc3233a5..e8a66da0 100644 --- a/src/Views/CommitRefsPresenter.cs +++ b/src/Views/CommitRefsPresenter.cs @@ -38,7 +38,7 @@ namespace SourceGit.Views } public static readonly StyledProperty BackgroundProperty = - AvaloniaProperty.Register(nameof(Background), null); + AvaloniaProperty.Register(nameof(Background), Brushes.Transparent); public IBrush Background { @@ -56,7 +56,7 @@ namespace SourceGit.Views } public static readonly StyledProperty UseGraphColorProperty = - AvaloniaProperty.Register(nameof(UseGraphColor), false); + AvaloniaProperty.Register(nameof(UseGraphColor)); public bool UseGraphColor { @@ -96,7 +96,6 @@ namespace SourceGit.Views var x = 1.0; foreach (var item in _items) { - var iconRect = new RoundedRect(new Rect(x, 0, 16, 16), new CornerRadius(2, 0, 0, 2)); var entireRect = new RoundedRect(new Rect(x, 0, item.Width, 16), new CornerRadius(2)); if (item.IsHead) diff --git a/src/Views/CreateBranch.axaml b/src/Views/CreateBranch.axaml index 3516c317..43f4e50c 100644 --- a/src/Views/CreateBranch.axaml +++ b/src/Views/CreateBranch.axaml @@ -37,7 +37,7 @@ - + @@ -69,21 +69,20 @@ Margin="0,0,8,0" Text="{DynamicResource Text.CreateBranch.LocalChanges}"/> - - - - + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> - + diff --git a/src/Views/DeleteBranch.axaml b/src/Views/DeleteBranch.axaml index b2693bf0..05ec6e26 100644 --- a/src/Views/DeleteBranch.axaml +++ b/src/Views/DeleteBranch.axaml @@ -16,6 +16,18 @@ + + + diff --git a/src/Views/DeleteMultipleBranches.axaml b/src/Views/DeleteMultipleBranches.axaml index 2a888118..cf084e14 100644 --- a/src/Views/DeleteMultipleBranches.axaml +++ b/src/Views/DeleteMultipleBranches.axaml @@ -42,9 +42,22 @@ - + + + + diff --git a/src/Views/DiffView.axaml b/src/Views/DiffView.axaml index 06525abd..6716ed3a 100644 --- a/src/Views/DiffView.axaml +++ b/src/Views/DiffView.axaml @@ -34,8 +34,43 @@ + + + + + + + + + + + + + + + + + + + @@ -81,9 +113,7 @@ @@ -97,14 +127,14 @@ @@ -112,16 +142,14 @@ - @@ -230,9 +258,10 @@ - + UseBlockNavigation="{Binding Source={x:Static vm:Preference.Instance}, Path=UseBlockNavigationInDiffView, Mode=OneWay}" + BlockNavigationIndicator="{Binding #BlockNavigationIndicator.Text, Mode=OneWayToSource}"/> diff --git a/src/Views/DiffView.axaml.cs b/src/Views/DiffView.axaml.cs index 860627d3..d9157a03 100644 --- a/src/Views/DiffView.axaml.cs +++ b/src/Views/DiffView.axaml.cs @@ -1,4 +1,6 @@ using Avalonia.Controls; +using Avalonia.Interactivity; +using Avalonia.VisualTree; namespace SourceGit.Views { @@ -8,5 +10,19 @@ namespace SourceGit.Views { InitializeComponent(); } + + private void OnGotoPrevChange(object _, RoutedEventArgs e) + { + var textDiff = this.FindDescendantOfType(); + textDiff?.GotoPrevChange(); + e.Handled = true; + } + + private void OnGotoNextChange(object _, RoutedEventArgs e) + { + var textDiff = this.FindDescendantOfType(); + textDiff?.GotoNextChange(); + e.Handled = true; + } } } diff --git a/src/Views/Fetch.axaml b/src/Views/Fetch.axaml index a9c2fd90..f9380ab0 100644 --- a/src/Views/Fetch.axaml +++ b/src/Views/Fetch.axaml @@ -11,7 +11,7 @@ - + + + - diff --git a/src/Views/FileHistories.axaml b/src/Views/FileHistories.axaml index 703957b8..8403ae73 100644 --- a/src/Views/FileHistories.axaml +++ b/src/Views/FileHistories.axaml @@ -80,7 +80,7 @@ - + + + diff --git a/src/Views/FilterModeSwitchButton.axaml.cs b/src/Views/FilterModeSwitchButton.axaml.cs new file mode 100644 index 00000000..f68e9166 --- /dev/null +++ b/src/Views/FilterModeSwitchButton.axaml.cs @@ -0,0 +1,167 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Interactivity; +using Avalonia.VisualTree; + +namespace SourceGit.Views +{ + public partial class FilterModeSwitchButton : UserControl + { + public static readonly StyledProperty ModeProperty = + AvaloniaProperty.Register(nameof(Mode)); + + public Models.FilterMode Mode + { + get => GetValue(ModeProperty); + set => SetValue(ModeProperty, value); + } + + public static readonly StyledProperty IsNoneVisibleProperty = + AvaloniaProperty.Register(nameof(IsNoneVisible)); + + public bool IsNoneVisible + { + get => GetValue(IsNoneVisibleProperty); + set => SetValue(IsNoneVisibleProperty, value); + } + + public static readonly StyledProperty IsContextMenuOpeningProperty = + AvaloniaProperty.Register(nameof(IsContextMenuOpening)); + + public bool IsContextMenuOpening + { + get => GetValue(IsContextMenuOpeningProperty); + set => SetValue(IsContextMenuOpeningProperty, value); + } + + public FilterModeSwitchButton() + { + IsVisible = false; + InitializeComponent(); + } + + protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) + { + base.OnPropertyChanged(change); + + if (change.Property == ModeProperty || + change.Property == IsNoneVisibleProperty || + change.Property == IsContextMenuOpeningProperty) + { + var visible = (Mode != Models.FilterMode.None || IsNoneVisible || IsContextMenuOpening); + SetCurrentValue(IsVisibleProperty, visible); + } + } + + private void OnChangeFilterModeButtonClicked(object sender, RoutedEventArgs e) + { + var repoView = this.FindAncestorOfType(); + if (repoView == null) + return; + + var repo = repoView.DataContext as ViewModels.Repository; + if (repo == null) + return; + + var button = sender as Button; + if (button == null) + return; + + var menu = new ContextMenu(); + var mode = Models.FilterMode.None; + if (DataContext is Models.Tag tag) + { + mode = tag.FilterMode; + + if (mode != Models.FilterMode.None) + { + var unset = new MenuItem(); + unset.Header = App.Text("Repository.FilterCommits.Default"); + unset.Click += (_, ev) => + { + repo.SetTagFilterMode(tag, Models.FilterMode.None); + ev.Handled = true; + }; + + menu.Items.Add(unset); + menu.Items.Add(new MenuItem() { Header = "-" }); + } + + var include = new MenuItem(); + include.Icon = App.CreateMenuIcon("Icons.Filter"); + include.Header = App.Text("Repository.FilterCommits.Include"); + include.IsEnabled = mode != Models.FilterMode.Included; + include.Click += (_, ev) => + { + repo.SetTagFilterMode(tag, Models.FilterMode.Included); + ev.Handled = true; + }; + + var exclude = new MenuItem(); + exclude.Icon = App.CreateMenuIcon("Icons.EyeClose"); + exclude.Header = App.Text("Repository.FilterCommits.Exclude"); + exclude.IsEnabled = mode != Models.FilterMode.Excluded; + exclude.Click += (_, ev) => + { + repo.SetTagFilterMode(tag, Models.FilterMode.Excluded); + ev.Handled = true; + }; + + menu.Items.Add(include); + menu.Items.Add(exclude); + } + else if (DataContext is ViewModels.BranchTreeNode node) + { + mode = node.FilterMode; + + if (mode != Models.FilterMode.None) + { + var unset = new MenuItem(); + unset.Header = App.Text("Repository.FilterCommits.Default"); + unset.Click += (_, ev) => + { + repo.SetBranchFilterMode(node, Models.FilterMode.None); + ev.Handled = true; + }; + + menu.Items.Add(unset); + menu.Items.Add(new MenuItem() { Header = "-" }); + } + + var include = new MenuItem(); + include.Icon = App.CreateMenuIcon("Icons.Filter"); + include.Header = App.Text("Repository.FilterCommits.Include"); + include.IsEnabled = mode != Models.FilterMode.Included; + include.Click += (_, ev) => + { + repo.SetBranchFilterMode(node, Models.FilterMode.Included); + ev.Handled = true; + }; + + var exclude = new MenuItem(); + exclude.Icon = App.CreateMenuIcon("Icons.EyeClose"); + exclude.Header = App.Text("Repository.FilterCommits.Exclude"); + exclude.IsEnabled = mode != Models.FilterMode.Excluded; + exclude.Click += (_, ev) => + { + repo.SetBranchFilterMode(node, Models.FilterMode.Excluded); + ev.Handled = true; + }; + + menu.Items.Add(include); + menu.Items.Add(exclude); + } + + if (mode == Models.FilterMode.None) + { + IsContextMenuOpening = true; + menu.Closed += (_, _) => IsContextMenuOpening = false; + } + + menu.Open(button); + e.Handled = true; + } + } +} + + diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index 85092b64..fbb907d9 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -430,31 +430,43 @@ namespace SourceGit.Views if (ShowAsDateTime) return DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime().ToString("yyyy/MM/dd HH:mm:ss"); - var today = DateTime.Today; + var now = DateTime.Now; var localTime = DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime(); + var span = now - localTime; + if (span.TotalMinutes < 1) + return App.Text("Period.JustNow"); - if (localTime >= today) + if (span.TotalHours < 1) + return App.Text("Period.MinutesAgo", (int)span.TotalMinutes); + + if (span.TotalDays < 1) + return App.Text("Period.HoursAgo", (int)span.TotalHours); + + var lastDay = now.AddDays(-1).Date; + if (localTime >= lastDay) + return App.Text("Period.Yesterday"); + + if ((localTime.Year == now.Year && localTime.Month == now.Month) || span.TotalDays < 28) { - var now = DateTime.Now; - var timespan = now - localTime; - if (timespan.TotalHours > 1) - return App.Text("Period.HoursAgo", (int)timespan.TotalHours); - - return timespan.TotalMinutes < 1 ? App.Text("Period.JustNow") : App.Text("Period.MinutesAgo", (int)timespan.TotalMinutes); + var diffDay = now.Date - localTime.Date; + return App.Text("Period.DaysAgo", (int)diffDay.TotalDays); } - var diffYear = today.Year - localTime.Year; - if (diffYear == 0) - { - var diffMonth = today.Month - localTime.Month; - if (diffMonth > 0) - return diffMonth == 1 ? App.Text("Period.LastMonth") : App.Text("Period.MonthsAgo", diffMonth); + var lastMonth = now.AddMonths(-1).Date; + if (localTime.Year == lastMonth.Year && localTime.Month == lastMonth.Month) + return App.Text("Period.LastMonth"); - var diffDay = today.Day - localTime.Day; - return diffDay == 1 ? App.Text("Period.Yesterday") : App.Text("Period.DaysAgo", diffDay); + if (localTime.Year == now.Year || localTime > now.AddMonths(-11)) + { + var diffMonth = (12 + now.Month - localTime.Month) % 12; + return App.Text("Period.MonthsAgo", diffMonth); } - return diffYear == 1 ? App.Text("Period.LastYear") : App.Text("Period.YearsAgo", diffYear); + var diffYear = now.Year - localTime.Year; + if (diffYear == 1) + return App.Text("Period.LastYear"); + + return App.Text("Period.YearsAgo", diffYear); } private IDisposable _refreshTimer = null; @@ -730,9 +742,12 @@ namespace SourceGit.Views private void OnCommitListDoubleTapped(object sender, TappedEventArgs e) { - if (DataContext is ViewModels.Histories histories && sender is ListBox { SelectedItems: { Count: 1 } selected }) + if (DataContext is ViewModels.Histories histories && sender is ListBox { SelectedItems: { Count: 1 } }) { - histories.DoubleTapped(selected[0] as Models.Commit); + var source = e.Source as Control; + var item = source.FindAncestorOfType(); + if (item is { DataContext: Models.Commit commit }) + histories.DoubleTapped(commit); } e.Handled = true; } diff --git a/src/Views/Hotkeys.axaml b/src/Views/Hotkeys.axaml index 4fe77066..19f9dc78 100644 --- a/src/Views/Hotkeys.axaml +++ b/src/Views/Hotkeys.axaml @@ -45,7 +45,7 @@ FontSize="{Binding Source={x:Static vm:Preference.Instance}, Path=DefaultFontSize, Converter={x:Static c:DoubleConverters.Increase}}" Margin="0,0,0,8"/> - + @@ -61,8 +61,11 @@ - - + + + + + - + @@ -65,6 +65,7 @@ + @@ -76,13 +77,16 @@ - + - + @@ -170,8 +174,8 @@ - - - - + + - - + + + - - - - - - - + + - - + + + + - - - - - + + + + + + + + + + + diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs index 29d90e09..a3a3af8b 100644 --- a/src/Views/Launcher.axaml.cs +++ b/src/Views/Launcher.axaml.cs @@ -72,6 +72,11 @@ namespace SourceGit.Views return _unhandledModifiers.HasFlag(modifier); } + public void ClearKeyModifier() + { + _unhandledModifiers = KeyModifiers.None; + } + protected override void OnOpened(EventArgs e) { base.OnOpened(e); @@ -131,6 +136,16 @@ namespace SourceGit.Views return; } + if (e.Key == Key.N) + { + if (vm.ActivePage.Data is not ViewModels.Welcome) + vm.AddNewTab(); + + ViewModels.Welcome.Instance.Clone(); + e.Handled = true; + return; + } + if ((OperatingSystem.IsMacOS() && e.KeyModifiers.HasFlag(KeyModifiers.Alt) && e.Key == Key.Right) || (!OperatingSystem.IsMacOS() && !e.KeyModifiers.HasFlag(KeyModifiers.Shift) && e.Key == Key.Tab)) { diff --git a/src/Views/LauncherPage.axaml b/src/Views/LauncherPage.axaml index e75fd936..d09c2c0d 100644 --- a/src/Views/LauncherPage.axaml +++ b/src/Views/LauncherPage.axaml @@ -77,7 +77,7 @@ HorizontalAlignment="Right" IsVisible="{Binding InProgress, Converter={x:Static BoolConverters.Not}}"> + - - - + + + + + diff --git a/src/Views/LauncherPage.axaml.cs b/src/Views/LauncherPage.axaml.cs index d37d22bd..3fa8269e 100644 --- a/src/Views/LauncherPage.axaml.cs +++ b/src/Views/LauncherPage.axaml.cs @@ -32,6 +32,14 @@ namespace SourceGit.Views OnPopupCancel(sender, e); } + private void OnCopyNotification(object sender, RoutedEventArgs e) + { + if (sender is Button { DataContext: Models.Notification notice }) + App.CopyText(notice.Message); + + e.Handled = true; + } + private void OnDismissNotification(object sender, RoutedEventArgs e) { if (sender is Button { DataContext: Models.Notification notice } && diff --git a/src/Views/Merge.axaml b/src/Views/Merge.axaml index b63bfc04..805ac6d0 100644 --- a/src/Views/Merge.axaml +++ b/src/Views/Merge.axaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="using:SourceGit.Models" xmlns:vm="using:SourceGit.ViewModels" + xmlns:c="using:SourceGit.Converters" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="SourceGit.Views.Merge" x:DataType="vm:Merge"> @@ -11,15 +12,36 @@ - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Views/MergeMultiple.axaml.cs b/src/Views/MergeMultiple.axaml.cs new file mode 100644 index 00000000..c0997067 --- /dev/null +++ b/src/Views/MergeMultiple.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; + +namespace SourceGit.Views +{ + public partial class MergeMultiple : UserControl + { + public MergeMultiple() + { + InitializeComponent(); + } + } +} diff --git a/src/Views/Preference.axaml b/src/Views/Preference.axaml index 9b84604a..0ed598c2 100644 --- a/src/Views/Preference.axaml +++ b/src/Views/Preference.axaml @@ -45,7 +45,7 @@ - + + + @@ -188,7 +193,7 @@ - + - - - - + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> + IsCheckedChanged="OnLocalChangeActionIsCheckedChanged"/> - + diff --git a/src/Views/Repository.axaml b/src/Views/Repository.axaml index bb34a821..6d034130 100644 --- a/src/Views/Repository.axaml +++ b/src/Views/Repository.axaml @@ -42,6 +42,16 @@ + + + + @@ -67,9 +83,9 @@ - - - + + + + - - - + + + - - - + + + - - + + + + + + + + + + + + + + - + + + + + + + + - diff --git a/src/Views/Repository.axaml.cs b/src/Views/Repository.axaml.cs index dec3d447..376c81c3 100644 --- a/src/Views/Repository.axaml.cs +++ b/src/Views/Repository.axaml.cs @@ -395,5 +395,46 @@ namespace SourceGit.Views } e.Handled = true; } + + private void OnSwitchHistoriesOrderClicked(object sender, RoutedEventArgs e) + { + if (sender is Button button && DataContext is ViewModels.Repository repo) + { + var checkIcon = App.CreateMenuIcon("Icons.Check"); + + var dateOrder = new MenuItem(); + dateOrder.Header = App.Text("Repository.HistoriesOrder.ByDate"); + dateOrder.Icon = repo.EnableTopoOrderInHistories ? null : checkIcon; + dateOrder.Click += (_, ev) => + { + repo.EnableTopoOrderInHistories = false; + ev.Handled = true; + }; + + var topoOrder = new MenuItem(); + topoOrder.Header = App.Text("Repository.HistoriesOrder.Topo"); + topoOrder.Icon = repo.EnableTopoOrderInHistories ? checkIcon : null; + topoOrder.Click += (_, ev) => + { + repo.EnableTopoOrderInHistories = true; + ev.Handled = true; + }; + + var menu = new ContextMenu(); + menu.Items.Add(dateOrder); + menu.Items.Add(topoOrder); + menu.Open(button); + } + + e.Handled = true; + } + + private void OnSkipInProgress(object sender, RoutedEventArgs e) + { + if (DataContext is ViewModels.Repository repo) + repo.SkipMerge(); + + e.Handled = true; + } } } diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml index f1deca3a..424a2346 100644 --- a/src/Views/RepositoryConfigure.axaml +++ b/src/Views/RepositoryConfigure.axaml @@ -155,7 +155,7 @@ - + @@ -227,7 +227,7 @@ - + - + + + + @@ -311,7 +314,7 @@ HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{DynamicResource Brush.FG2}" - Data="{StaticResource Icons.Issue}"/> + Data="{StaticResource Icons.Empty}"/> @@ -458,7 +461,7 @@ + Text="{DynamicResource Text.Configure.OpenAI.Preferred}"/> diff --git a/src/Views/RepositoryToolbar.axaml.cs b/src/Views/RepositoryToolbar.axaml.cs index afc8ac5a..aa78c4d3 100644 --- a/src/Views/RepositoryToolbar.axaml.cs +++ b/src/Views/RepositoryToolbar.axaml.cs @@ -1,5 +1,3 @@ -using System; - using Avalonia.Controls; using Avalonia.Input; using Avalonia.Interactivity; @@ -50,9 +48,7 @@ namespace SourceGit.Views if (launcher is not null && DataContext is ViewModels.Repository repo) { var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); - if (!startDirectly && OperatingSystem.IsMacOS()) - startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); - + launcher.ClearKeyModifier(); repo.Fetch(startDirectly); e.Handled = true; } @@ -64,9 +60,7 @@ namespace SourceGit.Views if (launcher is not null && DataContext is ViewModels.Repository repo) { var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); - if (!startDirectly && OperatingSystem.IsMacOS()) - startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); - + launcher.ClearKeyModifier(); repo.Pull(startDirectly); e.Handled = true; } @@ -78,9 +72,7 @@ namespace SourceGit.Views if (launcher is not null && DataContext is ViewModels.Repository repo) { var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); - if (!startDirectly && OperatingSystem.IsMacOS()) - startDirectly = launcher.HasKeyModifier(KeyModifiers.Meta); - + launcher.ClearKeyModifier(); repo.Push(startDirectly); e.Handled = true; } @@ -89,8 +81,13 @@ namespace SourceGit.Views private void StashAll(object _, RoutedEventArgs e) { var launcher = this.FindAncestorOfType(); - (DataContext as ViewModels.Repository)?.StashAll(launcher?.HasKeyModifier(KeyModifiers.Control) ?? false); - e.Handled = true; + if (launcher is not null && DataContext is ViewModels.Repository repo) + { + var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control); + launcher.ClearKeyModifier(); + repo.StashAll(startDirectly); + e.Handled = true; + } } private void OpenGitFlowMenu(object sender, RoutedEventArgs e) diff --git a/src/Views/Reset.axaml b/src/Views/Reset.axaml index c703ac1d..ce361b23 100644 --- a/src/Views/Reset.axaml +++ b/src/Views/Reset.axaml @@ -27,7 +27,7 @@ Margin="0,0,8,0" Text="{DynamicResource Text.Reset.MoveTo}"/> - + @@ -37,16 +37,19 @@ Margin="0,0,8,0" Text="{DynamicResource Text.Reset.Mode}"/> + SelectedItem="{Binding SelectedMode, Mode=TwoWay}" + KeyDown="OnResetModeKeyDown"> - - + + + diff --git a/src/Views/Reset.axaml.cs b/src/Views/Reset.axaml.cs index cc4b9b58..8c380538 100644 --- a/src/Views/Reset.axaml.cs +++ b/src/Views/Reset.axaml.cs @@ -1,4 +1,6 @@ using Avalonia.Controls; +using Avalonia.Input; +using Avalonia.Interactivity; namespace SourceGit.Views { @@ -8,5 +10,29 @@ namespace SourceGit.Views { InitializeComponent(); } + + protected override void OnLoaded(RoutedEventArgs e) + { + base.OnLoaded(e); + + ResetMode.Focus(); + } + + private void OnResetModeKeyDown(object sender, KeyEventArgs e) + { + if (sender is ComboBox comboBox) + { + var key = e.Key.ToString(); + for (int i = 0; i < Models.ResetMode.Supported.Length; i++) + { + if (key.Equals(Models.ResetMode.Supported[i].Key, System.StringComparison.OrdinalIgnoreCase)) + { + comboBox.SelectedIndex = i; + e.Handled = true; + return; + } + } + } + } } } diff --git a/src/Views/Revert.axaml b/src/Views/Revert.axaml index 294112b2..cafe1725 100644 --- a/src/Views/Revert.axaml +++ b/src/Views/Revert.axaml @@ -18,7 +18,7 @@ Text="{DynamicResource Text.Revert.Commit}"/> - + diff --git a/src/Views/RevisionFileTreeView.axaml.cs b/src/Views/RevisionFileTreeView.axaml.cs index af9beb7d..b671851c 100644 --- a/src/Views/RevisionFileTreeView.axaml.cs +++ b/src/Views/RevisionFileTreeView.axaml.cs @@ -144,6 +144,68 @@ namespace SourceGit.Views InitializeComponent(); } + public void SetSearchResult(string file) + { + _rows.Clear(); + _searchResult.Clear(); + + var rows = new List(); + if (string.IsNullOrEmpty(file)) + { + MakeRows(rows, _tree, 0); + } + else + { + var vm = DataContext as ViewModels.CommitDetail; + if (vm == null || vm.Commit == null) + return; + + var objects = vm.GetRevisionFilesUnderFolder(file); + if (objects == null || objects.Count != 1) + return; + + var routes = file.Split('/', StringSplitOptions.None); + if (routes.Length == 1) + { + _searchResult.Add(new ViewModels.RevisionFileTreeNode + { + Backend = objects[0] + }); + } + else + { + var last = _searchResult; + var prefix = string.Empty; + for (var i = 0; i < routes.Length - 1; i++) + { + var folder = new ViewModels.RevisionFileTreeNode + { + Backend = new Models.Object + { + Type = Models.ObjectType.Tree, + Path = prefix + routes[i], + }, + IsExpanded = true, + }; + + last.Add(folder); + last = folder.Children; + prefix = folder.Backend + "/"; + } + + last.Add(new ViewModels.RevisionFileTreeNode + { + Backend = objects[0] + }); + } + + MakeRows(rows, _searchResult, 0); + } + + _rows.AddRange(rows); + GC.Collect(); + } + public void ToggleNodeIsExpanded(ViewModels.RevisionFileTreeNode node) { _disableSelectionChangingEvent = true; @@ -189,6 +251,7 @@ namespace SourceGit.Views { _tree.Clear(); _rows.Clear(); + _searchResult.Clear(); var vm = DataContext as ViewModels.CommitDetail; if (vm == null || vm.Commit == null) @@ -308,5 +371,6 @@ namespace SourceGit.Views private List _tree = []; private AvaloniaList _rows = []; private bool _disableSelectionChangingEvent = false; + private List _searchResult = []; } } diff --git a/src/Views/RevisionFiles.axaml b/src/Views/RevisionFiles.axaml index d0b20963..fdb15807 100644 --- a/src/Views/RevisionFiles.axaml +++ b/src/Views/RevisionFiles.axaml @@ -4,6 +4,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="using:SourceGit.ViewModels" xmlns:v="using:SourceGit.Views" + xmlns:c="using:SourceGit.Converters" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="SourceGit.Views.RevisionFiles" x:DataType="vm:CommitDetail"> @@ -14,17 +15,96 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/src/Views/RevisionFiles.axaml.cs b/src/Views/RevisionFiles.axaml.cs index 53c36b1c..f748fb0d 100644 --- a/src/Views/RevisionFiles.axaml.cs +++ b/src/Views/RevisionFiles.axaml.cs @@ -3,6 +3,7 @@ using System; using Avalonia; using Avalonia.Controls; using Avalonia.Controls.Primitives; +using Avalonia.Input; using Avalonia.Interactivity; using Avalonia.Media; @@ -118,5 +119,81 @@ namespace SourceGit.Views { InitializeComponent(); } + + private void OnSearchBoxKeyDown(object _, KeyEventArgs e) + { + var vm = DataContext as ViewModels.CommitDetail; + if (vm == null) + return; + + if (e.Key == Key.Enter) + { + FileTree.SetSearchResult(vm.RevisionFileSearchFilter); + e.Handled = true; + } + else if (e.Key == Key.Down || e.Key == Key.Up) + { + if (vm.IsRevisionFileSearchSuggestionOpen) + { + SearchSuggestionBox.Focus(NavigationMethod.Tab); + SearchSuggestionBox.SelectedIndex = 0; + } + + e.Handled = true; + } + else if (e.Key == Key.Escape) + { + if (vm.IsRevisionFileSearchSuggestionOpen) + { + vm.RevisionFileSearchSuggestion.Clear(); + vm.IsRevisionFileSearchSuggestionOpen = false; + } + + e.Handled = true; + } + } + + private void OnSearchBoxTextChanged(object _, TextChangedEventArgs e) + { + if (string.IsNullOrEmpty(TxtSearchRevisionFiles.Text)) + FileTree.SetSearchResult(null); + } + + private void OnSearchSuggestionBoxKeyDown(object _, KeyEventArgs e) + { + var vm = DataContext as ViewModels.CommitDetail; + if (vm == null) + return; + + if (e.Key == Key.Escape) + { + vm.RevisionFileSearchSuggestion.Clear(); + e.Handled = true; + } + else if (e.Key == Key.Enter && SearchSuggestionBox.SelectedItem is string content) + { + vm.RevisionFileSearchFilter = content; + TxtSearchRevisionFiles.CaretIndex = content.Length; + FileTree.SetSearchResult(vm.RevisionFileSearchFilter); + e.Handled = true; + } + } + + private void OnSearchSuggestionDoubleTapped(object sender, TappedEventArgs e) + { + var vm = DataContext as ViewModels.CommitDetail; + if (vm == null) + return; + + var content = (sender as StackPanel)?.DataContext as string; + if (!string.IsNullOrEmpty(content)) + { + vm.RevisionFileSearchFilter = content; + TxtSearchRevisionFiles.CaretIndex = content.Length; + FileTree.SetSearchResult(vm.RevisionFileSearchFilter); + } + + e.Handled = true; + } } } diff --git a/src/Views/Reword.axaml b/src/Views/Reword.axaml index 7e84033c..f5de4ee7 100644 --- a/src/Views/Reword.axaml +++ b/src/Views/Reword.axaml @@ -14,7 +14,7 @@ Text="{DynamicResource Text.Reword}"/> - + diff --git a/src/Views/Squash.axaml b/src/Views/Squash.axaml index 3af7e793..30755bae 100644 --- a/src/Views/Squash.axaml +++ b/src/Views/Squash.axaml @@ -17,7 +17,7 @@ diff --git a/src/Views/TagsView.axaml b/src/Views/TagsView.axaml index a30f63de..5dedb661 100644 --- a/src/Views/TagsView.axaml +++ b/src/Views/TagsView.axaml @@ -12,6 +12,10 @@ + + @@ -43,15 +47,14 @@ Classes="primary" Text="{Binding FullPath, Converter={x:Static c:PathConverters.PureFileName}}" Margin="8,0,0,0"/> - - + + + + + + + + @@ -60,32 +63,28 @@ - + Margin="8,0,0,0" + TextTrimming="CharacterEllipsis"/> - + diff --git a/src/Views/TagsView.axaml.cs b/src/Views/TagsView.axaml.cs index 8d4168b2..c83cfd28 100644 --- a/src/Views/TagsView.axaml.cs +++ b/src/Views/TagsView.axaml.cs @@ -65,7 +65,7 @@ namespace SourceGit.Views } if (node.Tag != null) - CreateContent(new Thickness(0, 2, 0, 0), "Icons.Tag"); + CreateContent(new Thickness(0, 0, 0, 0), "Icons.Tag"); else if (node.IsExpanded) CreateContent(new Thickness(0, 2, 0, 0), "Icons.Folder.Open"); else @@ -247,23 +247,6 @@ namespace SourceGit.Views } } - private void OnToggleFilterClicked(object sender, RoutedEventArgs e) - { - if (sender is ToggleButton toggle && DataContext is ViewModels.Repository repo) - { - var target = null as Models.Tag; - if (toggle.DataContext is ViewModels.TagTreeNode node) - target = node.Tag; - else if (toggle.DataContext is Models.Tag tag) - target = tag; - - if (target != null) - repo.UpdateFilters([target.Name], toggle.IsChecked == true); - } - - e.Handled = true; - } - private void MakeTreeRows(List rows, List nodes) { foreach (var node in nodes) diff --git a/src/Views/TextDiffView.axaml b/src/Views/TextDiffView.axaml index 57427321..1dc26bb3 100644 --- a/src/Views/TextDiffView.axaml +++ b/src/Views/TextDiffView.axaml @@ -13,27 +13,40 @@ - + + + + + + + - + + SelectedChunk="{Binding #ThisControl.SelectedChunk, Mode=TwoWay}" + BlockNavigation="{Binding #ThisControl.BlockNavigation, Mode=TwoWay}"/> @@ -71,16 +85,44 @@ WordWrap="False" ShowHiddenSymbols="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowHiddenSymbolsInDiffView}" EnableChunkSelection="{Binding #ThisControl.EnableChunkSelection}" - SelectedChunk="{Binding #ThisControl.SelectedChunk, Mode=TwoWay}"/> + SelectedChunk="{Binding #ThisControl.SelectedChunk, Mode=TwoWay}" + BlockNavigation="{Binding #ThisControl.BlockNavigation, Mode=TwoWay}"/> + + + + - + + + + diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 913a6340..cca3751d 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Globalization; using System.IO; using System.Text; @@ -45,6 +46,18 @@ namespace SourceGit.Views } } + public record TextDiffViewRange + { + public int StartIdx { get; set; } = 0; + public int EndIdx { get; set; } = 0; + + public TextDiffViewRange(int startIdx, int endIdx) + { + StartIdx = startIdx; + EndIdx = endIdx; + } + } + public class ThemedTextDiffPresenter : TextEditor { public class VerticalSeperatorMargin : AbstractMargin @@ -210,7 +223,6 @@ namespace SourceGit.Views if (presenter == null) return new Size(0, 0); - var maxLineNumber = presenter.GetMaxLineNumber(); var typeface = TextView.CreateTypeface(); var test = new FormattedText( $"-", @@ -243,6 +255,10 @@ namespace SourceGit.Views if (_presenter.Document == null || !textView.VisualLinesValid) return; + var changeBlock = _presenter.BlockNavigation?.GetCurrentBlock(); + Brush changeBlockBG = new SolidColorBrush(Colors.Gray, 0.25); + Pen changeBlockFG = new Pen(Brushes.Gray); + var lines = _presenter.GetLines(); var width = textView.Bounds.Width; foreach (var line in textView.VisualLines) @@ -255,51 +271,62 @@ namespace SourceGit.Views break; var info = lines[index - 1]; - var bg = GetBrushByLineType(info.Type); - if (bg == null) - continue; var startY = line.GetTextLineVisualYPosition(line.TextLines[0], VisualYPosition.LineTop) - textView.VerticalOffset; var endY = line.GetTextLineVisualYPosition(line.TextLines[^1], VisualYPosition.LineBottom) - textView.VerticalOffset; - drawingContext.DrawRectangle(bg, null, new Rect(0, startY, width, endY - startY)); - if (info.Highlights.Count > 0) + var bg = GetBrushByLineType(info.Type); + if (bg != null) { - var highlightBG = info.Type == Models.TextDiffLineType.Added ? _presenter.AddedHighlightBrush : _presenter.DeletedHighlightBrush; - var processingIdxStart = 0; - var processingIdxEnd = 0; - var nextHightlight = 0; + drawingContext.DrawRectangle(bg, null, new Rect(0, startY, width, endY - startY)); - foreach (var tl in line.TextLines) + if (info.Highlights.Count > 0) { - processingIdxEnd += tl.Length; + var highlightBG = info.Type == Models.TextDiffLineType.Added ? _presenter.AddedHighlightBrush : _presenter.DeletedHighlightBrush; + var processingIdxStart = 0; + var processingIdxEnd = 0; + var nextHighlight = 0; - var y = line.GetTextLineVisualYPosition(tl, VisualYPosition.LineTop) - textView.VerticalOffset; - var h = line.GetTextLineVisualYPosition(tl, VisualYPosition.LineBottom) - textView.VerticalOffset - y; - - while (nextHightlight < info.Highlights.Count) + foreach (var tl in line.TextLines) { - var highlight = info.Highlights[nextHightlight]; - if (highlight.Start >= processingIdxEnd) - break; + processingIdxEnd += tl.Length; - var start = line.GetVisualColumn(highlight.Start < processingIdxStart ? processingIdxStart : highlight.Start); - var end = line.GetVisualColumn(highlight.End >= processingIdxEnd ? processingIdxEnd : highlight.End + 1); + var y = line.GetTextLineVisualYPosition(tl, VisualYPosition.LineTop) - textView.VerticalOffset; + var h = line.GetTextLineVisualYPosition(tl, VisualYPosition.LineBottom) - textView.VerticalOffset - y; - var x = line.GetTextLineVisualXPosition(tl, start) - textView.HorizontalOffset; - var w = line.GetTextLineVisualXPosition(tl, end) - textView.HorizontalOffset - x; - var rect = new Rect(x, y, w, h); - drawingContext.DrawRectangle(highlightBG, null, rect); + while (nextHighlight < info.Highlights.Count) + { + var highlight = info.Highlights[nextHighlight]; + if (highlight.Start >= processingIdxEnd) + break; - if (highlight.End >= processingIdxEnd) - break; + var start = line.GetVisualColumn(highlight.Start < processingIdxStart ? processingIdxStart : highlight.Start); + var end = line.GetVisualColumn(highlight.End >= processingIdxEnd ? processingIdxEnd : highlight.End + 1); - nextHightlight++; + var x = line.GetTextLineVisualXPosition(tl, start) - textView.HorizontalOffset; + var w = line.GetTextLineVisualXPosition(tl, end) - textView.HorizontalOffset - x; + var rect = new Rect(x, y, w, h); + drawingContext.DrawRectangle(highlightBG, null, rect); + + if (highlight.End >= processingIdxEnd) + break; + + nextHighlight++; + } + + processingIdxStart = processingIdxEnd; } - - processingIdxStart = processingIdxEnd; } } + + if (changeBlock != null && changeBlock.IsInRange(index)) + { + drawingContext.DrawRectangle(changeBlockBG, null, new Rect(0, startY, width, endY - startY)); + if (index == changeBlock.Start) + drawingContext.DrawLine(changeBlockFG, new Point(0, startY), new Point(width, startY)); + if (index == changeBlock.End) + drawingContext.DrawLine(changeBlockFG, new Point(0, endY), new Point(width, endY)); + } } } @@ -466,6 +493,24 @@ namespace SourceGit.Views set => SetValue(SelectedChunkProperty, value); } + public static readonly StyledProperty DisplayRangeProperty = + AvaloniaProperty.Register(nameof(DisplayRange), new TextDiffViewRange(0, 0)); + + public TextDiffViewRange DisplayRange + { + get => GetValue(DisplayRangeProperty); + set => SetValue(DisplayRangeProperty, value); + } + + public static readonly StyledProperty BlockNavigationProperty = + AvaloniaProperty.Register(nameof(BlockNavigation)); + + public ViewModels.BlockNavigation BlockNavigation + { + get => GetValue(BlockNavigationProperty); + set => SetValue(BlockNavigationProperty, value); + } + protected override Type StyleKeyOverride => typeof(TextEditor); public ThemedTextDiffPresenter(TextArea area, TextDocument doc) : base(area, doc) @@ -498,6 +543,104 @@ namespace SourceGit.Views { } + public void GotoPrevChange() + { + var blockNavigation = BlockNavigation; + if (blockNavigation != null) + { + var prev = blockNavigation.GotoPrev(); + if (prev != null) + { + TextArea.Caret.Line = prev.Start; + ScrollToLine(prev.Start); + } + + return; + } + + var firstLineIdx = DisplayRange.StartIdx; + if (firstLineIdx <= 1) + return; + + var lines = GetLines(); + var firstLineType = lines[firstLineIdx].Type; + var prevLineType = lines[firstLineIdx - 1].Type; + var isChangeFirstLine = firstLineType != Models.TextDiffLineType.Normal && firstLineType != Models.TextDiffLineType.Indicator; + var isChangePrevLine = prevLineType != Models.TextDiffLineType.Normal && prevLineType != Models.TextDiffLineType.Indicator; + if (isChangeFirstLine && isChangePrevLine) + { + for (var i = firstLineIdx - 2; i >= 0; i--) + { + var prevType = lines[i].Type; + if (prevType == Models.TextDiffLineType.Normal || prevType == Models.TextDiffLineType.Indicator) + { + ScrollToLine(i + 2); + return; + } + } + } + + var findChange = false; + for (var i = firstLineIdx - 1; i >= 0; i--) + { + var prevType = lines[i].Type; + if (prevType == Models.TextDiffLineType.Normal || prevType == Models.TextDiffLineType.Indicator) + { + if (findChange) + { + ScrollToLine(i + 2); + return; + } + } + else if (!findChange) + { + findChange = true; + } + } + } + + public void GotoNextChange() + { + var blockNavigation = BlockNavigation; + if (blockNavigation != null) + { + var next = blockNavigation.GotoNext(); + if (next != null) + { + TextArea.Caret.Line = next.Start; + ScrollToLine(next.Start); + } + + return; + } + + var lines = GetLines(); + var lastLineIdx = DisplayRange.EndIdx; + if (lastLineIdx >= lines.Count - 1) + return; + + var lastLineType = lines[lastLineIdx].Type; + var findNormalLine = lastLineType == Models.TextDiffLineType.Normal || lastLineType == Models.TextDiffLineType.Indicator; + for (var idx = lastLineIdx + 1; idx < lines.Count; idx++) + { + var nextType = lines[idx].Type; + if (nextType == Models.TextDiffLineType.None || + nextType == Models.TextDiffLineType.Added || + nextType == Models.TextDiffLineType.Deleted) + { + if (findNormalLine) + { + ScrollToLine(idx + 1); + return; + } + } + else if (!findNormalLine) + { + findNormalLine = true; + } + } + } + public override void Render(DrawingContext context) { base.Render(context); @@ -524,8 +667,10 @@ namespace SourceGit.Views TextArea.TextView.PointerEntered += OnTextViewPointerChanged; TextArea.TextView.PointerMoved += OnTextViewPointerChanged; TextArea.TextView.PointerWheelChanged += OnTextViewPointerWheelChanged; + TextArea.TextView.VisualLinesChanged += OnTextViewVisualLinesChanged; UpdateTextMate(); + OnTextViewVisualLinesChanged(null, null); } protected override void OnUnloaded(RoutedEventArgs e) @@ -536,6 +681,7 @@ namespace SourceGit.Views TextArea.TextView.PointerEntered -= OnTextViewPointerChanged; TextArea.TextView.PointerMoved -= OnTextViewPointerChanged; TextArea.TextView.PointerWheelChanged -= OnTextViewPointerWheelChanged; + TextArea.TextView.VisualLinesChanged -= OnTextViewVisualLinesChanged; if (_textMate != null) { @@ -570,6 +716,25 @@ namespace SourceGit.Views { InvalidateVisual(); } + else if (change.Property == BlockNavigationProperty) + { + var oldValue = change.OldValue as ViewModels.BlockNavigation; + if (oldValue != null) + { + oldValue.PropertyChanged -= OnBlockNavigationPropertyChanged; + if (oldValue.Current != -1) + TextArea?.TextView?.Redraw(); + } + + var newValue = change.NewValue as ViewModels.BlockNavigation; + if (newValue != null) + newValue.PropertyChanged += OnBlockNavigationPropertyChanged; + } + } + + private void OnBlockNavigationPropertyChanged(object _1, PropertyChangedEventArgs _2) + { + TextArea?.TextView?.Redraw(); } private void OnTextViewContextRequested(object sender, ContextRequestedEventArgs e) @@ -643,6 +808,34 @@ namespace SourceGit.Views } } + private void OnTextViewVisualLinesChanged(object sender, EventArgs e) + { + if (!TextArea.TextView.VisualLinesValid) + { + SetCurrentValue(DisplayRangeProperty, new TextDiffViewRange(0, 0)); + return; + } + + var lines = GetLines(); + var start = int.MaxValue; + var count = 0; + foreach (var line in TextArea.TextView.VisualLines) + { + if (line.IsDisposed || line.FirstDocumentLine == null || line.FirstDocumentLine.IsDeleted) + continue; + + var index = line.FirstDocumentLine.LineNumber - 1; + if (index >= lines.Count) + continue; + + count++; + if (start > index) + start = index; + } + + SetCurrentValue(DisplayRangeProperty, new TextDiffViewRange(start, start + count)); + } + protected void TrySetChunk(TextDiffViewChunk chunk) { var old = SelectedChunk; @@ -950,12 +1143,8 @@ namespace SourceGit.Views private void OnTextViewScrollGotFocus(object sender, GotFocusEventArgs e) { - if (EnableChunkSelection && sender is ScrollViewer viewer) - { - var area = viewer.FindDescendantOfType