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..6a38c174 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,11 @@ jobs: uses: ./.github/workflows/package.yml with: version: ${{ needs.version.outputs.version }} + publish-packages: + 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 66bdf3c5..47785e73 100644 --- a/README.md +++ b/README.md @@ -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-100.00%25-brightgreen)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-98.01%25-yellow)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.44%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-97.87%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.29%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-99.72%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-100.00%25-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-97.17%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-97.59%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-99.01%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-99.86%25-yellow)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-100.00%25-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-100.00%25-brightgreen)](TRANSLATION.md) ## How to Use diff --git a/SourceGit.sln b/SourceGit.sln index 9c5fcdb1..3eeb8a54 100644 --- a/SourceGit.sln +++ b/SourceGit.sln @@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ .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 ec3fa80c..569a0222 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,15 @@ -### de_DE.axaml: 100.00% +### de_DE.axaml: 99.72% + + +
+Missing Keys + +- Text.CommitDetail.Files.Search +- Text.WorkingCopy.CommitToEdit + +
+ +### es_ES.axaml: 100.00%
@@ -8,30 +19,7 @@
-### es_ES.axaml: 98.01% - - -
-Missing Keys - -- Text.CommitDetail.Info.Children -- Text.Fetch.Force -- Text.Preference.Appearance.FontSize -- Text.Preference.Appearance.FontSize.Default -- Text.Preference.Appearance.FontSize.Editor -- 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.SHALinkCM.NavigateTo - -
- -### fr_FR.axaml: 97.44% +### fr_FR.axaml: 97.17%
@@ -40,6 +28,7 @@ - Text.CherryPick.AppendSourceToMessage - Text.CherryPick.Mainline.Tips - Text.CommitCM.CherryPickMultiple +- Text.CommitDetail.Files.Search - Text.Fetch.Force - Text.Preference.Appearance.FontSize - Text.Preference.Appearance.FontSize.Default @@ -55,15 +44,17 @@ - Text.Repository.HistoriesOrder.Topo - Text.ScanRepositories - Text.SHALinkCM.NavigateTo +- Text.WorkingCopy.CommitToEdit
-### it_IT.axaml: 97.87% +### it_IT.axaml: 97.59%
Missing Keys +- Text.CommitDetail.Files.Search - Text.CommitDetail.Info.Children - Text.Configure.IssueTracker.AddSampleGitLabMergeRequest - Text.Configure.OpenAI.Preferred @@ -79,30 +70,33 @@ - Text.Repository.HistoriesOrder.Topo - Text.SHALinkCM.CopySHA - Text.SHALinkCM.NavigateTo +- Text.WorkingCopy.CommitToEdit
-### pt_BR.axaml: 99.29% +### pt_BR.axaml: 99.01%
Missing Keys +- Text.CommitDetail.Files.Search - Text.CommitDetail.Info.Children - Text.Fetch.Force - Text.Preference.General.ShowChildren - Text.Repository.FilterCommits - Text.SHALinkCM.NavigateTo +- Text.WorkingCopy.CommitToEdit
-### ru_RU.axaml: 100.00% +### ru_RU.axaml: 99.86%
Missing Keys - +- Text.CommitDetail.Files.Search
diff --git a/VERSION b/VERSION index 081fd762..cd658ce6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.40 \ No newline at end of file +8.41 \ No newline at end of file diff --git a/build/resources/rpm/SPECS/build.spec b/build/resources/rpm/SPECS/build.spec index d31b6587..bc10ca48 100644 --- a/build/resources/rpm/SPECS/build.spec +++ b/build/resources/rpm/SPECS/build.spec @@ -7,6 +7,7 @@ URL: https://sourcegit-scm.github.io/ Source: https://github.com/sourcegit-scm/sourcegit/archive/refs/tags/v%_version.tar.gz Requires: libX11.so.6()(%{__isa_bits}bit) Requires: libSM.so.6()(%{__isa_bits}bit) +Requires: libicu %define _build_id_links none diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 8f1a24b5..8582dbce 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -164,7 +164,12 @@ namespace SourceGit var resDic = new ResourceDictionary(); var overrides = JsonSerializer.Deserialize(File.ReadAllText(themeOverridesFile), JsonCodeGen.Default.ThemeOverrides); foreach (var kv in overrides.BasicColors) - resDic[$"Color.{kv.Key}"] = kv.Value; + { + if (kv.Key.Equals("SystemAccentColor", StringComparison.Ordinal)) + resDic["SystemAccentColor"] = kv.Value; + else + resDic[$"Color.{kv.Key}"] = kv.Value; + } if (overrides.GraphColors.Count > 0) Models.CommitGraph.SetPens(overrides.GraphColors, overrides.GraphPenThickness); 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/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/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 7554b305..44a8dac5 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -126,6 +126,7 @@ Search Changes... FILES LFS File + Search Files... Submodule INFORMATION AUTHOR @@ -685,6 +686,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 563419be..7c7f8d7c 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 @@ -272,6 +274,7 @@ Fast-Forward (sin checkout) Fetch Fetch todos los remotos + Utilizar opción '--force' Fetch sin etiquetas Remoto: Fetch Cambios Remotos @@ -437,6 +440,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 @@ -452,6 +458,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 @@ -541,6 +548,13 @@ Habilitar Opción '--reflog' Abrir en el Explorador Buscar Ramas/Etiquetas/Submódulos + 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' @@ -593,6 +607,7 @@ Actualización de Software Actualmente no hay actualizaciones disponibles. Copiar SHA + Ir a Squash Commits En: Clave Privada SSH: @@ -670,6 +685,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/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index a9de62e7..84475a52 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -685,6 +685,7 @@ ЗАФИКСИРОВАТЬ и ОТПРАВИТЬ Шаблон/Истории Запустить событие щелчка + Зафиксировать (Редактировать) Подготовить все изменения и зафиксировать Обнаружена пустая фиксация! Вы хотите продолжить (--allow-empty)? ОБНАРУЖЕНЫ КОНФЛИКТЫ diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index a5af3400..56a5353e 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -124,6 +124,7 @@ 查找变更... 文件列表 LFS文件 + 查找文件... 子模块 基本信息 修改者 @@ -684,6 +685,7 @@ 提交并推送 历史输入/模板 触发点击事件 + 提交(修改原始提交) 自动暂存所有变更并提交 提交未包含变更文件!是否继续(--allow-empty)? 检测到冲突 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index bf8b32e1..61029b45 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -124,6 +124,7 @@ 搜尋變更... 檔案列表 LFS 檔案 + 搜尋檔案... 子模組 基本資訊 作者 @@ -683,6 +684,7 @@ 提交並推送 歷史輸入/範本 觸發點擊事件 + 提交(修改現有提交) 自動暫存全部變更並提交 未包含任何檔案變更! 您是否仍要提交 (--allow-empty)? 檢測到衝突 diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index e40c4131..2e0adf2c 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -519,6 +519,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + 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/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index c830e5e8..594a72b9 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -239,20 +239,24 @@ Margin="8,0,0,0" HorizontalAlignment="Left" IsChecked="{Binding UseAmend, Mode=TwoWay}" - IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNull}}" Content="{DynamicResource Text.WorkingCopy.Amend}"/> - -