From 7caa03a09bbc7770cbf85ba8d16f23a9aa077864 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 09:57:52 +0800 Subject: [PATCH 001/571] project: upgrade `AvaloniaEdit` to `11.2.0` Signed-off-by: leo --- src/SourceGit.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SourceGit.csproj b/src/SourceGit.csproj index 34e4eab2..3578d59f 100644 --- a/src/SourceGit.csproj +++ b/src/SourceGit.csproj @@ -46,8 +46,8 @@ - - + + From 450dadf76ce582b3f1e59dd56f822d7c1f194c86 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Mon, 17 Mar 2025 10:12:44 +0800 Subject: [PATCH 002/571] feat: Add JSP grammar support and improve TextMateHelper file type handling (#1100) - Extend grammar support by allowing multiple file extensions per grammar and adding JSP file type handling. - Add a new JSON grammar file for JavaServer Pages (JSP) syntax highlighting. --- src/Models/TextMateHelper.cs | 22 +- src/Resources/Grammars/jsp.json | 1206 +++++++++++++++++++++++++++++++ 2 files changed, 1218 insertions(+), 10 deletions(-) create mode 100644 src/Resources/Grammars/jsp.json diff --git a/src/Models/TextMateHelper.cs b/src/Models/TextMateHelper.cs index 0eb5e489..b7efae72 100644 --- a/src/Models/TextMateHelper.cs +++ b/src/Models/TextMateHelper.cs @@ -21,10 +21,11 @@ namespace SourceGit.Models { private static readonly ExtraGrammar[] s_extraGrammars = [ - new ExtraGrammar("source.toml", ".toml", "toml.json"), - new ExtraGrammar("source.kotlin", ".kotlin", "kotlin.json"), - new ExtraGrammar("source.hx", ".hx", "haxe.json"), - new ExtraGrammar("source.hxml", ".hxml", "hxml.json"), + new ExtraGrammar("source.toml", [".toml"], "toml.json"), + new ExtraGrammar("source.kotlin", [".kotlin", ".kt", ".kts"], "kotlin.json"), + new ExtraGrammar("source.hx", [".hx"], "haxe.json"), + new ExtraGrammar("source.hxml", [".hxml"], "hxml.json"), + new ExtraGrammar("text.html.jsp", [".jsp", ".jspf", ".tag"], "jsp.json"), ]; public static string GetScope(string file, RegistryOptions reg) @@ -36,13 +37,14 @@ namespace SourceGit.Models extension = ".xml"; else if (extension == ".command") extension = ".sh"; - else if (extension == ".kt" || extension == ".kts") - extension = ".kotlin"; foreach (var grammar in s_extraGrammars) { - if (grammar.Extension.Equals(extension, StringComparison.OrdinalIgnoreCase)) - return grammar.Scope; + foreach (var ext in grammar.Extensions) + { + if (ext.Equals(extension, StringComparison.OrdinalIgnoreCase)) + return grammar.Scope; + } } return reg.GetScopeByExtension(extension); @@ -71,10 +73,10 @@ namespace SourceGit.Models return reg.GetGrammar(scopeName); } - private record ExtraGrammar(string Scope, string Extension, string File) + private record ExtraGrammar(string Scope, List Extensions, string File) { public readonly string Scope = Scope; - public readonly string Extension = Extension; + public readonly List Extensions = Extensions; public readonly string File = File; } } diff --git a/src/Resources/Grammars/jsp.json b/src/Resources/Grammars/jsp.json new file mode 100644 index 00000000..f0067748 --- /dev/null +++ b/src/Resources/Grammars/jsp.json @@ -0,0 +1,1206 @@ +{ + "information_for_contributors": [ + "This file has been copied from https://github.com/J0hnMilt0n/vscode-jsp/blob/b33b7e4d47f3b5f4b82e93dfcadd180149153d02/syntaxes/jsp.tmLanguage.json" + ], + "fileTypes": [ + "jsp", + "jspf", + "tag" + ], + "injections": { + "text.html.jsp - (meta.embedded.block.jsp | meta.embedded.line.jsp | meta.tag | comment), meta.tag string.quoted": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#declaration" + }, + { + "include": "#expression" + }, + { + "include": "#el_expression" + }, + { + "include": "#tags" + }, + { + "begin": "(^\\s*)(?=<%(?=\\s))", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.leading.erb" + } + }, + "end": "(?!\\G)(\\s*$\\n)?", + "endCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.trailing.erb" + } + }, + "patterns": [ + { + "include": "#scriptlet" + } + ] + }, + { + "include": "#scriptlet" + } + ] + } + }, + "keyEquivalent": "^~J", + "name": "JavaServer Pages", + "patterns": [ + { + "include": "#xml_tags" + }, + { + "include": "text.html.basic" + } + ], + "repository": { + "comment": { + "begin": "<%--", + "captures": { + "0": { + "name": "punctuation.definition.comment.jsp" + } + }, + "end": "--%>", + "name": "comment.block.jsp" + }, + "declaration": { + "begin": "<%!", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.jsp" + } + }, + "contentName": "source.java", + "end": "(%)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.jsp" + }, + "1": { + "name": "source.java" + } + }, + "name": "meta.embedded.line.declaration.jsp", + "patterns": [ + { + "include": "source.java" + } + ] + }, + "el_expression": { + "begin": "\\$\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.jsp" + } + }, + "contentName": "source.java", + "end": "(\\})", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.jsp" + }, + "1": { + "name": "source.java" + } + }, + "name": "meta.embedded.line.el_expression.jsp", + "patterns": [ + { + "include": "source.java" + } + ] + }, + "expression": { + "begin": "<%=", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.jsp" + } + }, + "contentName": "source.java", + "end": "(%)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.jsp" + }, + "1": { + "name": "source.java" + } + }, + "name": "meta.embedded.line.expression.jsp", + "patterns": [ + { + "include": "source.java" + } + ] + }, + "scriptlet": { + "begin": "<%", + "beginCaptures": { + "0": { + "name": "punctuation.section.embedded.begin.jsp" + } + }, + "contentName": "source.java", + "end": "(%)>", + "endCaptures": { + "0": { + "name": "punctuation.section.embedded.end.jsp" + }, + "1": { + "name": "source.java" + } + }, + "name": "meta.embedded.block.scriptlet.jsp", + "patterns": [ + { + "match": "\\{", + "name": "punctuation.section.scope.begin.java" + }, + { + "match": "\\}", + "name": "punctuation.section.scope.end.java" + }, + { + "include": "source.java" + } + ] + }, + "tags": { + "begin": "(<%@)\\s*(?=(attribute|include|page|tag|taglib|variable)\\s)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + } + }, + "end": "%>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.include.jsp", + "patterns": [ + { + "begin": "\\G(attribute)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.attribute.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|required|fragment|rtexprvalue|type|description)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(include)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.include.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(file)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(page)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.page.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(language|extends|import|session|buffer|autoFlush|isThreadSafe|info|errorPage|isErrorPage|contentType|pageEncoding|isElIgnored)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(tag)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.tag.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(display-name|body-content|dynamic-attributes|small-icon|large-icon|description|example|language|import|pageEncoding|isELIgnored)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(taglib)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.taglib.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(uri|tagdir|prefix)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(variable)(?=\\s)", + "captures": { + "1": { + "name": "keyword.control.variable.jsp" + } + }, + "end": "(?=%>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name-given|alias|variable-class|declare|scope|description)(=)((\")[^\"]*(\"))" + } + ] + } + ] + }, + "xml_tags": { + "patterns": [ + { + "begin": "(^\\s*)(?=)", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.leading.erb" + } + }, + "end": "(?!\\G)(\\s*$\\n)?", + "endCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.trailing.erb" + } + }, + "patterns": [ + { + "include": "#embedded" + } + ] + }, + { + "include": "#embedded" + }, + { + "include": "#directive" + }, + { + "include": "#actions" + } + ], + "repository": { + "actions": { + "patterns": [ + { + "begin": "(", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.attribute.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|trim)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + }, + "3": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "match": "()", + "name": "meta.tag.template.body.jsp" + }, + { + "begin": "(", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.element.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:doBody)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.dobody.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(var|varReader|scope)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.forward.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(page)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:param)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.param.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|value)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:getProperty)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.getproperty.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|property)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.include.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(page|flush)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:invoke)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.invoke.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(fragment|var|varReader|scope)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:output)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.output.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(omit-xml-declaration|doctype-root-element|doctype-system|doctype-public)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.plugin.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(type|code|codebase|name|archive|align|height|hspace|jreversion|nspluginurl|iepluginurl)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + }, + "3": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "end": ">", + "match": "()", + "name": "meta.tag.template.fallback.jsp" + }, + { + "begin": "(", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.root.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(xmlns|version|xmlns:taglibPrefix)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "(<)(jsp:setProperty)\\b", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.setproperty.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|property|value)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + }, + "3": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "end": ">", + "match": "()", + "name": "meta.tag.template.text.jsp" + }, + { + "begin": "(", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.usebean.jsp", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(id|scope|class|type|beanName)(=)((\")[^\"]*(\"))" + } + ] + } + ] + }, + "directive": { + "begin": "(<)(jsp:directive\\.(?=(attribute|include|page|tag|variable)\\s))", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + } + }, + "end": "/>", + "endCaptures": { + "0": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.tag.template.$3.jsp", + "patterns": [ + { + "begin": "\\G(attribute)(?=\\s)", + "captures": { + "1": { + "name": "entity.name.tag.jsp" + } + }, + "end": "(?=/>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name|required|fragment|rtexprvalue|type|description)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(include)(?=\\s)", + "captures": { + "1": { + "name": "entity.name.tag.jsp" + } + }, + "end": "(?=/>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(file)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(page)(?=\\s)", + "captures": { + "1": { + "name": "entity.name.tag.jsp" + } + }, + "end": "(?=/>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(language|extends|import|session|buffer|autoFlush|isThreadSafe|info|errorPage|isErrorPage|contentType|pageEncoding|isElIgnored)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(tag)(?=\\s)", + "captures": { + "1": { + "name": "entity.name.tag.jsp" + } + }, + "end": "(?=/>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(display-name|body-content|dynamic-attributes|small-icon|large-icon|description|example|language|import|pageEncoding|isELIgnored)(=)((\")[^\"]*(\"))" + } + ] + }, + { + "begin": "\\G(variable)(?=\\s)", + "captures": { + "1": { + "name": "entity.name.tag.jsp" + } + }, + "end": "(?=/>)", + "patterns": [ + { + "captures": { + "1": { + "name": "entity.other.attribute-name.jsp" + }, + "2": { + "name": "punctuation.separator.key-value.jsp" + }, + "3": { + "name": "string.quoted.double.jsp" + }, + "4": { + "name": "punctuation.definition.string.begin.jsp" + }, + "5": { + "name": "punctuation.definition.string.end.jsp" + } + }, + "match": "(name-given|alias|variable-class|declare|scope|description)(=)((\")[^\"]*(\"))" + } + ] + } + ] + }, + "embedded": { + "begin": "(<)(jsp:(declaration|expression|scriptlet))(>)", + "beginCaptures": { + "0": { + "name": "meta.tag.template.$3.jsp" + }, + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "entity.name.tag.jsp" + }, + "4": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "contentName": "source.java", + "end": "((<)/)(jsp:\\3)(>)", + "endCaptures": { + "0": { + "name": "meta.tag.template.$4.jsp" + }, + "1": { + "name": "punctuation.definition.tag.begin.jsp" + }, + "2": { + "name": "source.java" + }, + "3": { + "name": "entity.name.tag.jsp" + }, + "4": { + "name": "punctuation.definition.tag.end.jsp" + } + }, + "name": "meta.embedded.block.jsp", + "patterns": [ + { + "include": "source.java" + } + ] + } + } + } + }, + "scopeName": "text.html.jsp", + "uuid": "FFF2D8D5-6282-45DF-A508-5C254E29FFC2" +} From 6273c01d7125304e4098f473050ac831c26d6317 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 10:55:54 +0800 Subject: [PATCH 003/571] fix: `git rev-list` raises errors after selected commit in `Histories` page (#1101) Signed-off-by: leo --- src/Commands/QueryCommitChildren.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/QueryCommitChildren.cs b/src/Commands/QueryCommitChildren.cs index 6a6ed909..31fb34f8 100644 --- a/src/Commands/QueryCommitChildren.cs +++ b/src/Commands/QueryCommitChildren.cs @@ -9,7 +9,7 @@ namespace SourceGit.Commands WorkingDirectory = repo; Context = repo; _commit = commit; - Args = $"rev-list -{max} --parents --branches --remotes --ancestry-path={commit} ^{commit}"; + Args = $"rev-list -{max} --parents --branches --remotes --ancestry-path ^{commit}"; } public List Result() From 4b41029768fd7a808e13d57c579dd88e7e7d8dae Mon Sep 17 00:00:00 2001 From: Gadfly Date: Mon, 17 Mar 2025 11:31:50 +0800 Subject: [PATCH 004/571] fix: use better JSP grammar file and add licensing information (#1102) --- src/Resources/Grammars/haxe.json | 6 +- src/Resources/Grammars/hxml.json | 6 +- src/Resources/Grammars/jsp.json | 1226 ++-------------------------- src/Resources/Grammars/kotlin.json | 6 +- src/Resources/Grammars/toml.json | 5 +- 5 files changed, 76 insertions(+), 1173 deletions(-) diff --git a/src/Resources/Grammars/haxe.json b/src/Resources/Grammars/haxe.json index 12acc538..3f78154d 100644 --- a/src/Resources/Grammars/haxe.json +++ b/src/Resources/Grammars/haxe.json @@ -1,7 +1,9 @@ { "information_for_contributors": [ "This file has been copied from https://github.com/vshaxe/haxe-TmLanguage/blob/ddad8b4c6d0781ac20be0481174ec1be772c5da5/haxe.tmLanguage", - "and converted to JSON using https://marketplace.visualstudio.com/items?itemName=pedro-w.tmlanguage" + "and converted to JSON using https://marketplace.visualstudio.com/items?itemName=pedro-w.tmlanguage", + "The original file was licensed under the MIT License", + "https://github.com/vshaxe/haxe-TmLanguage/blob/ddad8b4c6d0781ac20be0481174ec1be772c5da5/LICENSE.md" ], "fileTypes": [ "hx", @@ -2485,4 +2487,4 @@ "name": "variable.other.hx" } } -} \ No newline at end of file +} diff --git a/src/Resources/Grammars/hxml.json b/src/Resources/Grammars/hxml.json index 829c403e..3be42577 100644 --- a/src/Resources/Grammars/hxml.json +++ b/src/Resources/Grammars/hxml.json @@ -1,7 +1,9 @@ { "information_for_contributors": [ "This file has been copied from https://github.com/vshaxe/haxe-TmLanguage/blob/ddad8b4c6d0781ac20be0481174ec1be772c5da5/hxml.tmLanguage", - "and converted to JSON using https://marketplace.visualstudio.com/items?itemName=pedro-w.tmlanguage" + "and converted to JSON using https://marketplace.visualstudio.com/items?itemName=pedro-w.tmlanguage", + "The original file was licensed under the MIT License", + "https://github.com/vshaxe/haxe-TmLanguage/blob/ddad8b4c6d0781ac20be0481174ec1be772c5da5/LICENSE.md" ], "fileTypes": [ "hxml" @@ -67,4 +69,4 @@ ], "scopeName": "source.hxml", "uuid": "CB1B853A-C4C8-42C3-BA70-1B1605BE51C1" -} \ No newline at end of file +} diff --git a/src/Resources/Grammars/jsp.json b/src/Resources/Grammars/jsp.json index f0067748..2fbfd97c 100644 --- a/src/Resources/Grammars/jsp.json +++ b/src/Resources/Grammars/jsp.json @@ -1,1206 +1,100 @@ { "information_for_contributors": [ - "This file has been copied from https://github.com/J0hnMilt0n/vscode-jsp/blob/b33b7e4d47f3b5f4b82e93dfcadd180149153d02/syntaxes/jsp.tmLanguage.json" + "This file has been copied from https://github.com/samuel-weinhardt/vscode-jsp-lang/blob/0e89ecdb13650dbbe5a1e85b47b2e1530bf2f355/syntaxes/jsp.tmLanguage.json", + "The original file was licensed under the MIT License", + "https://github.com/samuel-weinhardt/vscode-jsp-lang/blob/0e89ecdb13650dbbe5a1e85b47b2e1530bf2f355/LICENSE" ], - "fileTypes": [ - "jsp", - "jspf", - "tag" + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Jakarta Server Pages", + "fileTypes": ["jsp", "jspf", "tag"], + "scopeName": "text.html.jsp", + "patterns": [ + { "include": "#comment" }, + { "include": "#directive" }, + { "include": "#expression" }, + { "include": "text.html.derivative" } ], "injections": { - "text.html.jsp - (meta.embedded.block.jsp | meta.embedded.line.jsp | meta.tag | comment), meta.tag string.quoted": { + "L:text.html.jsp -comment -meta.tag.directive.jsp -meta.tag.scriptlet.jsp": { "patterns": [ - { - "include": "#comment" - }, - { - "include": "#declaration" - }, - { - "include": "#expression" - }, - { - "include": "#el_expression" - }, - { - "include": "#tags" - }, - { - "begin": "(^\\s*)(?=<%(?=\\s))", - "beginCaptures": { - "0": { - "name": "punctuation.whitespace.embedded.leading.erb" - } - }, - "end": "(?!\\G)(\\s*$\\n)?", - "endCaptures": { - "0": { - "name": "punctuation.whitespace.embedded.trailing.erb" - } - }, - "patterns": [ - { - "include": "#scriptlet" - } - ] - }, - { - "include": "#scriptlet" - } - ] + { "include": "#scriptlet" } + ], + "comment": "allow scriptlets anywhere except comments and nested" + }, + "L:meta.attribute (string.quoted.single.html | string.quoted.double.html) -string.template.expression.jsp": { + "patterns": [ + { "include": "#expression" }, + { "include": "text.html.derivative" } + ], + "comment": "allow expressions and tags within HTML attributes (not nested)" } }, - "keyEquivalent": "^~J", - "name": "JavaServer Pages", - "patterns": [ - { - "include": "#xml_tags" - }, - { - "include": "text.html.basic" - } - ], "repository": { "comment": { + "name": "comment.block.jsp", "begin": "<%--", - "captures": { - "0": { - "name": "punctuation.definition.comment.jsp" - } - }, - "end": "--%>", - "name": "comment.block.jsp" + "end": "--%>" }, - "declaration": { - "begin": "<%!", + "directive": { + "name": "meta.tag.directive.jsp", + "begin": "(<)(%@)", + "end": "(%)(>)", "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.jsp" - } + "1": { "name": "punctuation.definition.tag.jsp" }, + "2": { "name": "entity.name.tag.jsp" } }, - "contentName": "source.java", - "end": "(%)>", "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.jsp" - }, - "1": { - "name": "source.java" - } + "1": { "name": "entity.name.tag.jsp" }, + "2": { "name": "punctuation.definition.tag.jsp" } }, - "name": "meta.embedded.line.declaration.jsp", "patterns": [ { - "include": "source.java" - } - ] - }, - "el_expression": { - "begin": "\\$\\{", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.jsp" - } - }, - "contentName": "source.java", - "end": "(\\})", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.jsp" + "match": "\\b(attribute|include|page|tag|taglib|variable)\\b(?!\\s*=)", + "name": "keyword.control.directive.jsp" }, - "1": { - "name": "source.java" - } - }, - "name": "meta.embedded.line.el_expression.jsp", - "patterns": [ - { - "include": "source.java" - } - ] - }, - "expression": { - "begin": "<%=", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.jsp" - } - }, - "contentName": "source.java", - "end": "(%)>", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.jsp" - }, - "1": { - "name": "source.java" - } - }, - "name": "meta.embedded.line.expression.jsp", - "patterns": [ - { - "include": "source.java" - } + { "include": "text.html.basic#attribute" } ] }, "scriptlet": { - "begin": "<%", + "name": "meta.tag.scriptlet.jsp", + "contentName": "meta.embedded.block.java", + "begin": "(<)(%[\\s!=])", + "end": "(%)(>)", "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.jsp" - } + "1": { "name": "punctuation.definition.tag.jsp" }, + "2": { "name": "entity.name.tag.jsp" } }, - "contentName": "source.java", - "end": "(%)>", "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.jsp" - }, - "1": { - "name": "source.java" - } + "1": { "name": "entity.name.tag.jsp" }, + "2": { "name": "punctuation.definition.tag.jsp" } }, - "name": "meta.embedded.block.scriptlet.jsp", "patterns": [ { - "match": "\\{", - "name": "punctuation.section.scope.begin.java" + "match": "\\{(?=\\s*(%>|$))", + "comment": "consume trailing curly brackets for fragmented scriptlets" }, - { - "match": "\\}", - "name": "punctuation.section.scope.end.java" - }, - { - "include": "source.java" - } + { "include": "source.java" } ] }, - "tags": { - "begin": "(<%@)\\s*(?=(attribute|include|page|tag|taglib|variable)\\s)", + "expression": { + "name": "string.template.expression.jsp", + "contentName": "meta.embedded.block.java", + "begin": "[$#]\\{", + "end": "\\}", "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - } + "0": { "name": "punctuation.definition.template-expression.begin.jsp" } }, - "end": "%>", "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } + "0": { "name": "punctuation.definition.template-expression.end.jsp" } }, - "name": "meta.tag.template.include.jsp", "patterns": [ - { - "begin": "\\G(attribute)(?=\\s)", - "captures": { - "1": { - "name": "keyword.control.attribute.jsp" - } - }, - "end": "(?=%>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(name|required|fragment|rtexprvalue|type|description)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "\\G(include)(?=\\s)", - "captures": { - "1": { - "name": "keyword.control.include.jsp" - } - }, - "end": "(?=%>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(file)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "\\G(page)(?=\\s)", - "captures": { - "1": { - "name": "keyword.control.page.jsp" - } - }, - "end": "(?=%>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(language|extends|import|session|buffer|autoFlush|isThreadSafe|info|errorPage|isErrorPage|contentType|pageEncoding|isElIgnored)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "\\G(tag)(?=\\s)", - "captures": { - "1": { - "name": "keyword.control.tag.jsp" - } - }, - "end": "(?=%>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(display-name|body-content|dynamic-attributes|small-icon|large-icon|description|example|language|import|pageEncoding|isELIgnored)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "\\G(taglib)(?=\\s)", - "captures": { - "1": { - "name": "keyword.control.taglib.jsp" - } - }, - "end": "(?=%>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(uri|tagdir|prefix)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "\\G(variable)(?=\\s)", - "captures": { - "1": { - "name": "keyword.control.variable.jsp" - } - }, - "end": "(?=%>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(name-given|alias|variable-class|declare|scope|description)(=)((\")[^\"]*(\"))" - } - ] - } + { "include": "#escape" }, + { "include": "source.java" } ] }, - "xml_tags": { - "patterns": [ - { - "begin": "(^\\s*)(?=)", - "beginCaptures": { - "0": { - "name": "punctuation.whitespace.embedded.leading.erb" - } - }, - "end": "(?!\\G)(\\s*$\\n)?", - "endCaptures": { - "0": { - "name": "punctuation.whitespace.embedded.trailing.erb" - } - }, - "patterns": [ - { - "include": "#embedded" - } - ] - }, - { - "include": "#embedded" - }, - { - "include": "#directive" - }, - { - "include": "#actions" - } - ], - "repository": { - "actions": { - "patterns": [ - { - "begin": "(", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.attribute.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(name|trim)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "captures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - }, - "3": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "match": "()", - "name": "meta.tag.template.body.jsp" - }, - { - "begin": "(", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.element.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(name)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "(<)(jsp:doBody)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - } - }, - "end": "/>", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.dobody.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(var|varReader|scope)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "(", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.forward.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(page)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "(<)(jsp:param)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - } - }, - "end": "/>", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.param.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(name|value)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "(<)(jsp:getProperty)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - } - }, - "end": "/>", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.getproperty.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(name|property)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "(", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.include.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(page|flush)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "(<)(jsp:invoke)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - } - }, - "end": "/>", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.invoke.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(fragment|var|varReader|scope)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "(<)(jsp:output)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - } - }, - "end": "/>", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.output.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(omit-xml-declaration|doctype-root-element|doctype-system|doctype-public)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "(", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.plugin.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(type|code|codebase|name|archive|align|height|hspace|jreversion|nspluginurl|iepluginurl)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "captures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - }, - "3": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "end": ">", - "match": "()", - "name": "meta.tag.template.fallback.jsp" - }, - { - "begin": "(", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.root.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(xmlns|version|xmlns:taglibPrefix)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "(<)(jsp:setProperty)\\b", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - } - }, - "end": "/>", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.setproperty.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(name|property|value)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "captures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - }, - "3": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "end": ">", - "match": "()", - "name": "meta.tag.template.text.jsp" - }, - { - "begin": "(", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.usebean.jsp", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(id|scope|class|type|beanName)(=)((\")[^\"]*(\"))" - } - ] - } - ] - }, - "directive": { - "begin": "(<)(jsp:directive\\.(?=(attribute|include|page|tag|variable)\\s))", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - } - }, - "end": "/>", - "endCaptures": { - "0": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.tag.template.$3.jsp", - "patterns": [ - { - "begin": "\\G(attribute)(?=\\s)", - "captures": { - "1": { - "name": "entity.name.tag.jsp" - } - }, - "end": "(?=/>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(name|required|fragment|rtexprvalue|type|description)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "\\G(include)(?=\\s)", - "captures": { - "1": { - "name": "entity.name.tag.jsp" - } - }, - "end": "(?=/>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(file)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "\\G(page)(?=\\s)", - "captures": { - "1": { - "name": "entity.name.tag.jsp" - } - }, - "end": "(?=/>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(language|extends|import|session|buffer|autoFlush|isThreadSafe|info|errorPage|isErrorPage|contentType|pageEncoding|isElIgnored)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "\\G(tag)(?=\\s)", - "captures": { - "1": { - "name": "entity.name.tag.jsp" - } - }, - "end": "(?=/>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(display-name|body-content|dynamic-attributes|small-icon|large-icon|description|example|language|import|pageEncoding|isELIgnored)(=)((\")[^\"]*(\"))" - } - ] - }, - { - "begin": "\\G(variable)(?=\\s)", - "captures": { - "1": { - "name": "entity.name.tag.jsp" - } - }, - "end": "(?=/>)", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.jsp" - }, - "2": { - "name": "punctuation.separator.key-value.jsp" - }, - "3": { - "name": "string.quoted.double.jsp" - }, - "4": { - "name": "punctuation.definition.string.begin.jsp" - }, - "5": { - "name": "punctuation.definition.string.end.jsp" - } - }, - "match": "(name-given|alias|variable-class|declare|scope|description)(=)((\")[^\"]*(\"))" - } - ] - } - ] - }, - "embedded": { - "begin": "(<)(jsp:(declaration|expression|scriptlet))(>)", - "beginCaptures": { - "0": { - "name": "meta.tag.template.$3.jsp" - }, - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "entity.name.tag.jsp" - }, - "4": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "contentName": "source.java", - "end": "((<)/)(jsp:\\3)(>)", - "endCaptures": { - "0": { - "name": "meta.tag.template.$4.jsp" - }, - "1": { - "name": "punctuation.definition.tag.begin.jsp" - }, - "2": { - "name": "source.java" - }, - "3": { - "name": "entity.name.tag.jsp" - }, - "4": { - "name": "punctuation.definition.tag.end.jsp" - } - }, - "name": "meta.embedded.block.jsp", - "patterns": [ - { - "include": "source.java" - } - ] - } - } + "escape": { + "match": "\\\\.", + "name": "constant.character.escape.jsp" } - }, - "scopeName": "text.html.jsp", - "uuid": "FFF2D8D5-6282-45DF-A508-5C254E29FFC2" + } } diff --git a/src/Resources/Grammars/kotlin.json b/src/Resources/Grammars/kotlin.json index e8f844d0..2857f717 100644 --- a/src/Resources/Grammars/kotlin.json +++ b/src/Resources/Grammars/kotlin.json @@ -1,6 +1,8 @@ { "information_for_contributors": [ - "This file has been copied from https://github.com/eclipse/buildship/blob/6bb773e7692f913dec27105129ebe388de34e68b/org.eclipse.buildship.kotlindsl.provider/kotlin.tmLanguage.json" + "This file has been copied from https://github.com/eclipse/buildship/blob/6bb773e7692f913dec27105129ebe388de34e68b/org.eclipse.buildship.kotlindsl.provider/kotlin.tmLanguage.json", + "The original file was licensed under the Eclipse Public License, Version 1.0", + "https://github.com/eclipse-buildship/buildship/blob/6bb773e7692f913dec27105129ebe388de34e68b/README.md" ], "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "Kotlin", @@ -698,4 +700,4 @@ "name": "variable.language.this.kotlin" } } -} \ No newline at end of file +} diff --git a/src/Resources/Grammars/toml.json b/src/Resources/Grammars/toml.json index 86c2ef87..6be4678f 100644 --- a/src/Resources/Grammars/toml.json +++ b/src/Resources/Grammars/toml.json @@ -3,7 +3,10 @@ "scopeName": "source.toml", "uuid": "8b4e5008-c50d-11ea-a91b-54ee75aeeb97", "information_for_contributors": [ - "Originally was maintained by aster (galaster@foxmail.com). This notice is only kept here for the record, please don't send e-mails about bugs and other issues." + "Originally was maintained by aster (galaster@foxmail.com). This notice is only kept here for the record, please don't send e-mails about bugs and other issues.", + "This file has been copied from https://github.com/kkiyama117/coc-toml/blob/main/toml.tmLanguage.json", + "The original file was licensed under the MIT License", + "https://github.com/kkiyama117/coc-toml/blob/main/LICENSE" ], "patterns": [ { From a480ba0139f0f5c792a722b017ca6bcfcb70d389 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Mon, 17 Mar 2025 11:41:13 +0800 Subject: [PATCH 005/571] docs: Add third-party components and licenses section (cherry picked from commit 95c697248755f7b6de4d2d0bfdaa9de1e572c9f6) --- README.md | 4 ++++ THIRD-PARTY-LICENSES.md | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 THIRD-PARTY-LICENSES.md diff --git a/README.md b/README.md index c932ec8a..670456c2 100644 --- a/README.md +++ b/README.md @@ -201,3 +201,7 @@ dotnet run --project src/SourceGit.csproj Thanks to all the people who contribute. [![Contributors](https://contrib.rocks/image?repo=sourcegit-scm/sourcegit&columns=20)](https://github.com/sourcegit-scm/sourcegit/graphs/contributors) + +## Third-Party Components + +For detailed license information, see [THIRD-PARTY-LICENSES.md](THIRD-PARTY-LICENSES.md). diff --git a/THIRD-PARTY-LICENSES.md b/THIRD-PARTY-LICENSES.md new file mode 100644 index 00000000..6188ad8b --- /dev/null +++ b/THIRD-PARTY-LICENSES.md @@ -0,0 +1,38 @@ +# Third-Party Licenses + +This project incorporates components from the following third parties: + +## haxe-TmLanguage + +- **Source**: https://github.com/vshaxe/haxe-TmLanguage +- **Commit**: ddad8b4c6d0781ac20be0481174ec1be772c5da5 +- **License**: MIT License +- **License Link**: https://github.com/vshaxe/haxe-TmLanguage/blob/ddad8b4c6d0781ac20be0481174ec1be772c5da5/LICENSE.md + +## coc-toml + +- **Source**: https://github.com/kkiyama117/coc-toml +- **Commit**: aac3e0c65955c03314b2733041b19f903b7cc447 +- **License**: MIT License +- **License Link**: https://github.com/kkiyama117/coc-toml/blob/aac3e0c65955c03314b2733041b19f903b7cc447/LICENSE + +## eclipse-buildship + +- **Source**: https://github.com/eclipse/buildship +- **Commit**: 6bb773e7692f913dec27105129ebe388de34e68b +- **License**: Eclipse Public License 1.0 +- **License Link**: https://github.com/eclipse-buildship/buildship/blob/6bb773e7692f913dec27105129ebe388de34e68b/README.md + +## vscode-jsp-lang + +- **Source**: https://github.com/samuel-weinhardt/vscode-jsp-lang +- **Commit**: 0e89ecdb13650dbbe5a1e85b47b2e1530bf2f355 +- **License**: MIT License +- **License Link**: https://github.com/samuel-weinhardt/vscode-jsp-lang/blob/0e89ecdb13650dbbe5a1e85b47b2e1530bf2f355/LICENSE + +## JetBrainsMono + +- **Source**: https://github.com/JetBrains/JetBrainsMono +- **Commit**: v2.304 +- **License**: SIL Open Font License, Version 1.1 +- **License Link**: https://github.com/JetBrains/JetBrainsMono/blob/v2.304/OFL.txt From 8f8385072c7a0ef1bb527c93921d335d38edfc94 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 11:56:33 +0800 Subject: [PATCH 006/571] doc: add third-party components Signed-off-by: leo --- THIRD-PARTY-LICENSES.md | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/THIRD-PARTY-LICENSES.md b/THIRD-PARTY-LICENSES.md index 6188ad8b..e4e0e07b 100644 --- a/THIRD-PARTY-LICENSES.md +++ b/THIRD-PARTY-LICENSES.md @@ -2,6 +2,48 @@ This project incorporates components from the following third parties: +## AvaloniaUI + +- **Source**: https://github.com/AvaloniaUI/Avalonia +- **Version**: 11.2.5 +- **License**: MIT License +- **License Link**: https://github.com/AvaloniaUI/Avalonia/blob/master/licence.md + +## AvaloniaEdit + +- **Source**: https://github.com/AvaloniaUI/AvaloniaEdit +- **Version**: 11.2.0 +- **License**: MIT License +- **License Link**: https://github.com/AvaloniaUI/AvaloniaEdit/blob/master/LICENSE + +## LiveChartsCore.SkiaSharpView.Avalonia + +- **Source**: https://github.com/beto-rodriguez/LiveCharts2 +- **Version**: 2.0.0-rc5.4 +- **License**: MIT License +- **License Link**: https://github.com/beto-rodriguez/LiveCharts2/blob/master/LICENSE + +## TextMateSharp + +- **Source**: https://github.com/danipen/TextMateSharp +- **Version**: 1.0.66 +- **License**: MIT License +- **License Link**: https://github.com/danipen/TextMateSharp/blob/master/LICENSE.md + +## OpenAI .NET SDK + +- **Source**: https://github.com/openai/openai-dotnet +- **Version**: 2.2.0-beta2 +- **License**: MIT License +- **License Link**: https://github.com/openai/openai-dotnet/blob/main/LICENSE + +## Azure.AI.OpenAI + +- **Source**: https://github.com/Azure/azure-sdk-for-net +- **Version**: 2.2.0-beta2 +- **License**: MIT License +- **License Link**: https://github.com/Azure/azure-sdk-for-net/blob/main/LICENSE.txt + ## haxe-TmLanguage - **Source**: https://github.com/vshaxe/haxe-TmLanguage @@ -36,3 +78,4 @@ This project incorporates components from the following third parties: - **Commit**: v2.304 - **License**: SIL Open Font License, Version 1.1 - **License Link**: https://github.com/JetBrains/JetBrainsMono/blob/v2.304/OFL.txt + From 99a45335feb91dc588baabab01676d4abe4eb880 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 12:01:29 +0800 Subject: [PATCH 007/571] doc: group third-party components by types Signed-off-by: leo --- THIRD-PARTY-LICENSES.md | 73 ++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/THIRD-PARTY-LICENSES.md b/THIRD-PARTY-LICENSES.md index e4e0e07b..722414b2 100644 --- a/THIRD-PARTY-LICENSES.md +++ b/THIRD-PARTY-LICENSES.md @@ -2,80 +2,85 @@ This project incorporates components from the following third parties: -## AvaloniaUI +## Packages + +### AvaloniaUI - **Source**: https://github.com/AvaloniaUI/Avalonia - **Version**: 11.2.5 - **License**: MIT License - **License Link**: https://github.com/AvaloniaUI/Avalonia/blob/master/licence.md -## AvaloniaEdit +### AvaloniaEdit - **Source**: https://github.com/AvaloniaUI/AvaloniaEdit - **Version**: 11.2.0 - **License**: MIT License - **License Link**: https://github.com/AvaloniaUI/AvaloniaEdit/blob/master/LICENSE -## LiveChartsCore.SkiaSharpView.Avalonia +### LiveChartsCore.SkiaSharpView.Avalonia - **Source**: https://github.com/beto-rodriguez/LiveCharts2 - **Version**: 2.0.0-rc5.4 - **License**: MIT License - **License Link**: https://github.com/beto-rodriguez/LiveCharts2/blob/master/LICENSE -## TextMateSharp +### TextMateSharp - **Source**: https://github.com/danipen/TextMateSharp - **Version**: 1.0.66 - **License**: MIT License - **License Link**: https://github.com/danipen/TextMateSharp/blob/master/LICENSE.md -## OpenAI .NET SDK +### OpenAI .NET SDK - **Source**: https://github.com/openai/openai-dotnet - **Version**: 2.2.0-beta2 - **License**: MIT License - **License Link**: https://github.com/openai/openai-dotnet/blob/main/LICENSE -## Azure.AI.OpenAI +### Azure.AI.OpenAI - **Source**: https://github.com/Azure/azure-sdk-for-net - **Version**: 2.2.0-beta2 - **License**: MIT License - **License Link**: https://github.com/Azure/azure-sdk-for-net/blob/main/LICENSE.txt -## haxe-TmLanguage +## Fonts -- **Source**: https://github.com/vshaxe/haxe-TmLanguage -- **Commit**: ddad8b4c6d0781ac20be0481174ec1be772c5da5 -- **License**: MIT License -- **License Link**: https://github.com/vshaxe/haxe-TmLanguage/blob/ddad8b4c6d0781ac20be0481174ec1be772c5da5/LICENSE.md - -## coc-toml - -- **Source**: https://github.com/kkiyama117/coc-toml -- **Commit**: aac3e0c65955c03314b2733041b19f903b7cc447 -- **License**: MIT License -- **License Link**: https://github.com/kkiyama117/coc-toml/blob/aac3e0c65955c03314b2733041b19f903b7cc447/LICENSE - -## eclipse-buildship - -- **Source**: https://github.com/eclipse/buildship -- **Commit**: 6bb773e7692f913dec27105129ebe388de34e68b -- **License**: Eclipse Public License 1.0 -- **License Link**: https://github.com/eclipse-buildship/buildship/blob/6bb773e7692f913dec27105129ebe388de34e68b/README.md - -## vscode-jsp-lang - -- **Source**: https://github.com/samuel-weinhardt/vscode-jsp-lang -- **Commit**: 0e89ecdb13650dbbe5a1e85b47b2e1530bf2f355 -- **License**: MIT License -- **License Link**: https://github.com/samuel-weinhardt/vscode-jsp-lang/blob/0e89ecdb13650dbbe5a1e85b47b2e1530bf2f355/LICENSE - -## JetBrainsMono +### JetBrainsMono - **Source**: https://github.com/JetBrains/JetBrainsMono - **Commit**: v2.304 - **License**: SIL Open Font License, Version 1.1 - **License Link**: https://github.com/JetBrains/JetBrainsMono/blob/v2.304/OFL.txt +## Gramar Files + +### haxe-TmLanguage + +- **Source**: https://github.com/vshaxe/haxe-TmLanguage +- **Commit**: ddad8b4c6d0781ac20be0481174ec1be772c5da5 +- **License**: MIT License +- **License Link**: https://github.com/vshaxe/haxe-TmLanguage/blob/ddad8b4c6d0781ac20be0481174ec1be772c5da5/LICENSE.md + +### coc-toml + +- **Source**: https://github.com/kkiyama117/coc-toml +- **Commit**: aac3e0c65955c03314b2733041b19f903b7cc447 +- **License**: MIT License +- **License Link**: https://github.com/kkiyama117/coc-toml/blob/aac3e0c65955c03314b2733041b19f903b7cc447/LICENSE + +### eclipse-buildship + +- **Source**: https://github.com/eclipse/buildship +- **Commit**: 6bb773e7692f913dec27105129ebe388de34e68b +- **License**: Eclipse Public License 1.0 +- **License Link**: https://github.com/eclipse-buildship/buildship/blob/6bb773e7692f913dec27105129ebe388de34e68b/README.md + +### vscode-jsp-lang + +- **Source**: https://github.com/samuel-weinhardt/vscode-jsp-lang +- **Commit**: 0e89ecdb13650dbbe5a1e85b47b2e1530bf2f355 +- **License**: MIT License +- **License Link**: https://github.com/samuel-weinhardt/vscode-jsp-lang/blob/0e89ecdb13650dbbe5a1e85b47b2e1530bf2f355/LICENSE From 10fd0f9d15d0d58f0f27c5128c97b9abbdaea161 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 12:02:32 +0800 Subject: [PATCH 008/571] doc: fix typo Signed-off-by: leo --- THIRD-PARTY-LICENSES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/THIRD-PARTY-LICENSES.md b/THIRD-PARTY-LICENSES.md index 722414b2..2338263c 100644 --- a/THIRD-PARTY-LICENSES.md +++ b/THIRD-PARTY-LICENSES.md @@ -55,7 +55,7 @@ This project incorporates components from the following third parties: - **License**: SIL Open Font License, Version 1.1 - **License Link**: https://github.com/JetBrains/JetBrainsMono/blob/v2.304/OFL.txt -## Gramar Files +## Grammar Files ### haxe-TmLanguage From ddfc868df3c20acd77a74d4c12ecaf07c22c6c04 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 15:08:49 +0800 Subject: [PATCH 009/571] ux: re-design merge option style Signed-off-by: leo --- src/Models/MergeMode.cs | 2 +- src/ViewModels/Merge.cs | 10 +++++----- src/Views/Merge.axaml | 27 ++++++++++++++++++++++----- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/Models/MergeMode.cs b/src/Models/MergeMode.cs index 15e3f7e9..e4389b32 100644 --- a/src/Models/MergeMode.cs +++ b/src/Models/MergeMode.cs @@ -6,7 +6,7 @@ [ new MergeMode("Default", "Fast-forward if possible", ""), new MergeMode("No Fast-forward", "Always create a merge commit", "--no-ff"), - new MergeMode("Squash", "Use '--squash'", "--squash"), + new MergeMode("Squash", "Squash merge", "--squash"), new MergeMode("Don't commit", "Merge without commit", "--no-ff --no-commit"), ]; diff --git a/src/ViewModels/Merge.cs b/src/ViewModels/Merge.cs index 174bb1e1..bde9b66d 100644 --- a/src/ViewModels/Merge.cs +++ b/src/ViewModels/Merge.cs @@ -15,7 +15,7 @@ namespace SourceGit.ViewModels get; } - public Models.MergeMode SelectedMode + public Models.MergeMode Mode { get; set; @@ -28,7 +28,7 @@ namespace SourceGit.ViewModels Source = source; Into = into; - SelectedMode = AutoSelectMergeMode(); + Mode = AutoSelectMergeMode(); View = new Views.Merge() { DataContext = this }; } @@ -39,7 +39,7 @@ namespace SourceGit.ViewModels Source = source; Into = into; - SelectedMode = AutoSelectMergeMode(); + Mode = AutoSelectMergeMode(); View = new Views.Merge() { DataContext = this }; } @@ -50,7 +50,7 @@ namespace SourceGit.ViewModels Source = source; Into = into; - SelectedMode = AutoSelectMergeMode(); + Mode = AutoSelectMergeMode(); View = new Views.Merge() { DataContext = this }; } @@ -61,7 +61,7 @@ namespace SourceGit.ViewModels return Task.Run(() => { - new Commands.Merge(_repo.FullPath, _sourceName, SelectedMode.Arg, SetProgressDescription).Exec(); + new Commands.Merge(_repo.FullPath, _sourceName, Mode.Arg, SetProgressDescription).Exec(); CallUIThread(() => _repo.SetWatcherEnabled(true)); return true; }); diff --git a/src/Views/Merge.axaml b/src/Views/Merge.axaml index 805ac6d0..b7c76b6b 100644 --- a/src/Views/Merge.axaml +++ b/src/Views/Merge.axaml @@ -60,15 +60,32 @@ Height="28" Padding="8,0" VerticalAlignment="Center" HorizontalAlignment="Stretch" ItemsSource="{Binding Source={x:Static m:MergeMode.Supported}}" - SelectedItem="{Binding SelectedMode, Mode=TwoWay}"> + SelectedItem="{Binding Mode, Mode=TwoWay}" + Grid.IsSharedSizeScope="True"> - - - - + + + + + + + + + + + + + + + + + + + + From cdd1926e2f2eb4be2c1ee381c2e567787ea79599 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 15:30:32 +0800 Subject: [PATCH 010/571] refactor: rewrite `git apply` implementation - Do not translate commandline options for `git` - Re-design combox layout for `git apply` popup Signed-off-by: leo --- src/Models/ApplyWhiteSpaceMode.cs | 12 ++++++++++-- src/Resources/Locales/de_DE.axaml | 8 -------- src/Resources/Locales/en_US.axaml | 8 -------- src/Resources/Locales/es_ES.axaml | 8 -------- src/Resources/Locales/fr_FR.axaml | 8 -------- src/Resources/Locales/it_IT.axaml | 8 -------- src/Resources/Locales/pt_BR.axaml | 8 -------- src/Resources/Locales/ru_RU.axaml | 8 -------- src/Resources/Locales/zh_CN.axaml | 8 -------- src/Resources/Locales/zh_TW.axaml | 8 -------- src/ViewModels/Apply.cs | 20 ++------------------ src/Views/Apply.axaml | 31 ++++++++++++++++++++++++------- 12 files changed, 36 insertions(+), 99 deletions(-) diff --git a/src/Models/ApplyWhiteSpaceMode.cs b/src/Models/ApplyWhiteSpaceMode.cs index 6fbce0b2..aad45f57 100644 --- a/src/Models/ApplyWhiteSpaceMode.cs +++ b/src/Models/ApplyWhiteSpaceMode.cs @@ -2,14 +2,22 @@ { public class ApplyWhiteSpaceMode { + public static readonly ApplyWhiteSpaceMode[] Supported = + [ + new ApplyWhiteSpaceMode("No Warn", "Turns off the trailing whitespace warning", "nowarn"), + new ApplyWhiteSpaceMode("Warn", "Outputs warnings for a few such errors, but applies", "warn"), + new ApplyWhiteSpaceMode("Error", "Raise errors and refuses to apply the patch", "error"), + new ApplyWhiteSpaceMode("Error All", "Similar to 'error', but shows more", "error-all"), + ]; + public string Name { get; set; } public string Desc { get; set; } public string Arg { get; set; } public ApplyWhiteSpaceMode(string n, string d, string a) { - Name = App.Text(n); - Desc = App.Text(d); + Name = n; + Desc = d; Arg = a; } } diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index aff8ffc5..31dc1d9b 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -25,18 +25,10 @@ Verwende OpenAI, um Commit-Nachrichten zu generieren Als Commit-Nachricht verwenden Patch - Fehler - Fehler werfen und anwenden des Patches verweigern - Alle Fehler - Ähnlich wie 'Fehler', zeigt aber mehr an Patch-Datei: Wähle die anzuwendende .patch-Datei Ignoriere Leerzeichenänderungen - Keine Warnungen - Keine Warnung vor Leerzeichen am Zeilenende Patch anwenden - Warnen - Gibt eine Warnung für ein paar solcher Fehler aus, aber wendet es an Leerzeichen: Stash anwenden Nach dem Anwenden löschen diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 818bd9bb..b1f83836 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -22,18 +22,10 @@ Use AI to generate commit message APPLY AS COMMIT MESSAGE Patch - Error - Raise errors and refuses to apply the patch - Error All - Similar to 'error', but shows more Patch File: Select .patch file to apply Ignore whitespace changes - No Warn - Turns off the trailing whitespace warning Apply Patch - Warn - Outputs warnings for a few such errors, but applies Whitespace: Apply Stash Delete after applying diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index e909a14e..6bf38df1 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -25,18 +25,10 @@ Usar OpenAI para generar mensaje de commit APLICAR CÓMO MENSAJE DE COMMIT Aplicar Parche - Error - Genera errores y se niega a aplicar el parche - Error Todo - Similar a 'error', pero muestra más Archivo del Parche: Seleccionar archivo .patch para aplicar Ignorar cambios de espacios en blanco - Sin Advertencia - Desactiva la advertencia de espacios en blanco al final Aplicar Parche - Advertencia - Genera advertencias para algunos de estos errores, pero aplica Espacios en Blanco: Aplicar Stash Borrar después de aplicar diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index aecea9ad..ebb3ba89 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -23,18 +23,10 @@ Assistant IA Utiliser l'IA pour générer un message de commit Appliquer - Erreur - Soulever les erreurs et refuser d'appliquer le patch - Toutes les erreurs - Similaire à 'Erreur', mais plus détaillé Fichier de patch : Selectionner le fichier .patch à appliquer Ignorer les changements d'espaces blancs - Pas d'avertissement - Désactiver l'avertissement sur les espaces blancs terminaux Appliquer le patch - Avertissement - Affiche des avertissements pour ce type d'erreurs tout en appliquant le patch Espaces blancs : Archiver... Enregistrer l'archive sous : diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index 4dcc8771..ebfd3939 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -25,18 +25,10 @@ Usa AI per generare il messaggio di commit APPLICA COME 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: Applica lo stash Rimuovi dopo aver applicato diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index b146bf0e..b4677840 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -48,18 +48,10 @@ Assietente IA Utilizar IA para gerar mensagem de commit Patch - 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: diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 07fb7c94..b2ba2158 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -25,18 +25,10 @@ Использовать OpenAI для создания сообщения о ревизии ПРИМЕНИТЬ КАК СООБЩЕНИЕ РЕВИЗИИ Исправить - Ошибка - Выдает ошибки и отказывается применять заплатку - Все ошибки - Аналогично «ошибке», но показывает больше Файл заплатки: Выберите файл .patch для применения Игнорировать изменения пробелов - Нет предупреждений - Отключить предупреждения о пробелах в конце Применить заплатку - Предупреждать - Выдавать предупреждения о нескольких таких ошибках, но применять Пробел: Отложить Удалить после применения diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 2d160ad2..768061dd 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -25,18 +25,10 @@ 使用AI助手生成提交信息 应用本次生成 应用补丁(apply) - 错误 - 输出错误,并终止应用补丁 - 更多错误 - 与【错误】级别相似,但输出内容更多 补丁文件 : 选择补丁文件 忽略空白符号 - 忽略 - 关闭所有警告 应用补丁 - 警告 - 应用补丁,输出关于空白符的警告 空白符号处理 : 应用贮藏 在成功应用后丢弃该贮藏 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index e50a600d..6d63c1ee 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -25,18 +25,10 @@ 使用 AI 產生提交訊息 套用為提交訊息 套用修補檔 (apply patch) - 錯誤 - 輸出錯誤,並中止套用修補檔 - 更多錯誤 - 與 [錯誤] 級別相似,但輸出更多內容 修補檔: 選擇修補檔 忽略空白符號 - 忽略 - 關閉所有警告 套用修補檔 - 警告 - 套用修補檔,輸出關於空白字元的警告 空白字元處理: 套用擱置變更 套用擱置變更後刪除 diff --git a/src/ViewModels/Apply.cs b/src/ViewModels/Apply.cs index 09567761..60001476 100644 --- a/src/ViewModels/Apply.cs +++ b/src/ViewModels/Apply.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.IO; using System.Threading.Tasks; @@ -21,12 +20,6 @@ namespace SourceGit.ViewModels set => SetProperty(ref _ignoreWhiteSpace, value); } - public List WhiteSpaceModes - { - get; - private set; - } - public Models.ApplyWhiteSpaceMode SelectedWhiteSpaceMode { get; @@ -37,23 +30,14 @@ namespace SourceGit.ViewModels { _repo = repo; - WhiteSpaceModes = new List { - new Models.ApplyWhiteSpaceMode("Apply.NoWarn", "Apply.NoWarn.Desc", "nowarn"), - new Models.ApplyWhiteSpaceMode("Apply.Warn", "Apply.Warn.Desc", "warn"), - new Models.ApplyWhiteSpaceMode("Apply.Error", "Apply.Error.Desc", "error"), - new Models.ApplyWhiteSpaceMode("Apply.ErrorAll", "Apply.ErrorAll.Desc", "error-all") - }; - SelectedWhiteSpaceMode = WhiteSpaceModes[0]; - + SelectedWhiteSpaceMode = Models.ApplyWhiteSpaceMode.Supported[0]; View = new Views.Apply() { DataContext = this }; } public static ValidationResult ValidatePatchFile(string file, ValidationContext _) { if (File.Exists(file)) - { return ValidationResult.Success; - } return new ValidationResult($"File '{file}' can NOT be found!!!"); } diff --git a/src/Views/Apply.axaml b/src/Views/Apply.axaml index a5100cd6..6c2478bb 100644 --- a/src/Views/Apply.axaml +++ b/src/Views/Apply.axaml @@ -39,17 +39,34 @@ + IsEnabled="{Binding !IgnoreWhiteSpace}" + Grid.IsSharedSizeScope="True"> - - - - - + + + + + + + + + + + + + + + + + + + + + Date: Mon, 17 Mar 2025 07:30:48 +0000 Subject: [PATCH 011/571] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 670456c2..f9216874 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.07%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-%E2%88%9A-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-91.66%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-99.87%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-91.39%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.06%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-%E2%88%9A-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-91.57%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-99.87%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-91.30%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen)](TRANSLATION.md) > [!NOTE] > You can find the missing keys in [TRANSLATION.md](TRANSLATION.md) diff --git a/TRANSLATION.md b/TRANSLATION.md index e3f9d2a1..ae9f4777 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,4 +1,4 @@ -### de_DE.axaml: 99.07% +### de_DE.axaml: 99.06%
@@ -24,7 +24,7 @@
-### fr_FR.axaml: 91.66% +### fr_FR.axaml: 91.57%
@@ -106,7 +106,7 @@
-### pt_BR.axaml: 91.39% +### pt_BR.axaml: 91.30%
From cea8a90680a46a9bf54e0b1649af1f4607138e4b Mon Sep 17 00:00:00 2001 From: Gadfly Date: Mon, 17 Mar 2025 15:56:13 +0800 Subject: [PATCH 012/571] refactor: use $GIT_COMMON_DIR instead of cut $GIT_DIR/worktrees (#1103) --- src/Commands/QueryGitCommonDir.cs | 26 ++++++++++++++++++++++++++ src/Models/IRepository.cs | 1 + src/Models/Watcher.cs | 6 +----- src/Resources/Locales/de_DE.axaml | 2 +- src/Resources/Locales/en_US.axaml | 2 +- src/Resources/Locales/es_ES.axaml | 2 +- src/Resources/Locales/fr_FR.axaml | 2 +- src/Resources/Locales/it_IT.axaml | 2 +- src/Resources/Locales/pt_BR.axaml | 2 +- src/Resources/Locales/ru_RU.axaml | 2 +- src/Resources/Locales/zh_CN.axaml | 2 +- src/Resources/Locales/zh_TW.axaml | 2 +- src/ViewModels/Launcher.cs | 6 +++++- src/ViewModels/Repository.cs | 10 +++++++++- 14 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 src/Commands/QueryGitCommonDir.cs diff --git a/src/Commands/QueryGitCommonDir.cs b/src/Commands/QueryGitCommonDir.cs new file mode 100644 index 00000000..1076243e --- /dev/null +++ b/src/Commands/QueryGitCommonDir.cs @@ -0,0 +1,26 @@ +using System.IO; + +namespace SourceGit.Commands +{ + public class QueryGitCommonDir : Command + { + public QueryGitCommonDir(string workDir) + { + WorkingDirectory = workDir; + Args = "rev-parse --git-common-dir"; + RaiseError = false; + } + + public string Result() + { + var rs = ReadToEnd().StdOut; + if (string.IsNullOrEmpty(rs)) + return null; + + rs = rs.Trim(); + if (Path.IsPathRooted(rs)) + return rs; + return Path.GetFullPath(Path.Combine(WorkingDirectory, rs)); + } + } +} diff --git a/src/Models/IRepository.cs b/src/Models/IRepository.cs index 12b1adba..90409c2f 100644 --- a/src/Models/IRepository.cs +++ b/src/Models/IRepository.cs @@ -4,6 +4,7 @@ { string FullPath { get; set; } string GitDir { get; set; } + string GitCommonDir { get; set; } void RefreshBranches(); void RefreshWorktrees(); diff --git a/src/Models/Watcher.cs b/src/Models/Watcher.cs index d0ccdea5..320f31d6 100644 --- a/src/Models/Watcher.cs +++ b/src/Models/Watcher.cs @@ -24,11 +24,7 @@ namespace SourceGit.Models _wcWatcher.EnableRaisingEvents = true; // If this repository is a worktree repository, just watch the main repository's gitdir. - var gitDirNormalized = _repo.GitDir.Replace("\\", "/"); - var worktreeIdx = gitDirNormalized.IndexOf(".git/worktrees/", StringComparison.Ordinal); - var repoWatchDir = _repo.GitDir; - if (worktreeIdx > 0) - repoWatchDir = _repo.GitDir.Substring(0, worktreeIdx + 4); + var repoWatchDir = _repo.GitCommonDir.Replace("\\", "/"); _repoWatcher = new FileSystemWatcher(); _repoWatcher.Path = repoWatchDir; diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 31dc1d9b..2ebc1ae7 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -501,7 +501,7 @@ Remote löschen Ziel: Worktrees löschen - Worktree Informationen in `$GIT_DIR/worktrees` löschen + Worktree Informationen in `$GIT_COMMON_DIR/worktrees` löschen Pull Remote-Branch: Alle Branches fetchen diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index b1f83836..4401e8bc 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -504,7 +504,7 @@ Prune Remote Target: Prune Worktrees - Prune worktree information in `$GIT_DIR/worktrees` + Prune worktree information in `$GIT_COMMON_DIR/worktrees` Pull Remote Branch: Fetch all branches diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 6bf38df1..f57ee230 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -508,7 +508,7 @@ Podar Remoto Destino: Podar Worktrees - Podar información de worktree en `$GIT_DIR/worktrees` + Podar información de worktree en `$GIT_COMMON_DIR/worktrees` Pull Rama Remota: Fetch todas las ramas diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index ebb3ba89..94df8d66 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -476,7 +476,7 @@ Élaguer une branche distant Cible : Élaguer les Worktrees - Élaguer les information de worktree dans `$GIT_DIR/worktrees` + Élaguer les information de worktree dans `$GIT_COMMON_DIR/worktrees` Pull Branche distante : Fetch toutes les branches diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index ebfd3939..8e6f73fa 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -507,7 +507,7 @@ Potatura Remota Destinazione: Potatura Worktrees - Potatura delle informazioni di worktree in `$GIT_DIR/worktrees` + Potatura delle informazioni di worktree in `$GIT_COMMON_DIR/worktrees` Scarica Branch Remoto: Recupera tutti i branch diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index b4677840..c03e39d2 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -490,7 +490,7 @@ Prunar Remoto Alvo: Podar Worktrees - Podar informações de worktree em `$GIT_DIR/worktrees` + Podar informações de worktree em `$GIT_COMMON_DIR/worktrees` Puxar Branch Remoto: Buscar todos os branches diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index b2ba2158..3273ac07 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -508,7 +508,7 @@ Удалить внешний репозиторий Цель: Удалить рабочий каталог - Информация об обрезке рабочего каталога в «$GIT_DIR/worktrees» + Информация об обрезке рабочего каталога в «$GIT_COMMON_DIR/worktrees» Забрать Ветка внешнего репозитория: Извлечь все ветки diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 768061dd..2a8d08b5 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -508,7 +508,7 @@ 清理远程已删除分支 目标 : 清理工作树 - 清理在`$GIT_DIR/worktrees`中的无效工作树信息 + 清理在`$GIT_COMMON_DIR/worktrees`中的无效工作树信息 拉回(pull) 拉取分支 : 拉取远程中的所有分支变更 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 6d63c1ee..5bb68782 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -507,7 +507,7 @@ 清理遠端已刪除分支 目標: 清理工作區 - 清理在 `$GIT_DIR/worktrees` 中的無效工作區資訊 + 清理在 `$GIT_COMMON_DIR/worktrees` 中的無效工作區資訊 拉取 (pull) 拉取分支: 拉取遠端中的所有分支 diff --git a/src/ViewModels/Launcher.cs b/src/ViewModels/Launcher.cs index 06479394..4307665d 100644 --- a/src/ViewModels/Launcher.cs +++ b/src/ViewModels/Launcher.cs @@ -282,6 +282,7 @@ namespace SourceGit.ViewModels var isBare = new Commands.IsBareRepository(node.Id).Result(); var gitDir = node.Id; + var gitCommonDir = gitDir; if (!isBare) { gitDir = new Commands.QueryGitDir(node.Id).Result(); @@ -291,9 +292,12 @@ namespace SourceGit.ViewModels App.RaiseException(ctx, "Given path is not a valid git repository!"); return; } + gitCommonDir = new Commands.QueryGitCommonDir(node.Id).Result(); + if (string.IsNullOrEmpty(gitCommonDir)) + gitCommonDir = gitDir; } - var repo = new Repository(isBare, node.Id, gitDir); + var repo = new Repository(isBare, node.Id, gitDir, gitCommonDir); repo.Open(); if (page == null) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 97c52d8e..5cc933e9 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -45,6 +45,12 @@ namespace SourceGit.ViewModels set => SetProperty(ref _gitDir, value); } + public string GitCommonDir + { + get => _gitCommonDir; + set => SetProperty(ref _gitCommonDir, value); + } + public Models.RepositorySettings Settings { get => _settings; @@ -429,11 +435,12 @@ namespace SourceGit.ViewModels set; } = 0; - public Repository(bool isBare, string path, string gitDir) + public Repository(bool isBare, string path, string gitDir, string gitCommonDir) { IsBare = isBare; FullPath = path; GitDir = gitDir; + GitCommonDir = gitCommonDir; } public void Open() @@ -2437,6 +2444,7 @@ namespace SourceGit.ViewModels private string _fullpath = string.Empty; private string _gitDir = string.Empty; + private string _gitCommonDir = string.Empty; private Models.RepositorySettings _settings = null; private Models.FilterMode _historiesFilterMode = Models.FilterMode.None; private bool _hasAllowedSignersFile = false; From b4ab4afd3ab8eded049ea7b4849d821f64d14273 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 16:17:20 +0800 Subject: [PATCH 013/571] code_review: PR #1103 Since we only use `$GIT_COMMON_DIR` in filesystem watcher, it is unnecessary to store this value in `Repository`, and we can query the `$GIT_COMMON_DIR` only when it looks like a worktree Signed-off-by: leo --- src/Models/IRepository.cs | 3 +-- src/Models/Watcher.cs | 5 +---- src/ViewModels/Launcher.cs | 6 +----- src/ViewModels/Repository.cs | 19 +++++++++++++------ 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/Models/IRepository.cs b/src/Models/IRepository.cs index 90409c2f..9283266e 100644 --- a/src/Models/IRepository.cs +++ b/src/Models/IRepository.cs @@ -3,8 +3,7 @@ public interface IRepository { string FullPath { get; set; } - string GitDir { get; set; } - string GitCommonDir { get; set; } + string GitDirForWatcher { get; } void RefreshBranches(); void RefreshWorktrees(); diff --git a/src/Models/Watcher.cs b/src/Models/Watcher.cs index 320f31d6..d419363a 100644 --- a/src/Models/Watcher.cs +++ b/src/Models/Watcher.cs @@ -23,11 +23,8 @@ namespace SourceGit.Models _wcWatcher.Deleted += OnWorkingCopyChanged; _wcWatcher.EnableRaisingEvents = true; - // If this repository is a worktree repository, just watch the main repository's gitdir. - var repoWatchDir = _repo.GitCommonDir.Replace("\\", "/"); - _repoWatcher = new FileSystemWatcher(); - _repoWatcher.Path = repoWatchDir; + _repoWatcher.Path = _repo.GitDirForWatcher; _repoWatcher.Filter = "*"; _repoWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.DirectoryName | NotifyFilters.FileName; _repoWatcher.IncludeSubdirectories = true; diff --git a/src/ViewModels/Launcher.cs b/src/ViewModels/Launcher.cs index 4307665d..06479394 100644 --- a/src/ViewModels/Launcher.cs +++ b/src/ViewModels/Launcher.cs @@ -282,7 +282,6 @@ namespace SourceGit.ViewModels var isBare = new Commands.IsBareRepository(node.Id).Result(); var gitDir = node.Id; - var gitCommonDir = gitDir; if (!isBare) { gitDir = new Commands.QueryGitDir(node.Id).Result(); @@ -292,12 +291,9 @@ namespace SourceGit.ViewModels App.RaiseException(ctx, "Given path is not a valid git repository!"); return; } - gitCommonDir = new Commands.QueryGitCommonDir(node.Id).Result(); - if (string.IsNullOrEmpty(gitCommonDir)) - gitCommonDir = gitDir; } - var repo = new Repository(isBare, node.Id, gitDir, gitCommonDir); + var repo = new Repository(isBare, node.Id, gitDir); repo.Open(); if (page == null) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 5cc933e9..85665634 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -45,10 +45,19 @@ namespace SourceGit.ViewModels set => SetProperty(ref _gitDir, value); } - public string GitCommonDir + public string GitDirForWatcher { - get => _gitCommonDir; - set => SetProperty(ref _gitCommonDir, value); + get + { + // Only try to get `$GIT_COMMON_DIR` if this repository looks like a worktree. + if (_gitDir.Replace("\\", "/").IndexOf(".git/worktrees/", StringComparison.Ordinal) > 0) + { + var commonDir = new Commands.QueryGitCommonDir(_fullpath).Result(); + return string.IsNullOrEmpty(commonDir) ? _gitDir : commonDir; + } + + return _gitDir; + } } public Models.RepositorySettings Settings @@ -435,12 +444,11 @@ namespace SourceGit.ViewModels set; } = 0; - public Repository(bool isBare, string path, string gitDir, string gitCommonDir) + public Repository(bool isBare, string path, string gitDir) { IsBare = isBare; FullPath = path; GitDir = gitDir; - GitCommonDir = gitCommonDir; } public void Open() @@ -2444,7 +2452,6 @@ namespace SourceGit.ViewModels private string _fullpath = string.Empty; private string _gitDir = string.Empty; - private string _gitCommonDir = string.Empty; private Models.RepositorySettings _settings = null; private Models.FilterMode _historiesFilterMode = Models.FilterMode.None; private bool _hasAllowedSignersFile = false; From 7031693489d6c92da2db74393f690aba6d1b3da7 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 16:29:56 +0800 Subject: [PATCH 014/571] refactor: pass dirs to watcher directly Signed-off-by: leo --- src/Models/IRepository.cs | 3 --- src/Models/Watcher.cs | 6 +++--- src/ViewModels/Repository.cs | 26 ++++++++++---------------- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/Models/IRepository.cs b/src/Models/IRepository.cs index 9283266e..0224d81f 100644 --- a/src/Models/IRepository.cs +++ b/src/Models/IRepository.cs @@ -2,9 +2,6 @@ { public interface IRepository { - string FullPath { get; set; } - string GitDirForWatcher { get; } - void RefreshBranches(); void RefreshWorktrees(); void RefreshTags(); diff --git a/src/Models/Watcher.cs b/src/Models/Watcher.cs index d419363a..3ccecad4 100644 --- a/src/Models/Watcher.cs +++ b/src/Models/Watcher.cs @@ -8,12 +8,12 @@ namespace SourceGit.Models { public class Watcher : IDisposable { - public Watcher(IRepository repo) + public Watcher(IRepository repo, string fullpath, string gitDir) { _repo = repo; _wcWatcher = new FileSystemWatcher(); - _wcWatcher.Path = _repo.FullPath; + _wcWatcher.Path = fullpath; _wcWatcher.Filter = "*"; _wcWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.DirectoryName | NotifyFilters.FileName | NotifyFilters.Size | NotifyFilters.CreationTime; _wcWatcher.IncludeSubdirectories = true; @@ -24,7 +24,7 @@ namespace SourceGit.Models _wcWatcher.EnableRaisingEvents = true; _repoWatcher = new FileSystemWatcher(); - _repoWatcher.Path = _repo.GitDirForWatcher; + _repoWatcher.Path = gitDir; _repoWatcher.Filter = "*"; _repoWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.DirectoryName | NotifyFilters.FileName; _repoWatcher.IncludeSubdirectories = true; diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 85665634..4f2f3ca3 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -45,21 +45,6 @@ namespace SourceGit.ViewModels set => SetProperty(ref _gitDir, value); } - public string GitDirForWatcher - { - get - { - // Only try to get `$GIT_COMMON_DIR` if this repository looks like a worktree. - if (_gitDir.Replace("\\", "/").IndexOf(".git/worktrees/", StringComparison.Ordinal) > 0) - { - var commonDir = new Commands.QueryGitCommonDir(_fullpath).Result(); - return string.IsNullOrEmpty(commonDir) ? _gitDir : commonDir; - } - - return _gitDir; - } - } - public Models.RepositorySettings Settings { get => _settings; @@ -472,7 +457,16 @@ namespace SourceGit.ViewModels try { - _watcher = new Models.Watcher(this); + // For worktrees, we need to watch the $GIT_COMMON_DIR instead of the $GIT_DIR. + var gitDirForWatcher = _gitDir; + if (_gitDir.Replace("\\", "/").IndexOf(".git/worktrees/", StringComparison.Ordinal) > 0) + { + var commonDir = new Commands.QueryGitCommonDir(_fullpath).Result(); + if (!string.IsNullOrEmpty(commonDir)) + gitDirForWatcher = commonDir; + } + + _watcher = new Models.Watcher(this, _fullpath, gitDirForWatcher); } catch (Exception ex) { From 3e8bba0d0bd3e16057791a8df6fc95e2897a8a40 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 17:06:26 +0800 Subject: [PATCH 015/571] ux: re-design `About` page Signed-off-by: leo --- src/Resources/Icons.axaml | 1 + src/Resources/Locales/de_DE.axaml | 5 ---- src/Resources/Locales/en_US.axaml | 5 ---- src/Resources/Locales/es_ES.axaml | 5 ---- src/Resources/Locales/fr_FR.axaml | 5 ---- src/Resources/Locales/it_IT.axaml | 5 ---- src/Resources/Locales/pt_BR.axaml | 5 ---- src/Resources/Locales/ru_RU.axaml | 5 ---- src/Resources/Locales/zh_CN.axaml | 5 ---- src/Resources/Locales/zh_TW.axaml | 5 ---- src/Views/About.axaml | 45 +++++++++++-------------------- src/Views/About.axaml.cs | 26 +++--------------- 12 files changed, 21 insertions(+), 96 deletions(-) diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml index 9426d20a..66589440 100644 --- a/src/Resources/Icons.axaml +++ b/src/Resources/Icons.axaml @@ -54,6 +54,7 @@ M939 94v710L512 998 85 805V94h-64A21 21 0 010 73v-0C0 61 10 51 21 51h981c12 0 21 10 21 21v0c0 12-10 21-21 21h-64zm-536 588L512 624l109 58c6 3 13 4 20 3a32 32 0 0026-37l-21-122 88-87c5-5 8-11 9-18a32 32 0 00-27-37l-122-18-54-111a32 32 0 00-57 0l-54 111-122 18c-7 1-13 4-18 9a33 33 0 001 46l88 87-21 122c-1 7-0 14 3 20a32 32 0 0043 14z M236 542a32 32 0 109 63l86-12a180 180 0 0022 78l-71 47a32 32 0 1035 53l75-50a176 176 0 00166 40L326 529zM512 16C238 16 16 238 16 512s222 496 496 496 496-222 496-496S786 16 512 16zm0 896c-221 0-400-179-400-400a398 398 0 0186-247l561 561A398 398 0 01512 912zm314-154L690 622a179 179 0 004-29l85 12a32 32 0 109-63l-94-13v-49l94-13a32 32 0 10-9-63l-87 12a180 180 0 00-20-62l71-47A32 32 0 10708 252l-75 50a181 181 0 00-252 10l-115-115A398 398 0 01512 112c221 0 400 179 400 400a398 398 0 01-86 247z M884 159l-18-18a43 43 0 00-38-12l-235 43a166 166 0 00-101 60L400 349a128 128 0 00-148 47l-120 171a21 21 0 005 29l17 12a128 128 0 00178-32l27-38 124 124-38 27a128 128 0 00-32 178l12 17a21 21 0 0029 5l171-120a128 128 0 0047-148l117-92A166 166 0 00853 431l43-235a43 43 0 00-12-38zm-177 249a64 64 0 110-90 64 64 0 010 90zm-373 312a21 21 0 010 30l-139 139a21 21 0 01-30 0l-30-30a21 21 0 010-30l139-139a21 21 0 0130 0z + M525 0C235 0 0 235 0 525c0 232 150 429 359 498 26 5 36-11 36-25 0-12-1-54-1-97-146 31-176-63-176-63-23-61-58-76-58-76-48-32 3-32 3-32 53 3 81 54 81 54 47 80 123 57 153 43 4-34 18-57 33-70-116-12-239-57-239-259 0-57 21-104 54-141-5-13-23-67 5-139 0 0 44-14 144 54 42-11 87-17 131-17s90 6 131 17C756 203 801 217 801 217c29 72 10 126 5 139 34 37 54 83 54 141 0 202-123 246-240 259 19 17 36 48 36 97 0 70-1 127-1 144 0 14 10 30 36 25 209-70 359-266 359-498C1050 235 814 0 525 0z M590 74 859 342V876c0 38-31 68-68 68H233c-38 0-68-31-68-68V142c0-38 31-68 68-68h357zm-12 28H233a40 40 0 00-40 38L193 142v734a40 40 0 0038 40L233 916h558a40 40 0 0040-38L831 876V354L578 102zM855 371h-215c-46 0-83-36-84-82l0-2V74h28v213c0 30 24 54 54 55l2 0h215v28zM57 489m28 0 853 0q28 0 28 28l0 284q0 28-28 28l-853 0q-28 0-28-28l0-284q0-28 28-28ZM157 717c15 0 29-6 37-13v-51h-41v22h17v18c-2 2-6 3-10 3-21 0-30-13-30-34 0-21 12-34 28-34 9 0 15 4 20 9l14-17C184 610 172 603 156 603c-29 0-54 21-54 57 0 37 24 56 54 56zM245 711v-108h-34v108h34zm69 0v-86H341V603H262v22h28V711h24zM393 711v-108h-34v108h34zm66 6c15 0 29-6 37-13v-51h-41v22h17v18c-2 2-6 3-10 3-21 0-30-13-30-34 0-21 12-34 28-34 9 0 15 4 20 9l14-17C485 610 474 603 458 603c-29 0-54 21-54 57 0 37 24 56 54 56zm88-6v-36c0-13-2-28-3-40h1l10 24 25 52H603v-108h-23v36c0 13 2 28 3 40h-1l-10-24L548 603H523v108h23zM677 717c30 0 51-22 51-57 0-36-21-56-51-56-30 0-51 20-51 56 0 36 21 57 51 57zm3-23c-16 0-26-12-26-32 0-19 10-31 26-31 16 0 26 11 26 31S696 694 680 694zm93 17v-38h13l21 38H836l-25-43c12-5 19-15 19-31 0-26-20-34-44-34H745v108h27zm16-51H774v-34h15c16 0 25 4 25 16s-9 18-25 18zM922 711v-22h-43v-23h35v-22h-35V625h41V603H853v108h68z M30 271l241 0 0-241-241 0 0 241zM392 271l241 0 0-241-241 0 0 241zM753 30l0 241 241 0 0-241-241 0zM30 632l241 0 0-241-241 0 0 241zM392 632l241 0 0-241-241 0 0 241zM753 632l241 0 0-241-241 0 0 241zM30 994l241 0 0-241-241 0 0 241zM392 994l241 0 0-241-241 0 0 241zM753 994l241 0 0-241-241 0 0 241z M0 512M1024 512M512 0M512 1024M955 323q0 23-16 39l-414 414-78 78q-16 16-39 16t-39-16l-78-78-207-207q-16-16-16-39t16-39l78-78q16-16 39-16t39 16l168 169 375-375q16-16 39-16t39 16l78 78q16 16 16 39z diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 2ebc1ae7..7144ef43 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -4,11 +4,6 @@ Info Über SourceGit - • Erstellt mit - • Grafik gerendert durch - • Texteditor von - • Monospace-Schriftarten von - • Quelltext findest du auf Open Source & freier Git GUI Client Worktree hinzufügen Was auschecken: diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 4401e8bc..312d4945 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -1,11 +1,6 @@ About About SourceGit - • Build with - • Chart is rendered by - • TextEditor from - • Monospace fonts come from - • Source code can be found at Opensource & Free Git GUI Client Add Worktree What to Checkout: diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index f57ee230..e7e953e5 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -4,11 +4,6 @@ Acerca de Acerca de SourceGit - • Construido con - • El gráfico es renderizado por - • Editor de texto de - • Las fuentes monoespaciadas provienen de - • El código fuente se puede encontrar en Cliente Git GUI de código abierto y gratuito Agregar Worktree Qué Checkout: diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index 94df8d66..f3a71390 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -4,11 +4,6 @@ À propos À propos de SourceGit - • Compilé avec - • Le graphique est rendu par - • TextEditor de - • Les polices Monospace proviennent de - • Le code source est disponible sur Client Git Open Source et Gratuit Ajouter un Worktree Que récupérer : diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index 8e6f73fa..782d6e78 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -4,11 +4,6 @@ Informazioni Informazioni su SourceGit - • Creato con - • Il grafico è reso da - • Editor di testo da - • I font monospaziati provengono da - • Il codice sorgente è disponibile su Client GUI Git open source e gratuito Aggiungi Worktree Di cosa fare il checkout: diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index c03e39d2..e811cf3e 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -29,11 +29,6 @@ Sobre Sobre o SourceGit - • Construído com - • Gráfico desenhado por - • Editor de Texto de - • Fontes monoespaçadas de - • Código-fonte pode ser encontrado em Cliente Git GUI Livre e de Código Aberto Adicionar Worktree O que Checar: diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 3273ac07..99948eca 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -4,11 +4,6 @@ О программе О SourceGit - • Сборка с - • Диаграмма отображается с помощью - • Текстовый редактор от - • Моноширинные шрифты взяты из - • Исходный код можно найти по адресу Бесплатный графический клиент Git с исходным кодом Добавить рабочий каталог Переключиться на: diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 2a8d08b5..aae292f3 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -4,11 +4,6 @@ 关于软件 关于本软件 - • 项目依赖于 - • 图表绘制组件来自 - • 文本编辑器使用 - • 等宽字体来自于 - • 项目源代码地址 开源免费的Git客户端 新增工作树 检出分支方式 : diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 5bb68782..97c96c6c 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -4,11 +4,6 @@ 關於 關於 SourceGit - • 專案依賴於 - • 圖表繪製元件來自 - • 文字編輯器使用 - • 等寬字型來自於 - • 專案原始碼網址 開源免費的 Git 客戶端 新增工作區 簽出分支方式: diff --git a/src/Views/About.axaml b/src/Views/About.axaml index ecdf156e..28529b63 100644 --- a/src/Views/About.axaml +++ b/src/Views/About.axaml @@ -3,12 +3,12 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:v="using:SourceGit.Views" - mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + mc:Ignorable="d" d:DesignWidth="520" d:DesignHeight="230" x:Class="SourceGit.Views.About" x:Name="ThisControl" Icon="/App.ico" Title="{DynamicResource Text.About}" - SizeToContent="WidthAndHeight" + Width="520" Height="230" CanResize="False" WindowStartupLocation="CenterScreen"> @@ -34,7 +34,7 @@ IsVisible="{OnPlatform True, macOS=False}"/> - + - - + + - + - + + - - - - - - - - - - - - - - - - - - - - - - + + + + diff --git a/src/Views/About.axaml.cs b/src/Views/About.axaml.cs index 631df0f9..d393f94c 100644 --- a/src/Views/About.axaml.cs +++ b/src/Views/About.axaml.cs @@ -1,5 +1,5 @@ using System.Reflection; -using Avalonia.Input; +using Avalonia.Interactivity; namespace SourceGit.Views { @@ -19,31 +19,13 @@ namespace SourceGit.Views TxtCopyright.Text = copyright.Copyright; } - private void OnVisitAvaloniaUI(object _, PointerPressedEventArgs e) + private void OnVisitWebsite(object _, RoutedEventArgs e) { - Native.OS.OpenBrowser("https://www.avaloniaui.net/"); + Native.OS.OpenBrowser("https://sourcegit-scm.github.io/"); e.Handled = true; } - private void OnVisitAvaloniaEdit(object _, PointerPressedEventArgs e) - { - Native.OS.OpenBrowser("https://github.com/AvaloniaUI/AvaloniaEdit"); - e.Handled = true; - } - - private void OnVisitJetBrainsMonoFont(object _, PointerPressedEventArgs e) - { - Native.OS.OpenBrowser("https://www.jetbrains.com/lp/mono/"); - e.Handled = true; - } - - private void OnVisitLiveCharts2(object _, PointerPressedEventArgs e) - { - Native.OS.OpenBrowser("https://livecharts.dev/"); - e.Handled = true; - } - - private void OnVisitSourceCode(object _, PointerPressedEventArgs e) + private void OnVisitSourceCode(object _, RoutedEventArgs e) { Native.OS.OpenBrowser("https://github.com/sourcegit-scm/sourcegit"); e.Handled = true; From 5845ef3eb64bb5651737685bb25403d169e033c6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 17 Mar 2025 09:06:42 +0000 Subject: [PATCH 016/571] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f9216874..13887a13 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.06%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-%E2%88%9A-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-91.57%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-99.87%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-91.30%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.06%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-%E2%88%9A-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-91.51%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-99.87%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-91.24%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen)](TRANSLATION.md) > [!NOTE] > You can find the missing keys in [TRANSLATION.md](TRANSLATION.md) diff --git a/TRANSLATION.md b/TRANSLATION.md index ae9f4777..b1e1f2c8 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -24,7 +24,7 @@
-### fr_FR.axaml: 91.57% +### fr_FR.axaml: 91.51%
@@ -106,7 +106,7 @@
-### pt_BR.axaml: 91.30% +### pt_BR.axaml: 91.24%
From 398b14695ce9900e4b712b54e1ddf987953ac23f Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 17:10:42 +0800 Subject: [PATCH 017/571] enhance: the git dir of worktree's owner repository may not named `.git` Signed-off-by: leo --- src/ViewModels/Repository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 4f2f3ca3..f1c43e7c 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -459,7 +459,7 @@ namespace SourceGit.ViewModels { // For worktrees, we need to watch the $GIT_COMMON_DIR instead of the $GIT_DIR. var gitDirForWatcher = _gitDir; - if (_gitDir.Replace("\\", "/").IndexOf(".git/worktrees/", StringComparison.Ordinal) > 0) + if (_gitDir.Replace("\\", "/").IndexOf("/worktrees/", StringComparison.Ordinal) > 0) { var commonDir = new Commands.QueryGitCommonDir(_fullpath).Result(); if (!string.IsNullOrEmpty(commonDir)) From c9fe373dda59dfc87fb927aa9bac3ebf538c22ce Mon Sep 17 00:00:00 2001 From: Leonardo Date: Mon, 17 Mar 2025 10:15:17 +0100 Subject: [PATCH 018/571] add missing key and fix untranslated one (#1104) --- src/Resources/Locales/it_IT.axaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index 782d6e78..d002dfef 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -454,7 +454,8 @@ Abilita streaming ASPETTO Font Predefinito - Font Size + Larghezza della Tab Editor + Dimensione Font Dimensione Font Predefinita Dimensione Font Editor Font Monospaziato From 2b95ea2ab1cac2cda9b27add6439406f47c163e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 17 Mar 2025 09:15:30 +0000 Subject: [PATCH 019/571] doc: Update translation status and missing keys --- README.md | 2 +- TRANSLATION.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 13887a13..dff78418 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ ## Translation Status -[![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.06%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-%E2%88%9A-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-91.51%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-99.87%25-yellow)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-91.24%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen)](TRANSLATION.md) +[![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen)](TRANSLATION.md) [![de__DE](https://img.shields.io/badge/de__DE-99.06%25-yellow)](TRANSLATION.md) [![es__ES](https://img.shields.io/badge/es__ES-%E2%88%9A-brightgreen)](TRANSLATION.md) [![fr__FR](https://img.shields.io/badge/fr__FR-91.51%25-yellow)](TRANSLATION.md) [![it__IT](https://img.shields.io/badge/it__IT-%E2%88%9A-brightgreen)](TRANSLATION.md) [![pt__BR](https://img.shields.io/badge/pt__BR-91.24%25-yellow)](TRANSLATION.md) [![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen)](TRANSLATION.md) [![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen)](TRANSLATION.md) > [!NOTE] > You can find the missing keys in [TRANSLATION.md](TRANSLATION.md) diff --git a/TRANSLATION.md b/TRANSLATION.md index b1e1f2c8..0f8ccc2b 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -96,13 +96,13 @@
-### it_IT.axaml: 99.87% +### it_IT.axaml: 100.00%
Missing Keys -- Text.Preferences.Appearance.EditorTabWidth +
From a0cddaea8020b1ca891217df3f918a1a05560e97 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 19:53:47 +0800 Subject: [PATCH 020/571] feature: support `--ff-only` option for `git merge` command Signed-off-by: leo --- src/Models/MergeMode.cs | 1 + src/ViewModels/Histories.cs | 6 +++--- src/ViewModels/Merge.cs | 12 +++++++----- src/ViewModels/Repository.cs | 6 +++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Models/MergeMode.cs b/src/Models/MergeMode.cs index e4389b32..5dc70030 100644 --- a/src/Models/MergeMode.cs +++ b/src/Models/MergeMode.cs @@ -5,6 +5,7 @@ public static readonly MergeMode[] Supported = [ new MergeMode("Default", "Fast-forward if possible", ""), + new MergeMode("Fast-forward", "Refuse to merge when fast-forward is not possible", "--ff-only"), new MergeMode("No Fast-forward", "Always create a merge commit", "--no-ff"), new MergeMode("Squash", "Squash merge", "--squash"), new MergeMode("Don't commit", "Merge without commit", "--no-ff --no-commit"), diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 0e67915c..01114dd3 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -871,7 +871,7 @@ namespace SourceGit.ViewModels return; if (_repo.CanCreatePopup()) - _repo.ShowAndStartPopup(new Merge(_repo, b, current.Name)); + _repo.ShowAndStartPopup(new Merge(_repo, b, current.Name, true)); e.Handled = true; }; @@ -972,7 +972,7 @@ namespace SourceGit.ViewModels merge.Click += (_, e) => { if (_repo.CanCreatePopup()) - _repo.ShowPopup(new Merge(_repo, branch, current.Name)); + _repo.ShowPopup(new Merge(_repo, branch, current.Name, false)); e.Handled = true; }; submenu.Items.Add(merge); @@ -1060,7 +1060,7 @@ namespace SourceGit.ViewModels merge.Click += (_, e) => { if (_repo.CanCreatePopup()) - _repo.ShowPopup(new Merge(_repo, branch, current.Name)); + _repo.ShowPopup(new Merge(_repo, branch, current.Name, false)); e.Handled = true; }; diff --git a/src/ViewModels/Merge.cs b/src/ViewModels/Merge.cs index bde9b66d..be938867 100644 --- a/src/ViewModels/Merge.cs +++ b/src/ViewModels/Merge.cs @@ -21,14 +21,14 @@ namespace SourceGit.ViewModels set; } - public Merge(Repository repo, Models.Branch source, string into) + public Merge(Repository repo, Models.Branch source, string into, bool forceFastForward) { _repo = repo; _sourceName = source.FriendlyName; Source = source; Into = into; - Mode = AutoSelectMergeMode(); + Mode = forceFastForward ? Models.MergeMode.Supported[1] : AutoSelectMergeMode(); View = new Views.Merge() { DataContext = this }; } @@ -72,12 +72,14 @@ namespace SourceGit.ViewModels var config = new Commands.Config(_repo.FullPath).Get($"branch.{Into}.mergeoptions"); if (string.IsNullOrEmpty(config)) return Models.MergeMode.Supported[0]; - if (config.Equals("--no-ff", StringComparison.Ordinal)) + if (config.Equals("--ff-only", StringComparison.Ordinal)) return Models.MergeMode.Supported[1]; - if (config.Equals("--squash", StringComparison.Ordinal)) + if (config.Equals("--no-ff", StringComparison.Ordinal)) return Models.MergeMode.Supported[2]; - if (config.Equals("--no-commit", StringComparison.Ordinal) || config.Equals("--no-ff --no-commit", StringComparison.Ordinal)) + if (config.Equals("--squash", StringComparison.Ordinal)) return Models.MergeMode.Supported[3]; + if (config.Equals("--no-commit", StringComparison.Ordinal) || config.Equals("--no-ff --no-commit", StringComparison.Ordinal)) + return Models.MergeMode.Supported[4]; return Models.MergeMode.Supported[0]; } diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index f1c43e7c..bf283532 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -1516,7 +1516,7 @@ namespace SourceGit.ViewModels return; if (CanCreatePopup()) - ShowAndStartPopup(new Merge(this, b, branch.Name)); + ShowAndStartPopup(new Merge(this, b, branch.Name, true)); e.Handled = true; }; @@ -1595,7 +1595,7 @@ namespace SourceGit.ViewModels merge.Click += (_, e) => { if (CanCreatePopup()) - ShowPopup(new Merge(this, branch, _currentBranch.Name)); + ShowPopup(new Merge(this, branch, _currentBranch.Name, false)); e.Handled = true; }; @@ -1876,7 +1876,7 @@ namespace SourceGit.ViewModels merge.Click += (_, e) => { if (CanCreatePopup()) - ShowPopup(new Merge(this, branch, _currentBranch.Name)); + ShowPopup(new Merge(this, branch, _currentBranch.Name, false)); e.Handled = true; }; From b930066b5a2bc0d085a8c628f89b75c268fc6456 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Mon, 17 Mar 2025 19:59:28 +0800 Subject: [PATCH 021/571] fix: improve line splitting to handle both LF and CRLF line endings (#1106) --- src/Commands/CountLocalChangesWithoutUntracked.cs | 2 +- src/Commands/QueryCommitSignInfo.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Commands/CountLocalChangesWithoutUntracked.cs b/src/Commands/CountLocalChangesWithoutUntracked.cs index 7ab9a54a..924f8a89 100644 --- a/src/Commands/CountLocalChangesWithoutUntracked.cs +++ b/src/Commands/CountLocalChangesWithoutUntracked.cs @@ -16,7 +16,7 @@ namespace SourceGit.Commands var rs = ReadToEnd(); if (rs.IsSuccess) { - var lines = rs.StdOut.Split('\n', StringSplitOptions.RemoveEmptyEntries); + var lines = rs.StdOut.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries); return lines.Length; } diff --git a/src/Commands/QueryCommitSignInfo.cs b/src/Commands/QueryCommitSignInfo.cs index 5c81cf57..7b53a1f2 100644 --- a/src/Commands/QueryCommitSignInfo.cs +++ b/src/Commands/QueryCommitSignInfo.cs @@ -1,4 +1,6 @@ -namespace SourceGit.Commands +using System; + +namespace SourceGit.Commands { public class QueryCommitSignInfo : Command { @@ -22,7 +24,7 @@ if (raw.Length <= 1) return null; - var lines = raw.Split('\n'); + var lines = raw.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries); return new Models.CommitSignInfo() { VerifyResult = lines[0][0], From 808302ce84813d59a6a859139dd8f84143cc5f5f Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 20:35:31 +0800 Subject: [PATCH 022/571] code_review: PR #1106 - Use new syntex `[...]` instead of `new char[] {...}` to create char arrays - Use `string.ReplaceLineEndings('\n').Split('\n')` instead of `string.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries)` because that the `Signer` part may be missing Signed-off-by: leo --- src/Commands/Config.cs | 2 +- src/Commands/CountLocalChangesWithoutUntracked.cs | 2 +- src/Commands/LFS.cs | 2 +- src/Commands/QueryBranches.cs | 2 +- src/Commands/QueryCommitSignInfo.cs | 4 ++-- src/Commands/QueryCommits.cs | 6 +++--- src/Commands/QueryRefsContainsCommit.cs | 2 +- src/Commands/QueryStagedChangesWithAmend.cs | 2 +- src/Commands/QuerySubmodules.cs | 4 ++-- src/Commands/QueryTrackStatus.cs | 2 +- src/Commands/Worktree.cs | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Commands/Config.cs b/src/Commands/Config.cs index 2fb83325..49e8fcb7 100644 --- a/src/Commands/Config.cs +++ b/src/Commands/Config.cs @@ -29,7 +29,7 @@ namespace SourceGit.Commands var rs = new Dictionary(); if (output.IsSuccess) { - var lines = output.StdOut.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); + var lines = output.StdOut.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries); foreach (var line in lines) { var idx = line.IndexOf('=', StringComparison.Ordinal); diff --git a/src/Commands/CountLocalChangesWithoutUntracked.cs b/src/Commands/CountLocalChangesWithoutUntracked.cs index 924f8a89..0ba508f8 100644 --- a/src/Commands/CountLocalChangesWithoutUntracked.cs +++ b/src/Commands/CountLocalChangesWithoutUntracked.cs @@ -16,7 +16,7 @@ namespace SourceGit.Commands var rs = ReadToEnd(); if (rs.IsSuccess) { - var lines = rs.StdOut.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries); + var lines = rs.StdOut.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries); return lines.Length; } diff --git a/src/Commands/LFS.cs b/src/Commands/LFS.cs index 2b7d1de4..f7e56486 100644 --- a/src/Commands/LFS.cs +++ b/src/Commands/LFS.cs @@ -82,7 +82,7 @@ namespace SourceGit.Commands var rs = cmd.ReadToEnd(); if (rs.IsSuccess) { - var lines = rs.StdOut.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); + var lines = rs.StdOut.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries); foreach (var line in lines) { var match = REG_LOCK().Match(line); diff --git a/src/Commands/QueryBranches.cs b/src/Commands/QueryBranches.cs index 44438cef..8dbc4055 100644 --- a/src/Commands/QueryBranches.cs +++ b/src/Commands/QueryBranches.cs @@ -24,7 +24,7 @@ namespace SourceGit.Commands if (!rs.IsSuccess) return branches; - var lines = rs.StdOut.Split('\n', StringSplitOptions.RemoveEmptyEntries); + var lines = rs.StdOut.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries); var remoteBranches = new HashSet(); foreach (var line in lines) { diff --git a/src/Commands/QueryCommitSignInfo.cs b/src/Commands/QueryCommitSignInfo.cs index 7b53a1f2..4f729a8d 100644 --- a/src/Commands/QueryCommitSignInfo.cs +++ b/src/Commands/QueryCommitSignInfo.cs @@ -20,11 +20,11 @@ namespace SourceGit.Commands if (!rs.IsSuccess) return null; - var raw = rs.StdOut.Trim(); + var raw = rs.StdOut.Trim().ReplaceLineEndings("\n"); if (raw.Length <= 1) return null; - var lines = raw.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries); + var lines = raw.Split('\n'); return new Models.CommitSignInfo() { VerifyResult = lines[0][0], diff --git a/src/Commands/QueryCommits.cs b/src/Commands/QueryCommits.cs index 312c068f..8d704aee 100644 --- a/src/Commands/QueryCommits.cs +++ b/src/Commands/QueryCommits.cs @@ -10,7 +10,7 @@ namespace SourceGit.Commands { WorkingDirectory = repo; Context = repo; - Args = $"log --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 --no-show-signature --decorate=full --format=%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%s {limits}"; _findFirstMerged = needFindHead; } @@ -35,7 +35,7 @@ namespace SourceGit.Commands var argsBuilder = new StringBuilder(); argsBuilder.Append(search); - var words = filter.Split(new[] { ' ', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries); + var words = filter.Split([' ', '\t', '\r'], StringSplitOptions.RemoveEmptyEntries); foreach (var word in words) { var escaped = word.Trim().Replace("\"", "\\\"", StringComparison.Ordinal); @@ -124,7 +124,7 @@ namespace SourceGit.Commands Args = $"log --since=\"{_commits[^1].CommitterTimeStr}\" --format=\"%H\""; var rs = ReadToEnd(); - var shas = rs.StdOut.Split('\n', StringSplitOptions.RemoveEmptyEntries); + var shas = rs.StdOut.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries); if (shas.Length == 0) return; diff --git a/src/Commands/QueryRefsContainsCommit.cs b/src/Commands/QueryRefsContainsCommit.cs index 82e9b341..cabe1b50 100644 --- a/src/Commands/QueryRefsContainsCommit.cs +++ b/src/Commands/QueryRefsContainsCommit.cs @@ -20,7 +20,7 @@ namespace SourceGit.Commands if (!output.IsSuccess) return rs; - var lines = output.StdOut.Split('\n'); + var lines = output.StdOut.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries); foreach (var line in lines) { if (line.EndsWith("/HEAD", StringComparison.Ordinal)) diff --git a/src/Commands/QueryStagedChangesWithAmend.cs b/src/Commands/QueryStagedChangesWithAmend.cs index f5c9659f..cfea5e35 100644 --- a/src/Commands/QueryStagedChangesWithAmend.cs +++ b/src/Commands/QueryStagedChangesWithAmend.cs @@ -24,7 +24,7 @@ namespace SourceGit.Commands if (rs.IsSuccess) { var changes = new List(); - var lines = rs.StdOut.Split('\n', StringSplitOptions.RemoveEmptyEntries); + var lines = rs.StdOut.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries); foreach (var line in lines) { var match = REG_FORMAT2().Match(line); diff --git a/src/Commands/QuerySubmodules.cs b/src/Commands/QuerySubmodules.cs index 1ceccf78..e2debd06 100644 --- a/src/Commands/QuerySubmodules.cs +++ b/src/Commands/QuerySubmodules.cs @@ -26,7 +26,7 @@ namespace SourceGit.Commands var rs = ReadToEnd(); var builder = new StringBuilder(); - var lines = rs.StdOut.Split('\n', System.StringSplitOptions.RemoveEmptyEntries); + var lines = rs.StdOut.Split(['r', '\n'], System.StringSplitOptions.RemoveEmptyEntries); foreach (var line in lines) { var match = REG_FORMAT1().Match(line); @@ -55,7 +55,7 @@ namespace SourceGit.Commands return submodules; var dirty = new HashSet(); - lines = rs.StdOut.Split('\n', System.StringSplitOptions.RemoveEmptyEntries); + lines = rs.StdOut.Split(['\r', '\n'], System.StringSplitOptions.RemoveEmptyEntries); foreach (var line in lines) { var match = REG_FORMAT_STATUS().Match(line); diff --git a/src/Commands/QueryTrackStatus.cs b/src/Commands/QueryTrackStatus.cs index 0bf9746f..e7e1f1c9 100644 --- a/src/Commands/QueryTrackStatus.cs +++ b/src/Commands/QueryTrackStatus.cs @@ -19,7 +19,7 @@ namespace SourceGit.Commands if (!rs.IsSuccess) return status; - var lines = rs.StdOut.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); + var lines = rs.StdOut.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries); foreach (var line in lines) { if (line[0] == '>') diff --git a/src/Commands/Worktree.cs b/src/Commands/Worktree.cs index b73b8573..960d5501 100644 --- a/src/Commands/Worktree.cs +++ b/src/Commands/Worktree.cs @@ -21,7 +21,7 @@ namespace SourceGit.Commands var last = null as Models.Worktree; if (rs.IsSuccess) { - var lines = rs.StdOut.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); + var lines = rs.StdOut.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries); foreach (var line in lines) { if (line.StartsWith("worktree ", StringComparison.Ordinal)) From 8d47bd5cd9451360acda528f9dff25fdec431686 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 20:46:01 +0800 Subject: [PATCH 023/571] refactor: use `--format=` instead of `--pretty=format:` Signed-off-by: leo --- src/Commands/QueryCommitFullMessage.cs | 2 +- src/Commands/QueryCommitSignInfo.cs | 6 ++---- src/Commands/QueryCommits.cs | 2 +- src/Commands/QueryCommitsForInteractiveRebase.cs | 2 +- src/Commands/QuerySingleCommit.cs | 2 +- src/Commands/QueryStashes.cs | 2 +- src/Commands/Statistics.cs | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Commands/QueryCommitFullMessage.cs b/src/Commands/QueryCommitFullMessage.cs index c8f1867d..36b6d1c7 100644 --- a/src/Commands/QueryCommitFullMessage.cs +++ b/src/Commands/QueryCommitFullMessage.cs @@ -6,7 +6,7 @@ namespace SourceGit.Commands { WorkingDirectory = repo; Context = repo; - Args = $"show --no-show-signature --pretty=format:%B -s {sha}"; + Args = $"show --no-show-signature --format=%B -s {sha}"; } public string Result() diff --git a/src/Commands/QueryCommitSignInfo.cs b/src/Commands/QueryCommitSignInfo.cs index 4f729a8d..799e142d 100644 --- a/src/Commands/QueryCommitSignInfo.cs +++ b/src/Commands/QueryCommitSignInfo.cs @@ -1,6 +1,4 @@ -using System; - -namespace SourceGit.Commands +namespace SourceGit.Commands { public class QueryCommitSignInfo : Command { @@ -9,7 +7,7 @@ namespace SourceGit.Commands WorkingDirectory = repo; Context = repo; - const string baseArgs = "show --no-show-signature --pretty=format:\"%G?%n%GS%n%GK\" -s"; + const string baseArgs = "show --no-show-signature --format=%G?%n%GS%n%GK -s"; const string fakeSignersFileArg = "-c gpg.ssh.allowedSignersFile=/dev/null"; Args = $"{(useFakeSignersFile ? fakeSignersFileArg : string.Empty)} {baseArgs} {sha}"; } diff --git a/src/Commands/QueryCommits.cs b/src/Commands/QueryCommits.cs index 8d704aee..dd3c39b4 100644 --- a/src/Commands/QueryCommits.cs +++ b/src/Commands/QueryCommits.cs @@ -48,7 +48,7 @@ namespace SourceGit.Commands WorkingDirectory = repo; Context = repo; - Args = $"log -1000 --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 " + search; + Args = $"log -1000 --date-order --no-show-signature --decorate=full --format=%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%s " + search; _findFirstMerged = false; } diff --git a/src/Commands/QueryCommitsForInteractiveRebase.cs b/src/Commands/QueryCommitsForInteractiveRebase.cs index 232d86e5..615060a5 100644 --- a/src/Commands/QueryCommitsForInteractiveRebase.cs +++ b/src/Commands/QueryCommitsForInteractiveRebase.cs @@ -11,7 +11,7 @@ namespace SourceGit.Commands 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%B%n{_boundary}\" {on}..HEAD"; + Args = $"log --date-order --no-show-signature --decorate=full --format=\"%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%B%n{_boundary}\" {on}..HEAD"; } public List Result() diff --git a/src/Commands/QuerySingleCommit.cs b/src/Commands/QuerySingleCommit.cs index 1e1c9ea4..35289ec5 100644 --- a/src/Commands/QuerySingleCommit.cs +++ b/src/Commands/QuerySingleCommit.cs @@ -8,7 +8,7 @@ namespace SourceGit.Commands { WorkingDirectory = repo; Context = repo; - Args = $"show --no-show-signature --decorate=full --pretty=format:%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%s -s {sha}"; + Args = $"show --no-show-signature --decorate=full --format=%H%n%P%n%D%n%aN±%aE%n%at%n%cN±%cE%n%ct%n%s -s {sha}"; } public Models.Commit Result() diff --git a/src/Commands/QueryStashes.cs b/src/Commands/QueryStashes.cs index ccf601c5..dd5d10cc 100644 --- a/src/Commands/QueryStashes.cs +++ b/src/Commands/QueryStashes.cs @@ -9,7 +9,7 @@ namespace SourceGit.Commands { WorkingDirectory = repo; Context = repo; - Args = "stash list --pretty=format:%H%n%P%n%ct%n%gd%n%s"; + Args = "stash list --format=%H%n%P%n%ct%n%gd%n%s"; } public List Result() diff --git a/src/Commands/Statistics.cs b/src/Commands/Statistics.cs index 511c43e8..1439cedd 100644 --- a/src/Commands/Statistics.cs +++ b/src/Commands/Statistics.cs @@ -8,7 +8,7 @@ namespace SourceGit.Commands { WorkingDirectory = repo; Context = repo; - Args = $"log --date-order --branches --remotes -{max} --pretty=format:\"%ct$%aN\""; + Args = $"log --date-order --branches --remotes -{max} --format=%ct$%aN"; } public Models.Statistics Result() From 695db2a319918d6ec96ec317432b0b656a154ab3 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 17 Mar 2025 20:57:18 +0800 Subject: [PATCH 024/571] code_style: run `dotnet format` Signed-off-by: leo --- src/Commands/QueryCommitSignInfo.cs | 1 - src/Native/MacOS.cs | 2 +- src/Views/About.axaml | 2 +- src/Views/AddWorktree.axaml | 10 +- src/Views/Askpass.axaml | 4 +- src/Views/AssumeUnchangedManager.axaml | 10 +- src/Views/Blame.axaml | 2 +- src/Views/BranchCompare.axaml | 4 +- src/Views/ChangeCollectionView.axaml | 4 +- src/Views/ChangeViewModeSwitcher.axaml | 2 +- src/Views/CherryPick.axaml | 8 +- src/Views/Clone.axaml | 36 ++-- src/Views/CommitBaseInfo.axaml | 14 +- src/Views/CommitChanges.axaml | 2 +- src/Views/CommitDetail.axaml | 20 +-- src/Views/CommitMessageTextBox.axaml | 4 +- src/Views/CommitRelationTracking.axaml | 2 +- src/Views/ConfigureWorkspace.axaml | 10 +- src/Views/ConfirmCommitWithoutFiles.axaml | 2 +- src/Views/DeleteBranch.axaml | 2 +- src/Views/DeleteRepositoryNode.axaml | 2 +- src/Views/DeleteTag.axaml | 2 +- src/Views/DiffView.axaml | 26 +-- src/Views/Discard.axaml | 16 +- src/Views/EditRepositoryNode.axaml | 2 +- src/Views/FileHistories.axaml | 6 +- src/Views/FilterModeSwitchButton.axaml | 2 +- src/Views/Histories.axaml | 12 +- src/Views/Hotkeys.axaml | 12 +- src/Views/ImageDiffView.axaml | 12 +- src/Views/Init.axaml | 2 +- src/Views/InteractiveRebase.axaml | 22 +-- src/Views/LFSFetch.axaml | 4 +- src/Views/LFSLocks.axaml | 4 +- src/Views/LFSTrackCustomPattern.axaml | 2 +- src/Views/Launcher.axaml | 6 +- src/Views/LauncherPage.axaml | 8 +- src/Views/LauncherTabBar.axaml | 2 +- src/Views/Merge.axaml | 2 +- src/Views/MergeMultiple.axaml | 6 +- src/Views/PopupRunningStatus.axaml | 6 +- src/Views/Preferences.axaml | 12 +- src/Views/Push.axaml | 4 +- src/Views/RepositoryConfigure.axaml | 14 +- src/Views/RepositoryToolbar.axaml | 210 +++++++++++----------- src/Views/RevisionCompare.axaml | 4 +- src/Views/RevisionFileContentViewer.axaml | 4 +- src/Views/RevisionFiles.axaml | 2 +- src/Views/Reword.axaml | 4 +- src/Views/SelfUpdate.axaml | 2 +- src/Views/StashChanges.axaml | 12 +- src/Views/TagsView.axaml | 20 +-- src/Views/TextDiffView.axaml | 10 +- src/Views/WelcomeToolbar.axaml | 4 +- src/Views/WorkingCopy.axaml | 16 +- 55 files changed, 307 insertions(+), 308 deletions(-) diff --git a/src/Commands/QueryCommitSignInfo.cs b/src/Commands/QueryCommitSignInfo.cs index 799e142d..133949af 100644 --- a/src/Commands/QueryCommitSignInfo.cs +++ b/src/Commands/QueryCommitSignInfo.cs @@ -29,7 +29,6 @@ Signer = lines[1], Key = lines[2] }; - } } } diff --git a/src/Native/MacOS.cs b/src/Native/MacOS.cs index 123b160b..d7ef4701 100644 --- a/src/Native/MacOS.cs +++ b/src/Native/MacOS.cs @@ -31,7 +31,7 @@ namespace SourceGit.Native var env = File.ReadAllText(customPathFile).Trim(); if (!string.IsNullOrEmpty(env)) path = env; - } + } Environment.SetEnvironmentVariable("PATH", path); } diff --git a/src/Views/About.axaml b/src/Views/About.axaml index 28529b63..d0dd7b82 100644 --- a/src/Views/About.axaml +++ b/src/Views/About.axaml @@ -28,7 +28,7 @@ Text="{DynamicResource Text.About}" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False"/> - + diff --git a/src/Views/AddWorktree.axaml b/src/Views/AddWorktree.axaml index d6853aab..1811008c 100644 --- a/src/Views/AddWorktree.axaml +++ b/src/Views/AddWorktree.axaml @@ -27,7 +27,7 @@ - + - + - - + Text="{DynamicResource Text.AddWorktree.Tracking}"/> + - + - + - + - + @@ -62,7 +62,7 @@ - + @@ -73,7 +73,7 @@ ToolTip.Tip="{DynamicResource Text.Diff.Next}"> - + - - + - + diff --git a/src/Views/Discard.axaml b/src/Views/Discard.axaml index 23162060..1699b051 100644 --- a/src/Views/Discard.axaml +++ b/src/Views/Discard.axaml @@ -11,16 +11,16 @@ - + - - + @@ -31,13 +31,13 @@ Text="{DynamicResource Text.Discard.Changes}"/> - + - + - + - diff --git a/src/Views/EditRepositoryNode.axaml b/src/Views/EditRepositoryNode.axaml index ac8f50f3..615e3f11 100644 --- a/src/Views/EditRepositoryNode.axaml +++ b/src/Views/EditRepositoryNode.axaml @@ -43,7 +43,7 @@ Fill="{Binding Converter={x:Static c:IntConverters.ToBookmarkBrush}}" HorizontalAlignment="Center" VerticalAlignment="Center" Data="{StaticResource Icons.Bookmark}"/> - + diff --git a/src/Views/FileHistories.axaml b/src/Views/FileHistories.axaml index 124b2e00..e33156fb 100644 --- a/src/Views/FileHistories.axaml +++ b/src/Views/FileHistories.axaml @@ -37,7 +37,7 @@ Text="{DynamicResource Text.FileHistory}" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False"/> - + @@ -184,7 +184,7 @@ - + @@ -234,7 +234,7 @@ HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="{Binding IsLoading}"/> - + diff --git a/src/Views/FilterModeSwitchButton.axaml b/src/Views/FilterModeSwitchButton.axaml index 0fbbbf8e..b202c434 100644 --- a/src/Views/FilterModeSwitchButton.axaml +++ b/src/Views/FilterModeSwitchButton.axaml @@ -5,7 +5,7 @@ xmlns:m="using:SourceGit.Models" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="SourceGit.Views.FilterModeSwitchButton" - x:Name="ThisControl"> + x:Name="ThisControl"> @@ -104,7 +104,7 @@ - + diff --git a/src/Views/LFSTrackCustomPattern.axaml b/src/Views/LFSTrackCustomPattern.axaml index 36eaef65..f60304d5 100644 --- a/src/Views/LFSTrackCustomPattern.axaml +++ b/src/Views/LFSTrackCustomPattern.axaml @@ -11,7 +11,7 @@ - + + WindowStartupLocation="CenterScreen"> @@ -80,7 +80,7 @@ - @@ -93,7 +93,7 @@ - + diff --git a/src/Views/LauncherPage.axaml b/src/Views/LauncherPage.axaml index 81f504c1..7ce450de 100644 --- a/src/Views/LauncherPage.axaml +++ b/src/Views/LauncherPage.axaml @@ -17,14 +17,14 @@ - + - + @@ -32,7 +32,7 @@ - + @@ -138,7 +138,7 @@ + diff --git a/src/Views/LauncherTabBar.axaml b/src/Views/LauncherTabBar.axaml index 9b748e91..73b48f58 100644 --- a/src/Views/LauncherTabBar.axaml +++ b/src/Views/LauncherTabBar.axaml @@ -54,7 +54,7 @@ - + - + diff --git a/src/Views/MergeMultiple.axaml b/src/Views/MergeMultiple.axaml index bb543e16..332d9fef 100644 --- a/src/Views/MergeMultiple.axaml +++ b/src/Views/MergeMultiple.axaml @@ -12,7 +12,7 @@ - + - + @@ -84,7 +84,7 @@ - + diff --git a/src/Views/PopupRunningStatus.axaml b/src/Views/PopupRunningStatus.axaml index c2d86f51..a8467415 100644 --- a/src/Views/PopupRunningStatus.axaml +++ b/src/Views/PopupRunningStatus.axaml @@ -9,19 +9,19 @@ x:Name="ThisControl"> - + - + - + - + - + @@ -635,7 +635,7 @@ - + @@ -646,7 +646,7 @@ - + @@ -725,8 +725,8 @@ - - + + diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml index f6a02c49..de777800 100644 --- a/src/Views/RepositoryConfigure.axaml +++ b/src/Views/RepositoryConfigure.axaml @@ -65,7 +65,7 @@ CornerRadius="3" Watermark="{DynamicResource Text.Configure.Email.Placeholder}" Text="{Binding UserEmail, Mode=TwoWay}"/> - + - @@ -256,7 +256,7 @@ - + @@ -315,7 +315,7 @@ - + @@ -442,7 +442,7 @@ - + diff --git a/src/Views/RepositoryToolbar.axaml b/src/Views/RepositoryToolbar.axaml index a409d8d0..9f7f1801 100644 --- a/src/Views/RepositoryToolbar.axaml +++ b/src/Views/RepositoryToolbar.axaml @@ -8,128 +8,128 @@ x:Class="SourceGit.Views.RepositoryToolbar" x:DataType="vm:Repository"> - - + + - - - + - + - - + - - + + - + + + + - + + + - + + + - + + + - + - - + - - + - - - - - - - - + - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Views/RevisionCompare.axaml b/src/Views/RevisionCompare.axaml index 73703ff1..f0498fbf 100644 --- a/src/Views/RevisionCompare.axaml +++ b/src/Views/RevisionCompare.axaml @@ -15,7 +15,7 @@ - + @@ -32,7 +32,7 @@ - + diff --git a/src/Views/RevisionFileContentViewer.axaml b/src/Views/RevisionFileContentViewer.axaml index a3a168cf..86393316 100644 --- a/src/Views/RevisionFileContentViewer.axaml +++ b/src/Views/RevisionFileContentViewer.axaml @@ -35,12 +35,12 @@ - + - + diff --git a/src/Views/RevisionFiles.axaml b/src/Views/RevisionFiles.axaml index e0c6577d..6575dc66 100644 --- a/src/Views/RevisionFiles.axaml +++ b/src/Views/RevisionFiles.axaml @@ -50,7 +50,7 @@ - + - + - + - + - + - + + - + diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index c9b94d59..4d79135d 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -23,7 +23,7 @@ - + @@ -106,7 +106,7 @@ - + - + - + @@ -186,7 +186,7 @@ - + @@ -277,7 +277,7 @@ Width="18" Height="18" HorizontalAlignment="Right" IsVisible="{Binding IsCommitting}"/> - + - + From 760e44877ba02104638f0f5fd31c0ee556d6ff7d Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 18 Mar 2025 12:15:00 +0800 Subject: [PATCH 025/571] fix: wrong split char Signed-off-by: leo --- src/Commands/QuerySubmodules.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/QuerySubmodules.cs b/src/Commands/QuerySubmodules.cs index e2debd06..6016b0be 100644 --- a/src/Commands/QuerySubmodules.cs +++ b/src/Commands/QuerySubmodules.cs @@ -26,7 +26,7 @@ namespace SourceGit.Commands var rs = ReadToEnd(); var builder = new StringBuilder(); - var lines = rs.StdOut.Split(['r', '\n'], System.StringSplitOptions.RemoveEmptyEntries); + var lines = rs.StdOut.Split(['\r', '\n'], System.StringSplitOptions.RemoveEmptyEntries); foreach (var line in lines) { var match = REG_FORMAT1().Match(line); From 822452a20c36054837612cbf43e21795bead6ecc Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 18 Mar 2025 15:55:32 +0800 Subject: [PATCH 026/571] enhance: show inner exception message if possible when check update failed Signed-off-by: leo --- src/App.axaml.cs | 2 +- src/Models/{Version.cs => SelfUpdate.cs} | 24 ++++++++++++-- src/Views/SelfUpdate.axaml | 41 ++++++++++++------------ 3 files changed, 43 insertions(+), 24 deletions(-) rename src/Models/{Version.cs => SelfUpdate.cs} (65%) diff --git a/src/App.axaml.cs b/src/App.axaml.cs index f59d35db..af5e6177 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -532,7 +532,7 @@ namespace SourceGit catch (Exception e) { if (manually) - ShowSelfUpdateResult(e); + ShowSelfUpdateResult(new Models.SelfUpdateFailed(e)); } }); } diff --git a/src/Models/Version.cs b/src/Models/SelfUpdate.cs similarity index 65% rename from src/Models/Version.cs rename to src/Models/SelfUpdate.cs index 35c21778..e02f80d8 100644 --- a/src/Models/Version.cs +++ b/src/Models/SelfUpdate.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Text.Json.Serialization; namespace SourceGit.Models @@ -32,5 +33,24 @@ namespace SourceGit.Models } } - public class AlreadyUpToDate { } + public class AlreadyUpToDate + { + } + + public class SelfUpdateFailed + { + public string Reason + { + get; + private set; + } + + public SelfUpdateFailed(Exception e) + { + if (e.InnerException is { } inner) + Reason = inner.Message; + else + Reason = e.Message; + } + } } diff --git a/src/Views/SelfUpdate.axaml b/src/Views/SelfUpdate.axaml index 0a6fef34..2d5990e7 100644 --- a/src/Views/SelfUpdate.axaml +++ b/src/Views/SelfUpdate.axaml @@ -5,7 +5,6 @@ xmlns:m="using:SourceGit.Models" xmlns:vm="using:SourceGit.ViewModels" xmlns:v="using:SourceGit.Views" - xmlns:sys="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="SourceGit.Views.SelfUpdate" x:DataType="vm:SelfUpdate" @@ -87,26 +86,6 @@ - - - - - - - - - - + + + + - Date: Mon, 7 Apr 2025 11:45:14 +0800 Subject: [PATCH 079/571] code_review: PR #1153 - use a single filter for both unstage and staged files - show confirm dialog if staged files are displayed partially Signed-off-by: leo --- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/ViewModels/ConfirmCommit.cs | 26 +++++ src/ViewModels/ConfirmCommitWithoutFiles.cs | 19 ---- src/ViewModels/WorkingCopy.cs | 75 +++++------- ...WithoutFiles.axaml => ConfirmCommit.axaml} | 6 +- ...tFiles.axaml.cs => ConfirmCommit.axaml.cs} | 10 +- src/Views/WorkingCopy.axaml | 107 +++++++----------- 9 files changed, 103 insertions(+), 143 deletions(-) create mode 100644 src/ViewModels/ConfirmCommit.cs delete mode 100644 src/ViewModels/ConfirmCommitWithoutFiles.cs rename src/Views/{ConfirmCommitWithoutFiles.axaml => ConfirmCommit.axaml} (92%) rename src/Views/{ConfirmCommitWithoutFiles.axaml.cs => ConfirmCommit.axaml.cs} (57%) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 5ff1e3a4..61140173 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -719,6 +719,7 @@ Trigger click event Commit (Edit) Stage all changes and commit + You have staged {0} file(s) but only {1} file(s) displayed ({2} files are filtered out). Do you want to continue? Empty commit detected! Do you want to continue (--allow-empty)? CONFLICTS DETECTED FILE CONFLICTS ARE RESOLVED diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 8d2b4f1e..fec5c780 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -723,6 +723,7 @@ 触发点击事件 提交(修改原始提交) 自动暂存所有变更并提交 + 当前有 {0} 个文件在暂存区中,但仅显示了 {1} 个文件({2} 个文件被过滤掉了),是否继续提交? 提交未包含变更文件!是否继续(--allow-empty)? 检测到冲突 文件冲突已解决 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 8e823f68..66bcc33a 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -722,6 +722,7 @@ 觸發點擊事件 提交 (修改原始提交) 自動暫存全部變更並提交 + 您已暫存 {0} 檔案,但只顯示 {1} 檔案 ({2} 檔案被篩選器隱藏)。您要繼續嗎? 未包含任何檔案變更! 您是否仍要提交 (--allow-empty)? 檢測到衝突 檔案衝突已解決 diff --git a/src/ViewModels/ConfirmCommit.cs b/src/ViewModels/ConfirmCommit.cs new file mode 100644 index 00000000..cea56948 --- /dev/null +++ b/src/ViewModels/ConfirmCommit.cs @@ -0,0 +1,26 @@ +using System; + +namespace SourceGit.ViewModels +{ + public class ConfirmCommit + { + public string Message + { + get; + private set; + } + + public ConfirmCommit(string message, Action onSure) + { + Message = message; + _onSure = onSure; + } + + public void Continue() + { + _onSure?.Invoke(); + } + + private Action _onSure; + } +} diff --git a/src/ViewModels/ConfirmCommitWithoutFiles.cs b/src/ViewModels/ConfirmCommitWithoutFiles.cs deleted file mode 100644 index 3249fba8..00000000 --- a/src/ViewModels/ConfirmCommitWithoutFiles.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace SourceGit.ViewModels -{ - public class ConfirmCommitWithoutFiles - { - public ConfirmCommitWithoutFiles(WorkingCopy wc, bool autoPush) - { - _wc = wc; - _autoPush = autoPush; - } - - public void Continue() - { - _wc.CommitWithoutFiles(_autoPush); - } - - private readonly WorkingCopy _wc; - private bool _autoPush; - } -} diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index 3e6f6fbd..a0933ea3 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -99,38 +99,23 @@ namespace SourceGit.ViewModels } } - public string UnstagedFilter + public string Filter { - get => _unstagedFilter; + get => _filter; set { - if (SetProperty(ref _unstagedFilter, value)) + if (SetProperty(ref _filter, value)) { if (_isLoadingData) return; - VisibleUnstaged = GetVisibleChanges(_unstaged, _unstagedFilter); + VisibleUnstaged = GetVisibleChanges(_unstaged); + VisibleStaged = GetVisibleChanges(_staged); SelectedUnstaged = []; } } } - public string StagedFilter - { - get => _stagedFilter; - set - { - if (SetProperty(ref _stagedFilter, value)) - { - if (_isLoadingData) - return; - - VisibleStaged = GetVisibleChanges(_staged, _stagedFilter); - SelectedStaged = []; - } - } - } - public List Unstaged { get => _unstaged; @@ -294,7 +279,7 @@ namespace SourceGit.ViewModels } } - var visibleUnstaged = GetVisibleChanges(unstaged, _unstagedFilter); + var visibleUnstaged = GetVisibleChanges(unstaged); var selectedUnstaged = new List(); foreach (var c in visibleUnstaged) { @@ -304,7 +289,7 @@ namespace SourceGit.ViewModels var staged = GetStagedChanges(); - var visibleStaged = GetVisibleChanges(staged, _stagedFilter); + var visibleStaged = GetVisibleChanges(staged); var selectedStaged = new List(); foreach (var c in visibleStaged) { @@ -374,14 +359,9 @@ namespace SourceGit.ViewModels _repo.ShowPopup(new Discard(_repo, changes)); } - public void ClearUnstagedFilter() + public void ClearFilter() { - UnstagedFilter = string.Empty; - } - - public void ClearStagedFilter() - { - StagedFilter = string.Empty; + Filter = string.Empty; } public async void UseTheirs(List changes) @@ -571,11 +551,6 @@ namespace SourceGit.ViewModels DoCommit(false, true, false); } - public void CommitWithoutFiles(bool autoPush) - { - DoCommit(false, autoPush, true); - } - public ContextMenu CreateContextMenuForUnstagedChanges() { if (_selectedUnstaged == null || _selectedUnstaged.Count == 0) @@ -1505,16 +1480,16 @@ namespace SourceGit.ViewModels return menu; } - private List GetVisibleChanges(List changes, string filter) + private List GetVisibleChanges(List changes) { - if (string.IsNullOrEmpty(filter)) + if (string.IsNullOrEmpty(_filter)) return changes; var visible = new List(); foreach (var c in changes) { - if (c.Path.Contains(filter, StringComparison.OrdinalIgnoreCase)) + if (c.Path.Contains(_filter, StringComparison.OrdinalIgnoreCase)) visible.Add(c); } @@ -1675,7 +1650,7 @@ namespace SourceGit.ViewModels DetailContext = new DiffContext(_repo.FullPath, new Models.DiffOption(change, isUnstaged), _detailContext as DiffContext); } - private void DoCommit(bool autoStage, bool autoPush, bool allowEmpty) + private void DoCommit(bool autoStage, bool autoPush, bool allowEmpty = false, bool confirmWithFilter = false) { if (!_repo.CanCreatePopup()) { @@ -1683,10 +1658,17 @@ namespace SourceGit.ViewModels return; } - if (!string.IsNullOrEmpty(_stagedFilter)) + if (!string.IsNullOrEmpty(_filter) && _staged.Count > _visibleStaged.Count && !confirmWithFilter) { - // FIXME - make this a proper warning message-box "Staged-area filter will not be applied to commit. Continue?" Yes/No - App.RaiseException(_repo.FullPath, "Committing with staged-area filter applied is NOT allowed!"); + var confirmMessage = App.Text("WorkingCopy.ConfirmCommitWithFilter", _staged.Count, _visibleStaged.Count, _staged.Count - _visibleStaged.Count); + App.OpenDialog(new Views.ConfirmCommit() + { + DataContext = new ConfirmCommit(confirmMessage, () => + { + DoCommit(autoStage, autoPush, allowEmpty, true); + }) + }); + return; } @@ -1700,9 +1682,13 @@ namespace SourceGit.ViewModels { if ((autoStage && _count == 0) || (!autoStage && _staged.Count == 0)) { - App.OpenDialog(new Views.ConfirmCommitWithoutFiles() + var confirmMessage = App.Text("WorkingCopy.ConfirmCommitWithoutFiles"); + App.OpenDialog(new Views.ConfirmCommit() { - DataContext = new ConfirmCommitWithoutFiles(this, autoPush) + DataContext = new ConfirmCommit(confirmMessage, () => + { + DoCommit(autoStage, autoPush, true, confirmWithFilter); + }) }); return; @@ -1774,8 +1760,7 @@ namespace SourceGit.ViewModels private List _selectedStaged = []; private int _count = 0; private object _detailContext = null; - private string _unstagedFilter = string.Empty; - private string _stagedFilter = string.Empty; + private string _filter = string.Empty; private string _commitMessage = string.Empty; private bool _hasUnsolvedConflicts = false; diff --git a/src/Views/ConfirmCommitWithoutFiles.axaml b/src/Views/ConfirmCommit.axaml similarity index 92% rename from src/Views/ConfirmCommitWithoutFiles.axaml rename to src/Views/ConfirmCommit.axaml index 4c9fd1c8..77bbdb30 100644 --- a/src/Views/ConfirmCommitWithoutFiles.axaml +++ b/src/Views/ConfirmCommit.axaml @@ -5,8 +5,8 @@ xmlns:v="using:SourceGit.Views" xmlns:vm="using:SourceGit.ViewModels" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" - x:Class="SourceGit.Views.ConfirmCommitWithoutFiles" - x:DataType="vm:ConfirmCommitWithoutFiles" + x:Class="SourceGit.Views.ConfirmCommit" + x:DataType="vm:ConfirmCommit" x:Name="ThisControl" Icon="/App.ico" Title="{DynamicResource Text.Warn}" @@ -38,7 +38,7 @@ - + diff --git a/src/Views/ConfirmCommitWithoutFiles.axaml.cs b/src/Views/ConfirmCommit.axaml.cs similarity index 57% rename from src/Views/ConfirmCommitWithoutFiles.axaml.cs rename to src/Views/ConfirmCommit.axaml.cs index 342600fc..1cf770cb 100644 --- a/src/Views/ConfirmCommitWithoutFiles.axaml.cs +++ b/src/Views/ConfirmCommit.axaml.cs @@ -2,20 +2,16 @@ using Avalonia.Interactivity; namespace SourceGit.Views { - public partial class ConfirmCommitWithoutFiles : ChromelessWindow + public partial class ConfirmCommit : ChromelessWindow { - public ConfirmCommitWithoutFiles() + public ConfirmCommit() { InitializeComponent(); } private void Sure(object _1, RoutedEventArgs _2) { - if (DataContext is ViewModels.ConfirmCommitWithoutFiles vm) - { - vm.Continue(); - } - + (DataContext as ViewModels.ConfirmCommit)?.Continue(); Close(); } diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index 6af2b448..94dd0c30 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -19,13 +19,46 @@ + + + + + + + + + + + + + + - + @@ -75,40 +108,8 @@ - - - - - - - - - - - - - - - - + @@ -155,41 +156,9 @@ ViewMode="{Binding Source={x:Static vm:Preferences.Instance}, Path=StagedChangeViewMode, Mode=TwoWay}"/> - - - - - - - - - - - - - - Date: Mon, 7 Apr 2025 03:48:59 +0000 Subject: [PATCH 080/571] doc: Update translation status and missing keys --- TRANSLATION.md | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index b344e6a3..6ebb72c1 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,7 +6,7 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-98.65%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-98.52%25-yellow)
Missing keys in de_DE.axaml @@ -21,34 +21,51 @@ This document shows the translation status of each locale file in the repository - Text.Preferences.Appearance.EditorTabWidth - Text.Preferences.General.ShowTagsInGraph - Text.StashCM.SaveAsPatch +- Text.WorkingCopy.ConfirmCommitWithFilter
-### ![es__ES](https://img.shields.io/badge/es__ES-%E2%88%9A-brightgreen) +### ![es__ES](https://img.shields.io/badge/es__ES-99.87%25-yellow) -### ![fr__FR](https://img.shields.io/badge/fr__FR-%E2%88%9A-brightgreen) +
+Missing keys in es_ES.axaml -### ![it__IT](https://img.shields.io/badge/it__IT-99.73%25-yellow) +- Text.WorkingCopy.ConfirmCommitWithFilter + +
+ +### ![fr__FR](https://img.shields.io/badge/fr__FR-99.87%25-yellow) + +
+Missing keys in fr_FR.axaml + +- Text.WorkingCopy.ConfirmCommitWithFilter + +
+ +### ![it__IT](https://img.shields.io/badge/it__IT-99.60%25-yellow)
Missing keys in it_IT.axaml - Text.CopyFullPath - Text.Preferences.General.ShowTagsInGraph +- Text.WorkingCopy.ConfirmCommitWithFilter
-### ![ja__JP](https://img.shields.io/badge/ja__JP-99.73%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-99.60%25-yellow)
Missing keys in ja_JP.axaml - Text.Repository.FilterCommits - Text.Repository.Tags.OrderByNameDes +- Text.WorkingCopy.ConfirmCommitWithFilter
-### ![pt__BR](https://img.shields.io/badge/pt__BR-90.98%25-yellow) +### ![pt__BR](https://img.shields.io/badge/pt__BR-90.86%25-yellow)
Missing keys in pt_BR.axaml @@ -119,11 +136,19 @@ This document shows the translation status of each locale file in the repository - Text.Stash.AutoRestore.Tip - Text.StashCM.SaveAsPatch - Text.WorkingCopy.CommitToEdit +- Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.SignOff
-### ![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen) +### ![ru__RU](https://img.shields.io/badge/ru__RU-99.87%25-yellow) + +
+Missing keys in ru_RU.axaml + +- Text.WorkingCopy.ConfirmCommitWithFilter + +
### ![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen) From b65c697e5b6e9af4c3f82a252fbf97a6f4582c68 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 7 Apr 2025 12:00:45 +0800 Subject: [PATCH 081/571] version: Release 2025.12 Signed-off-by: leo --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 75c26f38..8283ecf3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2025.11 \ No newline at end of file +2025.12 \ No newline at end of file From 39f7f119dd7784f10c9b462d1cc284c22b981423 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 7 Apr 2025 12:06:06 +0800 Subject: [PATCH 082/571] doc: always show current translation status in `develop` branch Signed-off-by: leo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aacf222e..75af9d2c 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ ## Translation Status -You can find the current translation status in [TRANSLATION.md](TRANSLATION.md) +You can find the current translation status in [TRANSLATION.md](https://github.com/sourcegit-scm/sourcegit/blob/develop/TRANSLATION.md) ## How to Use From ad9021e8920815198d655faa76abbcfdc1ca5f6c Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 7 Apr 2025 14:07:58 +0800 Subject: [PATCH 083/571] enhance: allow using `+` character in branch name (#1152) Signed-off-by: leo --- src/ViewModels/CreateBranch.cs | 2 +- src/ViewModels/RenameBranch.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/CreateBranch.cs b/src/ViewModels/CreateBranch.cs index 37db0065..6d7fe27a 100644 --- a/src/ViewModels/CreateBranch.cs +++ b/src/ViewModels/CreateBranch.cs @@ -6,7 +6,7 @@ namespace SourceGit.ViewModels public class CreateBranch : Popup { [Required(ErrorMessage = "Branch name is required!")] - [RegularExpression(@"^[\w \-/\.#]+$", ErrorMessage = "Bad branch name format!")] + [RegularExpression(@"^[\w \-/\.#\+]+$", ErrorMessage = "Bad branch name format!")] [CustomValidation(typeof(CreateBranch), nameof(ValidateBranchName))] public string Name { diff --git a/src/ViewModels/RenameBranch.cs b/src/ViewModels/RenameBranch.cs index 0679a5b5..f78eb46b 100644 --- a/src/ViewModels/RenameBranch.cs +++ b/src/ViewModels/RenameBranch.cs @@ -12,7 +12,7 @@ namespace SourceGit.ViewModels } [Required(ErrorMessage = "Branch name is required!!!")] - [RegularExpression(@"^[\w \-/\.#]+$", ErrorMessage = "Bad branch name format!")] + [RegularExpression(@"^[\w \-/\.#\+]+$", ErrorMessage = "Bad branch name format!")] [CustomValidation(typeof(RenameBranch), nameof(ValidateBranchName))] public string Name { From 3049730dd5c0acee68af771a9d3fa44a874a1ee9 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 7 Apr 2025 14:42:46 +0800 Subject: [PATCH 084/571] feature: add `Preferred Merge Mode` in repository configure (#1156) Signed-off-by: leo --- src/Models/RepositorySettings.cs | 6 ++++ src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/ViewModels/Merge.cs | 9 +++-- src/ViewModels/RepositoryConfigure.cs | 13 +++++++ src/Views/RepositoryConfigure.axaml | 52 ++++++++++++++++++++++----- 7 files changed, 73 insertions(+), 10 deletions(-) diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs index 76a7f160..1d326a5e 100644 --- a/src/Models/RepositorySettings.cs +++ b/src/Models/RepositorySettings.cs @@ -224,6 +224,12 @@ namespace SourceGit.Models set; } = []; + public int PreferredMergeMode + { + get; + set; + } = 0; + public Dictionary CollectHistoriesFilters() { var map = new Dictionary(); diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 61140173..d1e32e84 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -153,6 +153,7 @@ Fetch remotes automatically Minute(s) Default Remote + Preferred Merge Mode ISSUE TRACKER Add Sample Gitee Issue Rule Add Sample Gitee Pull Request Rule diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index fec5c780..932f1237 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -156,6 +156,7 @@ 启用定时自动拉取远程更新 分钟 默认远程 + 默认合并方式 ISSUE追踪 新增匹配Azure DevOps规则 新增匹配Gitee议题规则 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 66bcc33a..88b0ab64 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -156,6 +156,7 @@ 啟用定時自動提取 (fetch) 遠端更新 分鐘 預設遠端存放庫 + 首選合併模式 Issue 追蹤 新增符合 Azure DevOps 規則 新增符合 Gitee 議題規則 diff --git a/src/ViewModels/Merge.cs b/src/ViewModels/Merge.cs index be938867..faadaf57 100644 --- a/src/ViewModels/Merge.cs +++ b/src/ViewModels/Merge.cs @@ -69,9 +69,14 @@ namespace SourceGit.ViewModels private Models.MergeMode AutoSelectMergeMode() { + var preferredMergeModeIdx = _repo.Settings.PreferredMergeMode; + if (preferredMergeModeIdx < 0 || preferredMergeModeIdx > Models.MergeMode.Supported.Length) + preferredMergeModeIdx = 0; + + var defaultMergeMode = Models.MergeMode.Supported[preferredMergeModeIdx]; var config = new Commands.Config(_repo.FullPath).Get($"branch.{Into}.mergeoptions"); if (string.IsNullOrEmpty(config)) - return Models.MergeMode.Supported[0]; + return defaultMergeMode; if (config.Equals("--ff-only", StringComparison.Ordinal)) return Models.MergeMode.Supported[1]; if (config.Equals("--no-ff", StringComparison.Ordinal)) @@ -81,7 +86,7 @@ namespace SourceGit.ViewModels if (config.Equals("--no-commit", StringComparison.Ordinal) || config.Equals("--no-ff --no-commit", StringComparison.Ordinal)) return Models.MergeMode.Supported[4]; - return Models.MergeMode.Supported[0]; + return defaultMergeMode; } private readonly Repository _repo = null; diff --git a/src/ViewModels/RepositoryConfigure.cs b/src/ViewModels/RepositoryConfigure.cs index 3f590758..9a3bc9c4 100644 --- a/src/ViewModels/RepositoryConfigure.cs +++ b/src/ViewModels/RepositoryConfigure.cs @@ -36,6 +36,19 @@ namespace SourceGit.ViewModels } } + public int PreferredMergeMode + { + get => _repo.Settings.PreferredMergeMode; + set + { + if (_repo.Settings.PreferredMergeMode != value) + { + _repo.Settings.PreferredMergeMode = value; + OnPropertyChanged(); + } + } + } + public bool GPGCommitSigningEnabled { get; diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml index e41375b9..ee1d6fa8 100644 --- a/src/Views/RepositoryConfigure.axaml +++ b/src/Views/RepositoryConfigure.axaml @@ -44,7 +44,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + From 67fb0b300f90e6582a5343888fb0a719ab7fd197 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 7 Apr 2025 06:43:08 +0000 Subject: [PATCH 085/571] doc: Update translation status and missing keys --- TRANSLATION.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 6ebb72c1..0f44cbcf 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,13 +6,14 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-98.52%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-98.39%25-yellow)
Missing keys in de_DE.axaml - Text.BranchUpstreamInvalid - Text.Configure.CustomAction.WaitForExit +- Text.Configure.Git.PreferredMergeMode - Text.Configure.IssueTracker.AddSampleAzure - Text.CopyFullPath - Text.Diff.First @@ -25,47 +26,51 @@ This document shows the translation status of each locale file in the repository
-### ![es__ES](https://img.shields.io/badge/es__ES-99.87%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-99.73%25-yellow)
Missing keys in es_ES.axaml +- Text.Configure.Git.PreferredMergeMode - Text.WorkingCopy.ConfirmCommitWithFilter
-### ![fr__FR](https://img.shields.io/badge/fr__FR-99.87%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-99.73%25-yellow)
Missing keys in fr_FR.axaml +- Text.Configure.Git.PreferredMergeMode - Text.WorkingCopy.ConfirmCommitWithFilter
-### ![it__IT](https://img.shields.io/badge/it__IT-99.60%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-99.46%25-yellow)
Missing keys in it_IT.axaml +- Text.Configure.Git.PreferredMergeMode - Text.CopyFullPath - Text.Preferences.General.ShowTagsInGraph - Text.WorkingCopy.ConfirmCommitWithFilter
-### ![ja__JP](https://img.shields.io/badge/ja__JP-99.60%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-99.46%25-yellow)
Missing keys in ja_JP.axaml +- Text.Configure.Git.PreferredMergeMode - Text.Repository.FilterCommits - Text.Repository.Tags.OrderByNameDes - Text.WorkingCopy.ConfirmCommitWithFilter
-### ![pt__BR](https://img.shields.io/badge/pt__BR-90.86%25-yellow) +### ![pt__BR](https://img.shields.io/badge/pt__BR-90.74%25-yellow)
Missing keys in pt_BR.axaml @@ -86,6 +91,7 @@ This document shows the translation status of each locale file in the repository - Text.CommitDetail.Info.Children - Text.Configure.CustomAction.Scope.Branch - Text.Configure.CustomAction.WaitForExit +- Text.Configure.Git.PreferredMergeMode - Text.Configure.IssueTracker.AddSampleGiteeIssue - Text.Configure.IssueTracker.AddSampleGiteePullRequest - Text.CopyFullPath @@ -141,11 +147,12 @@ This document shows the translation status of each locale file in the repository
-### ![ru__RU](https://img.shields.io/badge/ru__RU-99.87%25-yellow) +### ![ru__RU](https://img.shields.io/badge/ru__RU-99.73%25-yellow)
Missing keys in ru_RU.axaml +- Text.Configure.Git.PreferredMergeMode - Text.WorkingCopy.ConfirmCommitWithFilter
From 3275dd07d226c6c6dc4c6a75b1f83d53108fdcbb Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 7 Apr 2025 16:03:49 +0800 Subject: [PATCH 086/571] enhance: auto stash and re-apply local changes before squashing (#1141) Signed-off-by: leo --- src/ViewModels/Histories.cs | 12 ------------ src/ViewModels/Squash.cs | 21 ++++++++++++++++++++- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 01114dd3..b0bbff3c 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -419,12 +419,6 @@ namespace SourceGit.ViewModels squash.Icon = App.CreateMenuIcon("Icons.SquashIntoParent"); squash.Click += (_, e) => { - if (_repo.LocalChangesCount > 0) - { - App.RaiseException(_repo.FullPath, "You have local changes. Please run stash or discard first."); - return; - } - if (_repo.CanCreatePopup()) _repo.ShowPopup(new Squash(_repo, commit, commit.SHA)); @@ -458,12 +452,6 @@ namespace SourceGit.ViewModels squash.IsEnabled = commit.Parents.Count == 1; squash.Click += (_, e) => { - if (_repo.LocalChangesCount > 0) - { - App.RaiseException(_repo.FullPath, "You have local changes. Please run stash or discard first."); - return; - } - if (commit.Parents.Count == 1) { var parent = _commits.Find(x => x.SHA == commit.Parents[0]); diff --git a/src/ViewModels/Squash.cs b/src/ViewModels/Squash.cs index 198dbe9a..eceb8339 100644 --- a/src/ViewModels/Squash.cs +++ b/src/ViewModels/Squash.cs @@ -33,9 +33,28 @@ namespace SourceGit.ViewModels return Task.Run(() => { - var succ = new Commands.Reset(_repo.FullPath, Target.SHA, "--soft").Exec(); + var autoStashed = false; + var succ = false; + + if (_repo.LocalChangesCount > 0) + { + succ = new Commands.Stash(_repo.FullPath).Push("SQUASH_AUTO_STASH"); + if (!succ) + { + CallUIThread(() => _repo.SetWatcherEnabled(true)); + return false; + } + + autoStashed = true; + } + + succ = new Commands.Reset(_repo.FullPath, Target.SHA, "--soft").Exec(); if (succ) succ = new Commands.Commit(_repo.FullPath, _message, true, _repo.Settings.EnableSignOffForCommit).Run(); + + if (succ && autoStashed) + new Commands.Stash(_repo.FullPath).Pop("stash@{0}"); + CallUIThread(() => _repo.SetWatcherEnabled(true)); return succ; }); From f5c213060eb842a302713ba27178c0f0a0c6e37b Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 7 Apr 2025 20:05:24 +0800 Subject: [PATCH 087/571] localization: keep all keys in order and remove duplicated keys in fr_FR (#1161) Signed-off-by: leo --- src/Resources/Locales/de_DE.axaml | 69 +++++------ src/Resources/Locales/en_US.axaml | 2 +- src/Resources/Locales/es_ES.axaml | 71 +++++------ src/Resources/Locales/fr_FR.axaml | 188 ++++++++++++++---------------- src/Resources/Locales/it_IT.axaml | 73 ++++++------ src/Resources/Locales/ja_JP.axaml | 69 +++++------ src/Resources/Locales/pt_BR.axaml | 90 ++++++-------- src/Resources/Locales/ru_RU.axaml | 92 +++++++-------- src/Resources/Locales/zh_CN.axaml | 70 +++++------ src/Resources/Locales/zh_TW.axaml | 70 +++++------ 10 files changed, 377 insertions(+), 417 deletions(-) diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index bbfe4545..276f44e8 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -2,19 +2,20 @@ + Info Über SourceGit Open Source & freier Git GUI Client Worktree hinzufügen - Was auschecken: - Existierender Branch - Neuen Branch erstellen Ordner: Pfad für diesen Worktree. Relativer Pfad wird unterstützt. Branch Name: Optional. Standard ist der Zielordnername. Branch verfolgen: Remote-Branch verfolgen + Was auschecken: + Neuen Branch erstellen + Existierender Branch OpenAI Assistent Neu generieren Verwende OpenAI, um Commit-Nachrichten zu generieren @@ -63,8 +64,8 @@ Branch Vergleich Bytes ABBRECHEN - Auf diese Revision zurücksetzen Auf Vorgänger-Revision zurücksetzen + Auf diese Revision zurücksetzen Generiere Commit-Nachricht ANZEIGE MODUS ÄNDERN Zeige als Datei- und Ordnerliste @@ -72,12 +73,12 @@ Zeige als Dateisystembaum Branch auschecken Commit auschecken - Warnung: Beim Auschecken eines Commits wird dein HEAD losgelöst (detached) sein! Commit: - Branch: + Warnung: Beim Auschecken eines Commits wird dein HEAD losgelöst (detached) sein! Lokale Änderungen: Verwerfen Stashen & wieder anwenden + Branch: Cherry Pick Quelle an Commit-Nachricht anhängen Commit(s): @@ -96,9 +97,9 @@ Repository URL: SCHLIESSEN Editor + Commit auschecken Diesen Commit cherry-picken Mehrere cherry-picken - Commit auschecken Mit HEAD vergleichen Mit Worktree vergleichen Info kopieren @@ -133,12 +134,12 @@ REFS SHA Im Browser öffnen - Commit-Nachricht Details + Commit-Nachricht Repository Einstellungen COMMIT TEMPLATE - Template Name: Template Inhalt: + Template Name: BENUTZERDEFINIERTE AKTION Argumente: ${REPO} - Repository Pfad; ${SHA} - SHA-Wert des selektierten Commits @@ -158,9 +159,9 @@ Beispiel für Gitee Issue Regel einfügen Beispiel für Gitee Pull Request Regel einfügen Beispiel für Github-Regel hinzufügen - Beispiel für Jira-Regel hinzufügen Beispiel für Gitlab Issue Regel einfügen Beispiel für Gitlab Merge Request einfügen + Beispiel für Jira-Regel hinzufügen Neue Regel Ticketnummer Regex-Ausdruck: Name: @@ -220,9 +221,9 @@ Remote: Pfad: Ziel: - Bestätige löschen von Gruppe Alle Nachfolger werden aus der Liste entfernt. Dadurch wird es nur aus der Liste entfernt, nicht von der Festplatte! + Bestätige löschen von Gruppe Bestätige löschen von Repository Lösche Submodul Submodul Pfad: @@ -289,11 +290,11 @@ Unstage {0} Dateien unstagen Änderungen in ausgewählten Zeilen unstagen - "Ihre" verwenden (checkout --theirs) "Meine" verwenden (checkout --ours) + "Ihre" verwenden (checkout --theirs) Datei Historie - INHALT ÄNDERUNGEN + INHALT Git-Flow Development-Branch: Feature: @@ -323,8 +324,8 @@ Eigenes Muster: Verfolgungsmuster zu Git LFS hinzufügen Fetch - LFS Objekte fetchen Führt `git lfs fetch` aus um Git LFS Objekte herunterzuladen. Das aktualisiert nicht die Arbeitskopie. + LFS Objekte fetchen Installiere Git LFS Hooks Sperren anzeigen Keine gesperrten Dateien @@ -336,11 +337,11 @@ Prune Führt `git lfs prune` aus um alte LFS Dateien von lokalem Speicher zu löschen Pull - LFS Objekte pullen Führt `git lfs pull` aus um alle Git LFS Dasteien für aktuellen Ref & Checkout herunterzuladen + LFS Objekte pullen Push - LFS Objekte pushen Pushe große Dateien in der Warteschlange zum Git LFS Endpunkt + LFS Objekte pushen Remote: Verfolge alle '{0}' Dateien Verfolge alle *{0} Dateien @@ -359,8 +360,8 @@ Aktuelles Popup schließen Klone neues Repository Aktuellen Tab schließen - Zum vorherigen Tab wechseln Zum nächsten Tab wechseln + Zum vorherigen Tab wechseln Neuen Tab erstellen Einstellungen öffnen REPOSITORY @@ -371,11 +372,11 @@ Ausgewählte Änderungen verwerfen Fetch, wird direkt ausgeführt Dashboard Modus (Standard) + Commit-Suchmodus Pull, wird direkt ausgeführt Push, wird direkt ausgeführt Erzwinge Neuladen des Repositorys Ausgewählte Änderungen stagen/unstagen - Commit-Suchmodus Wechsle zu 'Änderungen' Wechsle zu 'Verlauf' Wechsle zu 'Stashes' @@ -384,9 +385,9 @@ Suche nächste Übereinstimmung Suche vorherige Übereinstimmung Öffne Suchpanel + Verwerfen Stagen Unstagen - Verwerfen Initialisiere Repository Pfad: Cherry-Pick wird durchgeführt. @@ -398,10 +399,10 @@ Revert wird durchgeführt. Reverte commit Interaktiver Rebase - Ziel Branch: Auf: - In Browser öffnen + Ziel Branch: Link kopieren + In Browser öffnen FEHLER INFO Branch mergen @@ -427,24 +428,24 @@ Kopiere Repository-Pfad Repositories Einfügen - Gerade eben - Vor {0} Minuten + Vor {0} Tagen Vor 1 Stunde Vor {0} Stunden - Gestern - Vor {0} Tagen + Gerade eben Letzter Monat - Vor {0} Monaten Leztes Jahr + Vor {0} Minuten + Vor {0} Monaten Vor {0} Jahren + Gestern Einstellungen OPEN AI Analysierung des Diff Befehl API Schlüssel Generiere Nachricht Befehl + Modell Name Server - Modell DARSTELLUNG Standardschriftart Schriftgröße @@ -474,24 +475,24 @@ Benutzer Email Globale Git Benutzer Email Aktivere --prune beim fetchen + Diese App setzt Git (>= 2.23.0) voraus Installationspfad Aktiviere HTTP SSL Verifizierung Benutzername Globaler Git Benutzername Git Version - Diese App setzt Git (>= 2.23.0) voraus GPG SIGNIERUNG Commit-Signierung - Tag-Signierung GPG Format GPG Installationspfad Installationspfad zum GPG Programm + Tag-Signierung Benutzer Signierungsschlüssel GPG Benutzer Signierungsschlüssel EINBINDUNGEN SHELL/TERMINAL - Shell/Terminal Pfad + Shell/Terminal Remote löschen Ziel: Worktrees löschen @@ -657,11 +658,11 @@ Statistiken COMMITS COMMITTER + ÜBERSICHT MONAT WOCHE - COMMITS: AUTOREN: - ÜBERSICHT + COMMITS: SUBMODULE Submodul hinzufügen Relativen Pfad kopieren @@ -676,13 +677,13 @@ Lösche ${0}$... Merge ${0}$ in ${1}$ hinein... Pushe ${0}$... - URL: Submodule aktualisieren Alle Submodule Initialisiere wenn nötig Rekursiv Submodul: Verwende `--remote` Option + URL: Warnung Willkommensseite Erstelle Gruppe @@ -718,6 +719,7 @@ NICHT-VERFOLGTE DATEIEN INKLUDIEREN KEINE BISHERIGEN COMMIT-NACHRICHTEN KEINE COMMIT TEMPLATES + Rechtsklick auf selektierte Dateien und wähle die Konfliktlösungen aus. SignOff GESTAGED UNSTAGEN @@ -727,7 +729,6 @@ ALLES STAGEN ALS UNVERÄNDERT ANGENOMMENE ANZEIGEN Template: ${0}$ - Rechtsklick auf selektierte Dateien und wähle die Konfliktlösungen aus. ARBEITSPLATZ: Arbeitsplätze konfigurieren... WORKTREE diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index d1e32e84..97b2a832 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -486,7 +486,7 @@ User Name Global git user name Git version - Git (>= 2.23.0) is required by this app + Git (>= 2.23.0) is required by this app GPG SIGNING Commit GPG signing Tag GPG signing diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 8b4c350f..e6968560 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -2,19 +2,20 @@ + Acerca de Acerca de SourceGit Cliente Git GUI de código abierto y gratuito Agregar Worktree - Qué Checkout: - Rama Existente - Crear Nueva Rama Ubicación: Ruta para este worktree. Se admite ruta relativa. Nombre de la Rama: Opcional. Por defecto es el nombre de la carpeta de destino. Rama de Seguimiento: Seguimiento de rama remota + Qué Checkout: + Crear Nueva Rama + Rama Existente Asistente OpenAI RE-GENERAR Usar OpenAI para generar mensaje de commit @@ -64,8 +65,8 @@ ¡Upstream inválido! Bytes CANCELAR - Resetear a Esta Revisión Resetear a Revisión Padre + Resetear a Esta Revisión Generar mensaje de commit CAMBIAR MODO DE VISUALIZACIÓN Mostrar como Lista de Archivos y Directorios @@ -73,12 +74,12 @@ Mostrar como Árbol de Sistema de Archivos Checkout Rama Checkout Commit - Advertencia: Al hacer un checkout de commit, tu Head se separará Commit: - Rama: + Advertencia: Al hacer un checkout de commit, tu Head se separará Cambios Locales: Descartar Stash & Reaplicar + Rama: Cherry Pick Añadir fuente al mensaje de commit Commit(s): @@ -97,9 +98,9 @@ URL del Repositorio: CERRAR Editor + Checkout Commit Cherry-Pick Este Commit Cherry-Pick ... - Checkout Commit Comparar con HEAD Comparar con Worktree Copiar Información @@ -134,12 +135,12 @@ REFS SHA Abrir en Navegador - Introducir asunto del commit Descripción + Introducir asunto del commit Configurar Repositorio PLANTILLA DE COMMIT - Nombre de la Plantilla: Contenido de la Plantilla: + Nombre de la Plantilla: ACCIÓN PERSONALIZADA Argumentos: ${REPO} - Ruta del repositorio; ${SHA} - SHA del commit seleccionado @@ -157,13 +158,13 @@ Minuto(s) Remoto por Defecto SEGUIMIENTO DE INCIDENCIAS + Añadir Regla de Ejemplo para Azure DevOps Añadir Regla de Ejemplo para Incidencias de Gitee Añadir Regla de Ejemplo para Pull Requests de Gitee Añadir Regla de Ejemplo para Github - Añadir Regla de Ejemplo para Jira - Añadir Regla de Ejemplo para Azure DevOps Añadir Regla de Ejemplo para Incidencias de GitLab Añadir Regla de Ejemplo para Merge Requests de GitLab + Añadir Regla de Ejemplo para Jira Nueva Regla Expresión Regex para Incidencias: Nombre de la Regla: @@ -188,8 +189,8 @@ Tipo de Cambio: Copiar Copiar Todo el Texto - Copiar Ruta Copiar Ruta Completa + Copiar Ruta Crear Rama... Basado En: Checkout de la rama creada @@ -225,8 +226,8 @@ Ruta: Destino: Todos los hijos serán removidos de la lista. - Confirmar Eliminación de Grupo ¡Esto solo lo removera de la lista, no del disco! + Confirmar Eliminación de Grupo Confirmar Eliminación de Repositorio Eliminar Submódulo Ruta del Submódulo: @@ -295,11 +296,11 @@ Unstage Unstage {0} archivos Unstage Cambios en Línea(s) Seleccionada(s) - Usar Suyos (checkout --theirs) Usar Míos (checkout --ours) + Usar Suyos (checkout --theirs) Historial de Archivos - CONTENIDO CAMBIO + CONTENIDO Git-Flow Rama de Desarrollo: Feature: @@ -329,8 +330,8 @@ Patrón Personalizado: Añadir Patrón de Seguimiento a Git LFS Fetch - Fetch Objetos LFS Ejecuta `git lfs fetch` para descargar objetos Git LFS. Esto no actualiza la copia de trabajo. + Fetch Objetos LFS Instalar hooks de Git LFS Mostrar Bloqueos No hay archivos bloqueados @@ -342,11 +343,11 @@ Prune Ejecuta `git lfs prune` para eliminar archivos LFS antiguos del almacenamiento local Pull - Pull Objetos LFS Ejecuta `git lfs pull` para descargar todos los archivos Git LFS para la referencia actual y hacer checkout + Pull Objetos LFS Push - Push Objetos LFS Push archivos grandes en cola al endpoint de Git LFS + Push Objetos LFS Remoto: Seguir archivos llamados '{0}' Seguir todos los archivos *{0} @@ -365,8 +366,8 @@ Cancelar popup actual Clonar repositorio nuevo Cerrar página actual - Ir a la página anterior Ir a la siguiente página + Ir a la página anterior Crear nueva página Abrir diálogo de preferencias REPOSITORIO @@ -377,11 +378,11 @@ Descartar cambios seleccionados Fetch, empieza directamente Modo Dashboard (Por Defecto) + Modo de búsqueda de commits Pull, empieza directamente Push, empieza directamente Forzar a recargar este repositorio Stage/Unstage cambios seleccionados - Modo de búsqueda de commits Cambiar a 'Cambios' Cambiar a 'Historias' Cambiar a 'Stashes' @@ -390,9 +391,9 @@ Buscar siguiente coincidencia Buscar coincidencia anterior Abrir panel de búsqueda + Descartar Stage Unstage - Descartar Inicializar Repositorio Ruta: Cherry-Pick en progreso. @@ -404,10 +405,10 @@ Revert en progreso. Haciendo revert del commit Rebase Interactivo - Rama Objetivo: En: - Abrir en el Navegador + Rama Objetivo: Copiar Enlace + Abrir en el Navegador ERROR AVISO Merge Rama @@ -433,16 +434,16 @@ Copiar Ruta del Repositorio Repositorios Pegar - Justo ahora - Hace {0} minutos + Hace {0} días Hace 1 hora Hace {0} horas - Ayer - Hace {0} días + Justo ahora Último mes - Hace {0} meses Último año + Hace {0} minutos + Hace {0} meses Hace {0} años + Ayer Preferencias Opciones Avanzadas OPEN AI @@ -484,24 +485,24 @@ Email de usuario Email global del usuario git Habilitar --prune para fetch + Se requiere Git (>= 2.23.0) para esta aplicación Ruta de instalación Habilitar verificación HTTP SSL Nombre de usuario Nombre global del usuario git Versión de Git - Se requiere Git (>= 2.23.0) para esta aplicación FIRMA GPG Firma GPG en commit - Firma GPG en etiqueta Formato GPG Ruta de instalación del programa Introducir ruta para el programa gpg instalado + Firma GPG en etiqueta Clave de firma del usuario Clave de firma gpg del usuario INTEGRACIÓN SHELL/TERMINAL - Shell/Terminal Ruta + Shell/Terminal Podar Remoto Destino: Podar Worktrees @@ -668,11 +669,11 @@ Estadísticas COMMITS COMMITTER + GENERAL MES SEMANA - COMMITS: AUTORES: - GENERAL + COMMITS: SUBMÓDULOS Añadir Submódulo Copiar Ruta Relativa @@ -687,13 +688,13 @@ Eliminar ${0}$... Merge ${0}$ en ${1}$... Push ${0}$... - URL: Actualizar Submódulos Todos los submódulos Inicializar según sea necesario Recursivamente Submódulo: Usar opción --remote + URL: Advertencia Página de Bienvenida Crear Grupo @@ -729,6 +730,7 @@ INCLUIR ARCHIVOS NO RASTREADOS NO HAY MENSAJES DE ENTRADA RECIENTES NO HAY PLANTILLAS DE COMMIT + Haz clic derecho en el(los) archivo(s) seleccionado(s) y elige tu opción para resolver conflictos. Firmar STAGED UNSTAGE @@ -738,7 +740,6 @@ STAGE TODO VER ASSUME UNCHANGED Plantilla: ${0}$ - Haz clic derecho en el(los) archivo(s) seleccionado(s) y elige tu opción para resolver conflictos. ESPACIO DE TRABAJO: Configura Espacios de Trabajo... WORKTREE diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index bf238aa2..f3cf80eb 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -2,21 +2,22 @@ + À propos À propos de SourceGit Client Git Open Source et Gratuit Ajouter un Worktree - Que récupérer : - 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 + Que récupérer : + Créer une nouvelle branche + Branche existante Assistant IA - RE-GÉNERER + RE-GÉNÉRER Utiliser l'IA pour générer un message de commit APPLIQUER COMME MESSAGE DE COMMIT Appliquer @@ -61,7 +62,7 @@ Renommer ${0}$... Définir la branche de suivi... Comparer les branches - Branche amont invalide ! + Branche en amont invalide! Octets ANNULER Réinitialiser à la révision parente @@ -75,10 +76,10 @@ Récupérer ce commit Commit : Avertissement: une récupération vers un commit aboutiera vers un HEAD détaché - Branche : Changements locaux : Annuler Mettre en stash et réappliquer + Branche : Cherry-Pick de ce commit Ajouter la source au message de commit Commit : @@ -94,13 +95,13 @@ Nom local : Nom de dépôt. Optionnel. Dossier parent : + Initialiser et mettre à jour les sous-modules URL du dépôt : FERMER Éditeur Récupérer ce commit Cherry-Pick ce commit Cherry-Pick ... - Checkout Commit Comparer avec HEAD Comparer avec le worktree Copier les informations @@ -135,20 +136,22 @@ REFS SHA Ouvrir dans le navigateur - Entrez le message du commit Description + Entrez le message du commit Configurer le dépôt MODÈLE DE COMMIT - Nom de modèle: Contenu de modèle: + Nom de modèle: ACTION PERSONNALISÉE Arguments : ${REPO} - Chemin du repository; ${SHA} - SHA du commit sélectionné Fichier exécutable : Nom : Portée : + Branche Commit Repository + Attendre la fin de l'action Adresse e-mail Adresse e-mail GIT @@ -156,13 +159,13 @@ minute(s) Dépôt par défaut SUIVI DES PROBLÈMES + Ajouter une règle d'exemple Azure DevOps Ajouter une règle d'exemple Gitee Ajouter une règle d'exemple pour Pull Request Gitee Ajouter une règle d'exemple Github Ajouter une règle d'exemple pour Incidents GitLab Ajouter une règle d'exemple pour Merge Request GitLab Ajouter une règle d'exemple Jira - Ajouter une règle d'exemple Azure DevOps Nouvelle règle Issue Regex Expression: Nom de règle : @@ -187,8 +190,8 @@ Type de Changement : Copier Copier tout le texte - Copier le chemin Copier le chemin complet + Copier le chemin Créer une branche... Basé sur : Récupérer la branche créée @@ -221,7 +224,10 @@ Vous essayez de supprimer plusieurs branches à la fois. Assurez-vous de revérifier avant de procéder ! Supprimer Remote Remote : + Chemin: Cible : + Tous les enfants seront retirés de la liste. + Cela le supprimera uniquement de la liste, pas du disque ! Confirmer la suppression du groupe Confirmer la suppression du dépôt Supprimer le sous-module @@ -234,7 +240,9 @@ ANCIEN Copier Mode de fichier changé + Première différence Ignorer les changements d'espaces + Dernière différence CHANGEMENT D'OBJET LFS Différence suivante PAS DE CHANGEMENT OU SEULEMENT EN FIN DE LIGNE @@ -247,8 +255,8 @@ Permuter Coloration syntaxique Retour à la ligne - Ouvrir dans l'outil de fusion Activer la navigation par blocs + Ouvrir dans l'outil de fusion Voir toutes les lignes Réduit le nombre de ligne visibles Augmente le nombre de ligne visibles @@ -292,8 +300,8 @@ Utiliser les miennes (checkout --ours) Utiliser les leurs (checkout --theirs) Historique du fichier - CONTENU MODIFICATION + CONTENU Git-Flow Branche de développement : Feature: @@ -323,8 +331,8 @@ Pattern personnalisé : Ajouter un pattern de suivi à Git LFS Fetch - 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. + Fetch les objets LFS Installer les hooks Git LFS Afficher les verrous Pas de fichiers verrouillés @@ -336,11 +344,11 @@ Elaguer Lancer `git lfs prune` pour supprimer les anciens fichier LFS du stockage local Pull - Pull les objets LFS Lancer `git lfs pull` pour télécharger tous les fichier Git LFS de la référence actuelle & récupérer + Pull les objets LFS Pousser - Pousser les objets LFS Transférer les fichiers volumineux en file d'attente vers le point de terminaison Git LFS + Pousser les objets LFS Dépôt : Suivre les fichiers appelés '{0}' Suivre tous les fichiers *{0} @@ -359,8 +367,8 @@ Annuler le popup en cours Cloner un nouveau dépôt Fermer la page en cours - Aller à la page précédente Aller à la page suivante + Aller à la page précédente Créer une nouvelle page Ouvrir le dialogue des préférences DÉPÔT @@ -371,11 +379,11 @@ Rejeter les changements sélectionnés Fetch, démarre directement Mode tableau de bord (Défaut) + Recherche de commit 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 Basculer vers 'Changements' Basculer vers 'Historique' Basculer vers 'Stashes' @@ -384,25 +392,34 @@ Trouver la prochaine correspondance Trouver la correspondance précédente Ouvrir le panneau de recherche + Rejeter Indexer Retirer de l'index - Rejeter Initialiser le repository Chemin : Cherry-Pick en cours. + Traitement du commit Merge request en cours. + Fusionnement Rebase en cours. + Arrêté à Annulation en cours. + Annulation du commit Rebase interactif - Branche cible : Sur : - Ouvrir dans le navigateur + Branche cible : Copier le lien + Ouvrir dans le navigateur ERREUR NOTICE Merger la branche Dans : Option de merge: + Source: + Fusionner (Plusieurs) + Commit tous les changement + Stratégie: + Cibles: Déplacer le noeud du repository Sélectionnier le noeud parent pour : Nom : @@ -418,16 +435,16 @@ Copier le chemin vers le dépôt Dépôts Coller - A l'instant - il y a {0} minutes + il y a {0} jours il y a 1 heure il y a {0} heures - Hier - il y a {0} jours + A l'instant Le mois dernier - il y a {0} mois L'an dernier + il y a {0} minutes + il y a {0} mois il y a {0} ans + Hier Préférences IA Analyser Diff Prompt @@ -436,10 +453,15 @@ Modèle Nom Serveur + Activer le streaming APPARENCE Police par défaut Taille de police par défaut Taille de police de l'éditeur + Largeur de tab dans l'éditeur + Taille de police + Défaut + Éditeur Police monospace N'utiliser que des polices monospace pour l'éditeur de texte Thème @@ -452,9 +474,12 @@ Outil GÉNÉRAL Vérifier les mises à jour au démarrage + Format de date Language Historique de commits Afficher l'heure de l'auteur au lieu de l'heure de validation dans le graphique + Afficher les enfants dans les détails du commit + Afficher les tags dans le graphique des commits Guide de longueur du sujet GIT Activer auto CRLF @@ -462,24 +487,24 @@ E-mail utilsateur E-mail utilsateur global Activer --prune pour fetch + Cette application requière Git (>= 2.23.0) Chemin d'installation + Activer la vérification HTTP SSL Nom d'utilisateur Nom d'utilisateur global Version de Git - Cette application requière Git (>= 2.23.0) SIGNATURE GPG Signature GPG de commit - Signature GPG de tag Format GPG Chemin d'installation du programme Saisir le chemin d'installation vers le programme GPG + Signature GPG de tag Clé de signature de l'utilisateur Clé de signature GPG de l'utilisateur INTEGRATION SHELL/TERMINAL - Shell/Terminal Chemin - Élaguer une branche distant + Shell/Terminal Cible : Élaguer les Worktrees Élaguer les information de worktree dans `$GIT_COMMON_DIR/worktrees` @@ -539,14 +564,26 @@ Tout effacer Configurer ce repository CONTINUER + Actions personnalisées Pas d'actions personnalisées Activer l'option '--reflog' Ouvrir dans l'explorateur de fichiers Rechercher Branches/Tags/Submodules + Visibilité dans le graphique + Réinitialiser + Cacher dans le graphique des commits + Filtrer dans le graphique des commits Activer l'option '--first-parent' + DISPOSITION + Horizontal + Vertical + ORDRE DES COMMITS + Date du commit + Topologiquement BRANCHES LOCALES Naviguer vers le HEAD Créer une branche + EFFACER LES NOTIFICATIONS Mettre la branche courante en surbrillance dans le graph Ouvrir dans {0} Ouvrir dans un outil externe @@ -561,13 +598,19 @@ SHA Branche actuelle Voir les Tags en tant qu'arbre + PASSER Statistiques SUBMODULES AJOUTER SUBMODULE METTRE A JOUR SUBMODULE TAGS NOUVEAU TAG + Par date de créateur + Par nom (Croissant) + Par nom (Décroissant) + Trier Ouvrir dans un terminal + Utiliser le temps relatif dans les historiques WORKTREES AJOUTER WORKTREE ELAGUER @@ -586,6 +629,7 @@ SAUVEGARDER Sauvegarder en tant que... Le patch a été sauvegardé ! + Analyser les repositories Dossier racine : Rechercher des mises à jour... Une nouvelle version du logiciel est disponible : @@ -594,10 +638,10 @@ Passer cette version Mise à jour du logiciel Il n'y a pas de mise à jour pour le moment. - Définir la branche de suivi - Branche : - Escamoter la branche amont - Branche amont: + Définir la branche suivie + Branche: + Retirer la branche amont + En amont: Copier le SHA Aller à Squash les commits @@ -607,7 +651,7 @@ START Stash Auto-restauration après le stash - Vos fichiers de travail sont inchangés, mais un stash a été sauvegardé. + Vos fichiers de travail restent inchangés, mais une sauvegarde est enregistrée. Inclure les fichiers non-suivis Garder les fichiers indexés Message : @@ -626,11 +670,11 @@ Statistiques COMMITS COMMITTER + APERCU MOIS SEMAINE - COMMITS: AUTEURS : - APERCU + COMMITS: SOUS-MODULES Ajouter un sous-module Copier le chemin relatif @@ -645,13 +689,13 @@ Supprimer ${0}$... Fusionner ${0}$ dans ${1}$... Pousser ${0}$... - URL : Actualiser les sous-modules Tous les sous-modules Initialiser au besoin Récursivement Sous-module : Utiliser l'option --remote + URL : Avertissement Page d'accueil Créer un groupe @@ -679,6 +723,7 @@ COMMIT & POUSSER Modèles/Historiques Trigger click event + Commit (Modifier) Indexer tous les changements et commit Un commit vide a été détecté ! Voulez-vous continuer (--allow-empty) ? CONFLITS DÉTECTÉS @@ -686,6 +731,8 @@ INCLURE LES FICHIERS NON-SUIVIS PAS DE MESSAGE D'ENTRÉE RÉCENT PAS DE MODÈLES DE COMMIT + Faites un clique droit sur les fichiers sélectionnés et faites vos choix pour la résoluion des conflits. + SignOff INDEXÉ RETIRER DE L'INDEX RETIRER TOUT DE L'INDEX @@ -694,7 +741,6 @@ INDEXER TOUT 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 @@ -702,68 +748,4 @@ Verrouiller Supprimer Déverrouiller - RE-GÉNÉRER - APPLIQUER COMME MESSAGE DE COMMIT - Appliquer le Stash - Supprimer après l'application - Rétablir les modifications de l'index - Stash: - Action personnalisée - Branche en amont invalide! - Initialiser et mettre à jour les sous-modules - Branche - Attendre la fin de l'action - Les espaces seront remplacés par des tirets. - Chemin: - Tous les enfants seront retirés de la liste. - Cela le supprimera uniquement de la liste, pas du disque ! - Première différence - Dernière différence - Traitement du commit - Fusionnement - Arrêté à - Annulation du commit - Source: - Fusionner (Plusieurs) - Commit tous les changement - Stratégie: - Cibles: - Activer le streaming - Largeur de tab dans l'éditeur - Taille de police - Défaut - Éditeur - Format de date - Afficher les enfants dans les détails du commit - Afficher les tags dans le graphique des commits - Activer la vérification HTTP SSL - Actions personnalisées - Visibilité dans le graphique - Réinitialiser - Cacher dans le graphique des commits - Filtrer dans le graphique des commits - DISPOSITION - Horizontal - Vertical - ORDRE DES COMMITS - Date du commit - Topologiquement - EFFACER LES NOTIFICATIONS - PASSER - Par date de créateur - Par nom (Croissant) - Par nom (Décroissant) - Trier - Utiliser le temps relatif dans les historiques - Analyser les repositories - Définir la branche suivie - Branche: - Retirer la branche amont - En amont: - Aller sur - Restauration automatique après le stashing - Vos fichiers de travail restent inchangés, mais une sauvegarde est enregistrée. - Sauvegarder en tant que patch... - Commit (Modifier) - SignOff diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index 85038d9e..95647101 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -2,19 +2,20 @@ + Informazioni Informazioni su SourceGit Client GUI Git open source e gratuito Aggiungi Worktree - Di 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 + Di cosa fare il checkout: + Crea nuovo branch + Branch esistente Assistente AI RIGENERA Usa AI per generare il messaggio di commit @@ -64,8 +65,8 @@ Upstream non valido Byte ANNULLA - Ripristina Questa Revisione Ripristina la Revisione Padre + Ripristina Questa Revisione Genera messaggio di commit CAMBIA MODALITÀ DI VISUALIZZAZIONE Mostra come elenco di file e cartelle @@ -73,12 +74,12 @@ Mostra come albero del filesystem Checkout Branch Checkout Commit - Avviso: Effettuando un checkout del commit, la tua HEAD sarà separata Commit: - Branch: + Avviso: Effettuando un checkout del commit, la tua HEAD sarà separata Modifiche Locali: Scarta Stasha e Ripristina + Branch: Cherry Pick Aggiungi sorgente al messaggio di commit Commit(s): @@ -97,9 +98,9 @@ URL del Repository: CHIUDI Editor + Checkout Commit Cherry-Pick Questo Commit Cherry-Pick... - Checkout Commit Confronta con HEAD Confronta con Worktree Copia Info @@ -134,12 +135,12 @@ RIFERIMENTI SHA Apri nel Browser - Inserisci l'oggetto del commit Descrizione + Inserisci l'oggetto del commit Configura Repository TEMPLATE DI COMMIT - Nome Template: Contenuto Template: + Nome Template: AZIONE PERSONALIZZATA Argomenti: ${REPO} - Percorso del repository; ${SHA} - SHA del commit selezionato @@ -157,13 +158,13 @@ Minuto/i Remoto Predefinito TRACCIAMENTO ISSUE + Aggiungi una regola di esempio per Azure DevOps Aggiungi una regola di esempio per un Issue Gitee Aggiungi una regola di esempio per un Pull Request Gitee Aggiungi una regola di esempio per GitHub - Aggiungi una regola di esempio per Jira - Aggiungi una regola di esempio per Azure DevOps Aggiungi una regola di esempio per Issue GitLab Aggiungi una regola di esempio per una Merge Request GitLab + Aggiungi una regola di esempio per Jira Nuova Regola Espressione Regex Issue: Nome Regola: @@ -244,7 +245,6 @@ Differenza Successiva NESSUNA MODIFICA O SOLO CAMBIAMENTI DI FINE LINEA Differenza Precedente - Abilita la navigazione a blocchi Salva come Patch Mostra Simboli Nascosti Diff Affiancato @@ -253,6 +253,7 @@ Scambia Evidenziazione Sintassi Avvolgimento delle Parole + Abilita la navigazione a blocchi Apri nello Strumento di Merge Mostra Tutte le Righe Diminuisci Numero di Righe Visibili @@ -294,11 +295,11 @@ Rimuovi da Stage Rimuovi da Stage {0} file Rimuovi le Righe Selezionate da Stage - Usa Il Loro (checkout --theirs) Usa Il Mio (checkout --ours) + Usa Il Loro (checkout --theirs) Cronologia File - CONTENUTO MODIFICA + CONTENUTO FILTRO Git-Flow Branch di Sviluppo: @@ -329,8 +330,8 @@ 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. + Recupera Oggetti LFS Installa hook di Git LFS Mostra Blocchi Nessun File Bloccato @@ -342,11 +343,11 @@ Elimina Esegui `git lfs prune` per eliminare vecchi file LFS dallo storage locale Scarica - Scarica Oggetti LFS Esegui `git lfs pull` per scaricare tutti i file LFS per il ref corrente e fare il checkout + Scarica Oggetti LFS Invia - Invia Oggetti LFS Invia grandi file in coda al punto finale di Git LFS + Invia Oggetti LFS Remoto: Traccia file con nome '{0}' Traccia tutti i file *{0} @@ -365,8 +366,8 @@ Annulla il popup corrente Clona una nuova repository Chiudi la pagina corrente - Vai alla pagina precedente Vai alla pagina successiva + Vai alla pagina precedente Crea una nuova pagina Apri la finestra delle preferenze REPOSITORY @@ -377,11 +378,11 @@ Scarta le modifiche selezionate Recupera, avvia direttamente Modalità Dashboard (Predefinita) + Modalità ricerca commit Scarica, avvia direttamente Invia, avvia direttamente Forza l'aggiornamento di questo repository Aggiungi/Rimuovi da stage le modifiche selezionate - Modalità ricerca commit Passa a 'Modifiche' Passa a 'Storico' Passa a 'Stashes' @@ -390,9 +391,9 @@ Trova il prossimo risultato Trova il risultato precedente Apri il pannello di ricerca + Scarta Aggiungi in stage Rimuovi - Scarta Inizializza Repository Percorso: Cherry-Pick in corso. @@ -404,10 +405,10 @@ Ripristino in corso. Ripristinando il commit Riallinea Interattivamente - Branch di destinazione: Su: - Apri nel Browser + Branch di destinazione: Copia il Link + Apri nel Browser ERRORE AVVISO Unisci Branch @@ -433,16 +434,16 @@ Copia Percorso Repository Repository Incolla - Proprio ora - {0} minuti fa + {0} giorni fa 1 ora fa {0} ore fa - Ieri - {0} giorni fa + Proprio ora Il mese scorso - {0} mesi fa L'anno scorso + {0} minuti fa + {0} mesi fa {0} anni fa + Ieri Preferenze AI Analizza il Prompt Differenza @@ -482,24 +483,24 @@ Email Utente Email utente Git globale Abilita --prune durante il fetch + Questa applicazione richiede Git (>= 2.23.0) Percorso Installazione + Abilita la verifica HTTP SSL Nome Utente Nome utente Git globale Versione di Git - Questa applicazione richiede Git (>= 2.23.0) - Abilita la verifica HTTP SSL FIRMA GPG Firma GPG per commit - Firma GPG per tag Formato GPG Percorso Programma Installato Inserisci il percorso per il programma GPG installato + Firma GPG per tag Chiave Firma Utente Chiave GPG dell'utente per la firma INTEGRAZIONE SHELL/TERMINALE - Shell/Terminale Percorso + Shell/Terminale Potatura Remota Destinazione: Potatura Worktrees @@ -667,11 +668,11 @@ Statistiche COMMIT COMMITTER + PANORAMICA MESE SETTIMANA - COMMIT: AUTORI: - PANORAMICA + COMMIT: SOTTOMODULI Aggiungi Sottomodulo Copia Percorso Relativo @@ -686,13 +687,13 @@ Elimina ${0}$... Unisci ${0}$ in ${1}$... Invia ${0}$... - URL: Aggiorna Sottomoduli Tutti i sottomoduli Inizializza se necessario Ricorsivamente Sottomodulo: Usa opzione --remote + URL: Avviso Pagina di Benvenuto Crea Gruppo @@ -728,6 +729,8 @@ INCLUDI FILE NON TRACCIATI NESSUN MESSAGGIO RECENTE INSERITO NESSUN TEMPLATE DI COMMIT + Clicca con il tasto destro sul(i) file selezionato, quindi scegli come risolvere i conflitti. + SignOff IN STAGE RIMUOVI DA STAGE RIMUOVI TUTTO DA STAGE @@ -736,8 +739,6 @@ FAI LO STAGE DI TUTTO VISUALIZZA COME NON MODIFICATO Template: ${0}$ - Clicca con il tasto destro sul(i) file selezionato, quindi scegli come risolvere i conflitti. - SignOff WORKSPACE: Configura Workspaces... WORKTREE diff --git a/src/Resources/Locales/ja_JP.axaml b/src/Resources/Locales/ja_JP.axaml index 21255221..91cefbac 100644 --- a/src/Resources/Locales/ja_JP.axaml +++ b/src/Resources/Locales/ja_JP.axaml @@ -2,19 +2,20 @@ + 概要 SourceGitについて オープンソース & フリーなGit GUIクライアント ワークツリーを追加 - チェックアウトする内容: - 既存のブランチ - 新しいブランチを作成 場所: ワークツリーのパスを入力してください。相対パスも使用することができます。 ブランチの名前: 任意。デフォルトでは宛先フォルダ名が使用されます。 追跡するブランチ: 追跡中のリモートブランチ + チェックアウトする内容: + 新しいブランチを作成 + 既存のブランチ OpenAI アシスタント 再生成 OpenAIを使用してコミットメッセージを生成 @@ -64,8 +65,8 @@ 無効な上流ブランチ! バイト キャンセル - このリビジョンにリセット 親リビジョンにリセット + このリビジョンにリセット コミットメッセージを生成 変更表示の切り替え ファイルとディレクトリのリストを表示 @@ -73,12 +74,12 @@ ファイルシステムのツリーを表示 ブランチをチェックアウト コミットをチェックアウト - 警告: コミットをチェックアウトするとHEADが切断されます コミット: - ブランチ: + 警告: コミットをチェックアウトするとHEADが切断されます ローカルの変更: 破棄 スタッシュして再適用 + ブランチ: チェリーピック ソースをコミットメッセージに追加 コミット(複数可): @@ -97,9 +98,9 @@ リポジトリのURL: 閉じる エディタ + コミットをチェックアウト このコミットをチェリーピック チェリーピック... - コミットをチェックアウト HEADと比較 ワークツリーと比較 情報をコピー @@ -134,12 +135,12 @@ 参照 SHA ブラウザで開く - コミットのタイトルを入力 説明 + コミットのタイトルを入力 リポジトリの設定 コミットテンプレート - テンプレート名: テンプレート内容: + テンプレート名: カスタムアクション 引数: ${REPO} - リポジトリのパス; ${BRANCH} - 選択中のブランチ; ${SHA} - 選択中のコミットのSHA @@ -157,13 +158,13 @@ 分(s) リモートの初期値 ISSUEトラッカー + サンプルのAzure DevOpsルールを追加 サンプルのGitee Issueルールを追加 サンプルのGiteeプルリクエストルールを追加 サンプルのGithubルールを追加 サンプルのGitLab Issueルールを追加 サンプルのGitLabマージリクエストルールを追加 サンプルのJiraルールを追加 - サンプルのAzure DevOpsルールを追加 新しいルール Issueの正規表現: ルール名: @@ -188,8 +189,8 @@ 変更の種類: コピー すべてのテキストをコピー - パスをコピー 絶対パスをコピー + パスをコピー ブランチを作成... 派生元: 作成したブランチにチェックアウト @@ -225,8 +226,8 @@ パス: 対象: すべての子ノードがリストから削除されます。 - グループを削除 これはリストからのみ削除され、ディスクには保存されません! + グループを削除 リポジトリを削除 サブモジュールを削除 サブモジュールのパス: @@ -295,11 +296,11 @@ アンステージ {0}個のファイルをアンステージ... 選択された行の変更をアンステージ - 相手の変更を使用 (checkout --theirs) 自分の変更を使用 (checkout --ours) + 相手の変更を使用 (checkout --theirs) ファイルの履歴 - コンテンツ 変更 + コンテンツ Git-Flow 開発ブランチ: Feature: @@ -329,8 +330,8 @@ カスタム パターン: Git LFSにトラックパターンを追加 フェッチ - LFSオブジェクトをフェッチ `git lfs fetch`を実行して、Git LFSオブジェクトをダウンロードします。ワーキングコピーは更新されません。 + LFSオブジェクトをフェッチ Git LFSフックをインストール ロックを表示 ロックされているファイルはありません @@ -342,11 +343,11 @@ 削除 `git lfs prune`を実行して、ローカルの保存領域から古いLFSファイルを削除します。 プル - LFSオブジェクトをプル `git lfs pull`を実行して、現在の参照とチェックアウトのすべてのGit LFSファイルをダウンロードします。 + LFSオブジェクトをプル プッシュ - LFSオブジェクトをプッシュ キュー内の大容量ファイルをGit LFSエンドポイントにプッシュします。 + LFSオブジェクトをプッシュ リモート: {0}という名前のファイルをトラック すべての*{0}ファイルをトラック @@ -365,8 +366,8 @@ 現在のポップアップをキャンセル 新しくリポジトリをクローン 現在のページを閉じる - 前のページに移動 次のページに移動 + 前のページに移動 新しいページを作成 設定ダイアログを開く リポジトリ @@ -377,11 +378,11 @@ 選択した変更を破棄 直接フェッチを実行 ダッシュボードモード (初期値) + コミット検索モード 直接プルを実行 直接プッシュを実行 現在のリポジトリを強制的に再読み込み 選択中の変更をステージ/アンステージ - コミット検索モード '変更'に切り替える '履歴'に切り替える 'スタッシュ'に切り替える @@ -390,9 +391,9 @@ 次のマッチを検索 前のマッチを検索 検索パネルを開く + 破棄 ステージ アンステージ - 破棄 リポジトリの初期化 パス: チェリーピックが進行中です。'中止'を押すと元のHEADが復元されます。 @@ -404,10 +405,10 @@ 元に戻す処理が進行中です。'中止'を押すと元のHEADが復元されます。 コミットを元に戻しています インタラクティブ リベース - 対象のブランチ: On: - ブラウザで開く + 対象のブランチ: リンクをコピー + ブラウザで開く エラー 通知 ブランチのマージ @@ -433,16 +434,16 @@ リポジトリパスをコピー リポジトリ 貼り付け - たった今 - {0} 分前 + {0} 日前 1 時間前 {0} 時間前 - 昨日 - {0} 日前 + たった今 先月 - {0} ヶ月前 昨年 + {0} 分前 + {0} ヶ月前 {0} 年前 + 昨日 設定 AI 差分分析プロンプト @@ -483,24 +484,24 @@ ユーザー Eメールアドレス グローバルgitのEメールアドレス フェッチ時に--pruneを有効化 + Git (>= 2.23.0) はこのアプリで必要です インストール パス HTTP SSL 検証を有効にする ユーザー名 グローバルのgitユーザー名 Gitバージョン - Git (>= 2.23.0) はこのアプリで必要です GPG 署名 コミットにGPG署名を行う - タグにGPG署名を行う GPGフォーマット プログラムのインストールパス インストールされたgpgプログラムのパスを入力 + タグにGPG署名を行う ユーザー署名キー ユーザーのGPG署名キー 統合 シェル/ターミナル - シェル/ターミナル パス + シェル/ターミナル リモートを削除 対象: 作業ツリーを削除 @@ -666,11 +667,11 @@ 統計 コミット コミッター + 概要 月間 週間 - コミット: 著者: - 概要 + コミット: サブモジュール サブモジュールを追加 相対パスをコピー @@ -685,13 +686,13 @@ ${0}$ を削除... ${0}$ を ${1}$ にマージ... ${0}$ をプッシュ... - URL: サブモジュールを更新 すべてのサブモジュール 必要に応じて初期化 再帰的に更新 サブモジュール: --remoteオプションを使用 + URL: 警告 ようこそ グループを作成 @@ -727,6 +728,7 @@ 追跡されていないファイルを含める 最近の入力メッセージはありません コミットテンプレートはありません + 選択したファイルを右クリックし、競合を解決する操作を選択してください。 サインオフ ステージしたファイル ステージを取り消し @@ -736,7 +738,6 @@ すべてステージへ移動 変更されていないとみなしたものを表示 テンプレート: ${0}$ - 選択したファイルを右クリックし、競合を解決する操作を選択してください。 ワークスペース: ワークスペースを設定... ワークツリー diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index 4ee6cdbc..09b78c31 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -3,43 +3,19 @@ - - Sobre Sobre o SourceGit Cliente Git GUI Livre e de Código Aberto 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 + O que Checar: + Criar Novo Branch + Branch Existente Assietente IA Utilizar IA para gerar mensagem de commit Patch @@ -80,8 +56,8 @@ Comparação de Branches Bytes CANCELAR - Resetar para Esta Revisão Resetar para Revisão Pai + Resetar para Esta Revisão Gerar mensagem de commit ALTERAR MODO DE EXIBIÇÃO Exibir como Lista de Arquivos e Diretórios @@ -89,12 +65,12 @@ Exibir como Árvore de Sistema de Arquivos Checkout Branch Checkout Commit - Aviso: Ao fazer o checkout de um commit, seu Head ficará desanexado Commit: - Branch: + Aviso: Ao fazer o checkout de um commit, seu Head ficará desanexado Alterações Locais: Descartar Stash & Reaplicar + Branch: Cherry-Pick Adicionar origem à mensagem de commit Commit(s): @@ -112,9 +88,9 @@ URL do Repositório: FECHAR Editor + Checar Commit Cherry-Pick este commit Cherry-Pick ... - Checar Commit Comparar com HEAD Comparar com Worktree Copiar Informações @@ -145,12 +121,12 @@ REFERÊNCIAS SHA Abrir no navegador - Insira o assunto do commit Descrição + Insira o assunto do commit Configurar Repositório TEMPLATE DE COMMIT - Nome do Template: Conteúdo do Template: + Nome do Template: AÇÃO CUSTOMIZADA Argumentos: ${REPO} - Caminho do repositório; ${SHA} - SHA do commit selecionado @@ -166,11 +142,11 @@ Minuto(s) Remoto padrão RASTREADOR DE PROBLEMAS - Adicionar Regra de Exemplo do Github - Adicionar Regra de Exemplo do Jira Adicionar Regra de Exemplo do Azure DevOps + Adicionar Regra de Exemplo do Github Adicionar Regra de Exemplo do GitLab Adicionar regra de exemplo de Merge Request do GitLab + Adicionar Regra de Exemplo do Jira Nova Regra Expressão Regex de Issue: Nome da Regra: @@ -292,11 +268,11 @@ Desfazer Preparação Desfazer Preparação de {0} arquivos Desfazer Preparação nas Linhas Selecionadas - Usar Deles (checkout --theirs) Usar Meu (checkout --ours) + Usar Deles (checkout --theirs) Histórico de Arquivos - CONTEUDO MUDANÇA + CONTEUDO Git-Flow Branch de Desenvolvimento: Feature: @@ -326,8 +302,8 @@ Padrão Personalizado: Adicionar Padrão de Rastreamento ao Git LFS Buscar - Buscar Objetos LFS Execute `git lfs fetch` para baixar objetos Git LFS. Isso não atualiza a cópia de trabalho. + Buscar Objetos LFS Instalar hooks do Git LFS Exibir bloqueios Sem Arquivos Bloqueados @@ -339,11 +315,11 @@ Prune Execute `git lfs prune` para excluir arquivos LFS antigos do armazenamento local Puxar - Puxar Objetos LFS Execute `git lfs pull` para baixar todos os arquivos Git LFS para a referência atual e checkout + Puxar Objetos LFS Enviar - Enviar Objetos LFS Envie arquivos grandes enfileirados para o endpoint Git LFS + Enviar Objetos LFS Remoto: Rastrear arquivos nomeados '{0}' Rastrear todos os arquivos *{0} @@ -361,8 +337,8 @@ GLOBAL Cancelar popup atual Fechar página atual - Ir para a página anterior Ir para a próxima página + Ir para a página anterior Criar nova página Abrir diálogo de preferências REPOSITÓRIO @@ -373,11 +349,11 @@ 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' @@ -386,9 +362,9 @@ Encontrar próxima correspondência Encontrar correspondência anterior Abrir painel de busca + Descartar Preparar Despreparar - Descartar Inicializar Repositório Caminho: Cherry-Pick em andamento. @@ -396,10 +372,10 @@ Rebase em andamento. Revert em andamento. Rebase Interativo - Ramo Alvo: Em: - Abrir no navegador + Ramo Alvo: Copiar link + Abrir no navegador ERRO AVISO Mesclar Ramo @@ -420,16 +396,16 @@ Copiar Caminho do Repositório Repositórios Colar - Agora mesmo - {0} minutos atrás + {0} dias atrás 1 hora atrás {0} horas atrás - Ontem - {0} dias atrás + Agora mesmo Mês passado - {0} meses atrás Ano passado + {0} minutos atrás + {0} meses atrás {0} anos atrás + Ontem Preferências INTELIGÊNCIA ARTIFICIAL Prompt para Analisar Diff @@ -465,23 +441,23 @@ Email do Usuário Email global do usuário git Habilita --prune ao buscar + Git (>= 2.23.0) é necessário para este aplicativo Caminho de Instalação Nome do Usuário Nome global do usuário git Versão do Git - 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 + Assinatura GPG de tag Chave de Assinatura do Usuário Chave de assinatura gpg do usuário INTEGRAÇÃO SHELL/TERMINAL - Shell/Terminal Caminho + Shell/Terminal Prunar Remoto Alvo: Podar Worktrees @@ -627,11 +603,11 @@ Estatísticas COMMITS COMMITTER + VISÃO GERAL MÊS SEMANA - COMMITS: AUTORES: - VISÃO GERAL + COMMITS: SUBMÓDULOS Adicionar Submódulo Copiar Caminho Relativo @@ -646,13 +622,13 @@ 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 + URL: Aviso Página de Boas-vindas Criar Grupo Raíz @@ -687,6 +663,7 @@ 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 @@ -695,7 +672,6 @@ STAGE TODOS VER SUPOR NÃO ALTERADO Template: ${0}$ - Clique com o botão direito nos arquivos selecionados e escolha como resolver conflitos. Workspaces: Configurar workspaces... WORKTREE diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 2ea274d1..7da65b5e 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -2,19 +2,20 @@ + О программе О SourceGit Бесплатный графический клиент Git с исходным кодом Добавить рабочий каталог - Переключиться на: - ветку из списка - создать новую ветку Расположение: Путь к рабочему каталогу (поддерживается относительный путь) Имя ветки: Имя целевого каталога по умолчанию. (необязательно) Отслеживание ветки: Отслеживание внешней ветки + Переключиться на: + создать новую ветку + ветку из списка Помощник OpenAI ПЕРЕСОЗДАТЬ Использовать OpenAI для создания сообщения о ревизии @@ -42,7 +43,6 @@ Расследование РАССЛЕДОВАНИЕ В ЭТОМ ФАЙЛЕ НЕ ПОДДЕРЖИВАЕТСЯ!!! Проверить ${0}$... - Сравнить с ГОЛОВОЙ (HEAD) Сравнить с рабочим каталогом Копировать имя ветки Изменить действие @@ -64,8 +64,8 @@ Недопустимая основная ветка! Байты ОТМЕНА - Сбросить эту ревизию Сбросить родительскую ревизию + Сбросить эту ревизию Произвести сообщение о ревизии ИЗМЕНИТЬ РЕЖИМ ОТОБРАЖЕНИЯ Показывать в виде списка файлов и каталогов @@ -73,12 +73,12 @@ Показывать в виде дерева файловой системы Переключить ветку Переключение ревизии - Предупреждение: После переключения ревизии ваша Голова (HEAD) будет отсоединена Ревизия: - Ветка: + Предупреждение: После переключения ревизии ваша Голова (HEAD) будет отсоединена Локальные изменения: Отклонить Отложить и примненить повторно + Ветка: Частичный выбор Добавить источник для ревизии сообщения Ревизия(и): @@ -97,9 +97,9 @@ Адрес репозитория: ЗАКРЫТЬ Редактор + Переключиться на эту ревизию Применить эту ревизию (cherry-pick) Применить несколько ревизий ... - Переключиться на эту ревизию Сравнить c ГОЛОВОЙ (HEAD) Сравнить с рабочим каталогом Копировать информацию @@ -134,12 +134,12 @@ ССЫЛКИ SHA Открыть в браузере - Введите тему ревизии Описание + Введите тему ревизии Настройка репозитория ШАБЛОН РЕВИЗИИ - Название: Cодержание: + Название: ПОЛЬЗОВАТЕЛЬСКОЕ ДЕЙСТВИЕ Аргументы: ${REPO} - Путь к репозиторию; ${SHA} - SHA ревизий @@ -157,13 +157,13 @@ Минут(а/ы) Внешний репозиторий по умолчанию ОТСЛЕЖИВАНИЕ ПРОБЛЕМ + Добавить пример правила Azure DevOps Добавить пример правила для тем в Gitea Добавить пример правила запроса скачивания из Gitea Добавить пример правила для Git - Добавить пример правила Jira - Добавить пример правила Azure DevOps Добавить пример правила выдачи GitLab Добавить пример правила запроса на слияние в GitLab + Добавить пример правила Jira Новое правило Проблема с регулярным выражением: Имя правила: @@ -177,8 +177,8 @@ Имя пользователя Имя пользователя репозитория Рабочие пространства - Имя Цвет + Имя Восстанавливать вкладки при запуске Общепринятый помощник по ревизии Кардинальные изменения: @@ -189,8 +189,8 @@ Тип изменения: Копировать Копировать весь текст - Копировать путь Копировать полный путь + Копировать путь Создать ветку... Основан на: Проверить созданную ветку @@ -226,8 +226,8 @@ Путь: Цель: Все дочерние элементы будут удалены из списка. - Подтвердите удаление группы Будет удалён из списка. На диске останется. + Подтвердите удаление группы Подтвердите удаление репозитория Удалить подмодуль Путь подмодуля: @@ -242,12 +242,12 @@ Первое различие Игнорировать изменение пробелов Последнее различие - Показывать скрытые символы ИЗМЕНЕНИЕ ОБЪЕКТА LFS Следующее различие НИКАКИХ ИЗМЕНЕНИЙ ИЛИ МЕНЯЕТСЯ ТОЛЬКО EOL Предыдущее различие Сохранить как заплатку + Показывать скрытые символы Различие рядом ПОДМОДУЛЬ НОВЫЙ @@ -296,11 +296,11 @@ Снять подготовленный Неподготовленные {0} файлы Неподготовленные изменения в выбранной(ых) строке(ах) - Использовать их (checkout --theirs) Использовать мой (checkout --ours) + Использовать их (checkout --theirs) История файлов - СОДЕРЖИМОЕ ИЗМЕНИТЬ + СОДЕРЖИМОЕ Git-поток Ветка разработчика: Свойство: @@ -330,8 +330,8 @@ Изменить шаблон: Добавить шаблон отслеживания в LFS Git Извлечь - Извлечь объекты LFS Запустить (git lfs fetch), чтобы загрузить объекты LFS Git. При этом рабочая копия не обновляется. + Извлечь объекты LFS Установить перехват LFS Git Показывать блокировки Нет заблокированных файлов @@ -343,11 +343,11 @@ Обрезать Запустить (git lfs prune), чтобы удалить старые файлы LFS из локального хранилища Забрать - Забрать объекты LFS Запустить (git lfs pull), чтобы загрузить все файлы LFS Git для текущей ссылки и проверить + Забрать объекты LFS Выложить - Выложить объекты LFS Отправляйте большие файлы, помещенные в очередь, в конечную точку LFS Git + Выложить объекты LFS Внешнее хранилище: Отслеживать файлы с именем «{0}» Отслеживать все *{0} файлов @@ -366,8 +366,8 @@ Закрыть окно Клонировать репозиторий Закрыть вкладку - Перейти на предыдущую вкладку Перейти на следующую вкладку + Перейти на предыдущую вкладку Создать новую вкладку Открыть диалоговое окно настроек РЕПОЗИТОРИЙ @@ -378,11 +378,11 @@ Отклонить выбранные изменения Извлечение, запускается сразу Режим доски (по умолчанию) - Принудительно перезагрузить репозиторий + Режим поиска ревизий Забрать, запускается сразу Выложить, запускается сразу + Принудительно перезагрузить репозиторий Подготовленные/Неподготовленные выбранные изменения - Режим поиска ревизий Переключить на «Изменения» Переключить на «Истории» Переключить на «Отложенные» @@ -391,9 +391,9 @@ Найти следующее совпадение Найти предыдущее совпадение Открыть панель поиска + Отклонить Подготовить Снять из подготовленных - Отклонить Создать репозиторий Путь: Выполняется частичный перенос ревизий (cherry-pick). @@ -405,11 +405,10 @@ Выполняется отмена ревизии. Выполняется отмена Интерактивное перемещение - Целевая ветка: На: - Открыть в браузере + Целевая ветка: Копировать ссылку - ОШИБКА + Открыть в браузере УВЕДОМЛЕНИЕ Влить ветку В: @@ -434,20 +433,20 @@ Копировать путь репозитория Репозитории Вставить - Сейчас - {0} минут назад + {0} дней назад 1 час назад {0} часов назад - Вчера - {0} дней назад + Сейчас Последний месяц - {0} месяцев назад В прошлом году + {0} минут назад + {0} месяцев назад {0} лет назад + Вчера Параметры ОТКРЫТЬ ИИ - Ключ API Запрос на анализ различий + Ключ API Произвести запрос на тему Модель Имя: @@ -455,9 +454,9 @@ Разрешить потоковую передачу ВИД Шрифт по умолчанию + Редактировать ширину вкладки Размер шрифта По умолчанию - Редактировать ширину вкладки Редактор Моноширный шрифт В текстовом редакторе используется только моноширный шрифт @@ -484,24 +483,24 @@ Электроная почта пользователя Общая электроная почта пользователя git Разрешить (--prune) при скачивании + Для работы программы требуется версия Git (>= 2.23.0) Путь установки Разрешить верификацию HTTP SSL Имя пользователя Общее имя пользователя git Версия Git - Для работы программы требуется версия Git (>= 2.23.0) GPG ПОДПИСЬ GPG подпись ревизии - GPG подпись метки Формат GPG Путь установки программы Введите путь для установленной программы GPG + GPG подпись метки Ключ подписи пользователя Ключ GPG подписи пользователя ВНЕДРЕНИЕ ОБОЛОЧКА/ТЕРМИНАЛ - Оболочка/Терминал Путь + Оболочка/Терминал Удалить внешний репозиторий Цель: Удалить рабочий каталог @@ -630,8 +629,6 @@ Заплатка успешно сохранена! Сканирование репозиторий Корневой каталог: - Копировать SHA - Перейти Проверка для обновления... Доступна новая версия программного обеспечения: Не удалось проверить наличие обновлений! @@ -643,12 +640,12 @@ Ветка: Снять основную ветку Основная ветка: + Копировать SHA + Перейти Втиснуть ревизии В: Приватный ключ SSH: Путь хранения приватного ключа SSH - Только подготовленные изменения - Подготовленные так и неподготовленные изменения выбранных файлов будут сохранены!!! ЗАПУСК Отложить Автоматически восстанавливать после откладывания @@ -657,6 +654,8 @@ Хранить отложенные файлы Сообщение: Имя тайника (необязательно) + Только подготовленные изменения + Подготовленные так и неподготовленные изменения выбранных файлов будут сохранены!!! Отложить локальные изменения Принять Отбросить @@ -669,11 +668,11 @@ Статистика РЕВИЗИИ РЕВИЗОРЫ (ИСПОЛНИТЕЛИ) + ОБЗОР МЕСЯЦ НЕДЕЛЯ - РЕВИЗИИ: АВТОРЫ: - ОБЗОР + РЕВИЗИИ: ПОДМОДУЛИ Добавить подмодули Копировать относительный путь @@ -688,13 +687,13 @@ Удалить ${0}$... Влить ${0}$ в ${1}$... Выложить ${0}$... - Сетевой адрес: Обновление подмодулей Все подмодули Создавать по необходимости Рекурсивно Подмодуль: Использовать опцию (--remote) + Сетевой адрес: Предупреждение Приветствие Создать группу @@ -707,7 +706,6 @@ Открыть все репозитории Открыть репозиторий Открыть терминал - Повторное сканирование репозиториев в каталоге клонирования по умолчанию Поиск репозиториев... Сортировка Изменения @@ -730,6 +728,7 @@ ВКЛЮЧИТЬ НЕОТСЛЕЖИВАЕМЫЕ ФАЙЛЫ НЕТ ПОСЛЕДНИХ ВХОДНЫХ СООБЩЕНИЙ НЕТ ШАБЛОНОВ РЕВИЗИИ + Щёлкните правой кнопкой мыши выбранный файл(ы) и разрешите конфликты. Завершение работы ПОДГОТОВЛЕННЫЕ СНЯТЬ ПОДГОТОВЛЕННЫЙ @@ -739,7 +738,6 @@ ВСЕ ПОДГОТОВИТЬ ОТКРЫТЬ СПИСОК НЕОТСЛЕЖИВАЕМЫХ ФАЙЛОВ Шаблон: ${0}$ - Щёлкните правой кнопкой мыши выбранный файл(ы) и разрешите конфликты. РАБОЧЕЕ ПРОСТРАНСТВО: Настройка рабочего пространства... РАБОЧИЙ КАТАЛОГ diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 932f1237..281d6a4d 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -2,19 +2,20 @@ + 关于软件 关于本软件 开源免费的Git客户端 新增工作树 - 检出分支方式 : - 已有分支 - 创建新分支 工作树路径 : 填写该工作树的路径。支持相对路径。 分支名 : 选填。默认使用目标文件夹名称。 跟踪分支 设置上游跟踪分支 + 检出分支方式 : + 创建新分支 + 已有分支 AI助手 重新生成 使用AI助手生成提交信息 @@ -64,8 +65,8 @@ 跟踪的上游分支不存在或已删除! 字节 取 消 - 重置文件到该版本 重置文件到上一版本 + 重置文件到该版本 生成提交信息 切换变更显示模式 文件名+路径列表模式 @@ -73,12 +74,12 @@ 文件目录树形结构模式 检出(checkout)分支 检出(checkout)提交 - 注意:执行该操作后,当前HEAD会变为游离(detached)状态! 提交 : - 目标分支 : + 注意:执行该操作后,当前HEAD会变为游离(detached)状态! 未提交更改 : 丢弃更改 贮藏并自动恢复 + 目标分支 : 挑选提交 提交信息中追加来源信息 提交列表 : @@ -97,9 +98,9 @@ 远程仓库 : 关闭 提交信息编辑器 + 检出此提交 挑选(cherry-pick)此提交 挑选(cherry-pick)... - 检出此提交 与当前HEAD比较 与本地工作树比较 复制简要信息 @@ -134,12 +135,12 @@ 相关引用 提交指纹 浏览器中查看 - 填写提交信息主题 详细描述 + 填写提交信息主题 仓库配置 提交信息模板 - 模板名 : 模板内容 : + 模板名 : 自定义操作 命令行参数 : 请使用${REPO}代替仓库路径,${BRANCH}代替选中的分支,${SHA}代替提交哈希 @@ -189,8 +190,8 @@ 类型: 复制 复制全部文本 - 复制路径 复制完整路径 + 复制路径 新建分支 ... 新分支基于 : 完成后切换到新分支 @@ -226,8 +227,8 @@ 路径 : 目标 : 所有子节点将被同时从列表中移除。 - 删除分组确认 仅从列表中移除,不会删除硬盘中的文件! + 删除分组确认 删除仓库确认 删除子模块确认 子模块路径 : @@ -296,11 +297,11 @@ 从暂存中移除 从暂存中移除 {0} 个文件 从暂存中移除选中的更改 - 使用 THEIRS (checkout --theirs) 使用 MINE (checkout --ours) + 使用 THEIRS (checkout --theirs) 文件历史 - 文件内容 文件变更 + 文件内容 GIT工作流 开发分支 : 特性分支 : @@ -330,8 +331,8 @@ 规则 : 添加LFS追踪文件规则 拉取LFS对象 (fetch) - 拉取LFS对象 执行`git lfs prune`命令,下载远程LFS对象,但不会更新工作副本。 + 拉取LFS对象 启用Git LFS支持 显示LFS对象锁 没有锁定的LFS文件 @@ -343,11 +344,11 @@ 精简本地LFS对象存储 运行`git lfs prune`命令,从本地存储中精简当前版本不需要的LFS对象 拉回LFS对象 (pull) - 拉回LFS对象 运行`git lfs pull`命令,下载远程LFS对象并更新工作副本。 + 拉回LFS对象 推送 - 推送LFS对象 将排队的大文件推送到Git LFS远程服务 + 推送LFS对象 远程 : 跟踪名为'{0}'的文件 跟踪所有 *{0} 文件 @@ -366,8 +367,8 @@ 取消弹出面板 克隆远程仓库 关闭当前页面 - 切换到上一个页面 切换到下一个页面 + 切换到上一个页面 新建页面 打开偏好设置面板 仓库页面快捷键 @@ -378,11 +379,11 @@ 丢弃选中的更改 拉取 (fetch) 远程变更 切换左边栏为分支/标签等显示模式(默认) + 切换左边栏为提交搜索模式 拉回 (pull) 远程变更 推送本地变更到远程 重新加载仓库状态 将选中的变更暂存或从暂存列表中移除 - 切换左边栏为提交搜索模式 显示本地更改 显示历史记录 显示贮藏列表 @@ -391,9 +392,9 @@ 定位到下一个匹配搜索的位置 定位到上一个匹配搜索的位置 打开搜索 + 丢弃 暂存 移出暂存区 - 丢弃 初始化新仓库 路径 : 挑选(Cherry-Pick)操作进行中。 @@ -405,10 +406,10 @@ 回滚提交操作进行中。 正在回滚提交 交互式变基 - 目标分支 : 起始提交 : - 在浏览器中访问 + 目标分支 : 复制链接地址 + 在浏览器中访问 出错了 系统提示 合并分支 @@ -434,16 +435,16 @@ 复制仓库路径 新标签页 粘贴 - 刚刚 - {0}分钟前 + {0}天前 1小时前 {0}小时前 - 昨天 - {0}天前 + 刚刚 上个月 - {0}个月前 一年前 + {0}分钟前 + {0}个月前 {0}年前 + 昨天 偏好设置 AI Analyze Diff Prompt @@ -455,11 +456,11 @@ 启用流式输出 外观配置 缺省字体 + 代码字体大小 编辑器制表符宽度 字体大小 默认 代码编辑器 - 代码字体大小 等宽字体 仅在文本编辑器中使用等宽字体 主题 @@ -485,24 +486,24 @@ 邮箱 默认GIT用户邮箱 拉取更新时启用修剪(--prune) + 本软件要求GIT最低版本为2.23.0 安装路径 启用HTTP SSL验证 用户名 默认GIT用户名 Git 版本 - 本软件要求GIT最低版本为2.23.0 GPG签名 启用提交签名 - 启用标签签名 签名格式 签名程序位置 签名程序所在路径 + 启用标签签名 用户签名KEY 输入签名提交所使用的KEY 第三方工具集成 终端/SHELL - 终端/SHELL 安装路径 + 终端/SHELL 清理远程已删除分支 目标 : 清理工作树 @@ -669,11 +670,11 @@ 提交统计 提交次数 提交者 + 总览 本月 本周 - 提交次数: 贡献者人数: - 总览 + 提交次数: 子模块 添加子模块 复制路径 @@ -688,13 +689,13 @@ 删除 ${0}$... 合并 ${0}$ 到 ${1}$... 推送 ${0}$... - 仓库地址 : 更新子模块 更新所有子模块 启用 '--init' 启用 '--recursive' 子模块 : 启用 '--remote' + 仓库地址 : 警告 起始页 新建分组 @@ -724,13 +725,13 @@ 触发点击事件 提交(修改原始提交) 自动暂存所有变更并提交 - 当前有 {0} 个文件在暂存区中,但仅显示了 {1} 个文件({2} 个文件被过滤掉了),是否继续提交? 提交未包含变更文件!是否继续(--allow-empty)? 检测到冲突 文件冲突已解决 显示未跟踪文件 没有提交信息记录 没有可应用的提交信息模板 + 请选中冲突文件,打开右键菜单,选择合适的解决方式 署名 已暂存 从暂存区移除选中 @@ -740,7 +741,6 @@ 暂存所有 查看忽略变更文件 模板:${0}$ - 请选中冲突文件,打开右键菜单,选择合适的解决方式 工作区: 配置工作区... 本地工作树 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 88b0ab64..e090fe2a 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -2,19 +2,20 @@ + 關於 關於 SourceGit 開源免費的 Git 客戶端 新增工作區 - 簽出分支方式: - 已有分支 - 建立新分支 工作區路徑: 填寫該工作區的路徑。支援相對路徑。 分支名稱: 選填。預設使用目標資料夾名稱。 追蹤分支 設定遠端追蹤分支 + 簽出分支方式: + 建立新分支 + 已有分支 AI 助理 重新產生 使用 AI 產生提交訊息 @@ -64,8 +65,8 @@ 追蹤上游分支不存在或已刪除! 位元組 取 消 - 重設檔案為此版本 重設檔案到上一版本 + 重設檔案為此版本 產生提交訊息 切換變更顯示模式 檔案名稱 + 路徑列表模式 @@ -73,12 +74,12 @@ 檔案目錄樹狀結構模式 簽出 (checkout) 分支 簽出 (checkout) 提交 - 注意: 執行該操作後,目前 HEAD 會變為分離 (detached) 狀態! 提交: - 目標分支: + 注意: 執行該操作後,目前 HEAD 會變為分離 (detached) 狀態! 未提交變更: 捨棄變更 擱置變更並自動復原 + 目標分支: 揀選提交 提交資訊中追加來源資訊 提交列表: @@ -97,9 +98,9 @@ 遠端存放庫: 關閉 提交訊息編輯器 + 簽出 (checkout) 此提交 揀選 (cherry-pick) 此提交 揀選 (cherry-pick)... - 簽出 (checkout) 此提交 與目前 HEAD 比較 與本機工作區比較 複製摘要資訊 @@ -134,12 +135,12 @@ 相關參照 提交編號 在瀏覽器中檢視 - 填寫提交訊息標題 詳細描述 + 填寫提交訊息標題 存放庫設定 提交訊息範本 - 範本名稱: 範本內容: + 範本名稱: 自訂動作 指令參數: 使用 ${REPO} 表示存放庫路徑、${BRANCH} 表示所選的分支、${SHA} 表示所選的提交編號 @@ -189,8 +190,8 @@ 類型: 複製 複製全部內容 - 複製路徑 複製完整路徑 + 複製路徑 新增分支... 新分支基於: 完成後切換到新分支 @@ -226,8 +227,8 @@ 路徑: 目標: 所有子節點都會從清單中移除。 - 刪除群組確認 只會從清單中移除,而不會刪除磁碟中的檔案! + 刪除群組確認 刪除存放庫確認 刪除子模組確認 子模組路徑: @@ -296,11 +297,11 @@ 取消暫存 從暫存中移除 {0} 個檔案 取消暫存選取的變更 - 使用對方版本 (checkout --theirs) 使用我方版本 (checkout --ours) + 使用對方版本 (checkout --theirs) 檔案歷史 - 檔案内容 檔案變更 + 檔案内容 Git 工作流 開發分支: 功能分支: @@ -330,8 +331,8 @@ 規則: 加入 LFS 追蹤檔案規則 提取 (fetch) - 提取 LFS 物件 執行 `git lfs fetch` 以下載遠端 LFS 物件,但不會更新工作副本。 + 提取 LFS 物件 啟用 Git LFS 支援 顯示 LFS 物件鎖 沒有鎖定的 LFS 物件 @@ -343,11 +344,11 @@ 清理 (prune) 執行 `git lfs prune` 以從本機中清理目前版本不需要的 LFS 物件 拉取 (pull) - 拉取 LFS 物件 執行 `git lfs pull` 以下載遠端 LFS 物件並更新工作副本。 + 拉取 LFS 物件 推送 (push) - 推送 LFS 物件 將大型檔案推送到 Git LFS 遠端服務 + 推送 LFS 物件 遠端存放庫: 追蹤名稱為「{0}」的檔案 追蹤所有 *{0} 檔案 @@ -366,8 +367,8 @@ 取消彈出面板 複製 (clone) 遠端存放庫 關閉目前頁面 - 切換到上一個頁面 切換到下一個頁面 + 切換到上一個頁面 新增頁面 開啟偏好設定面板 存放庫頁面快速鍵 @@ -378,11 +379,11 @@ 捨棄選取的變更 提取 (fetch) 遠端的變更 切換左邊欄為分支/標籤等顯示模式 (預設) + 切換左邊欄為歷史搜尋模式 拉取 (pull) 遠端的變更 推送 (push) 本機變更到遠端存放庫 強制重新載入存放庫 暫存或取消暫存選取的變更 - 切換左邊欄為歷史搜尋模式 顯示本機變更 顯示歷史記錄 顯示擱置變更列表 @@ -391,9 +392,9 @@ 前往下一個搜尋相符的位置 前往上一個搜尋相符的位置 開啟搜尋面板 + 捨棄 暫存 取消暫存 - 捨棄 初始化存放庫 路徑: 揀選 (cherry-pick) 操作進行中。 @@ -405,10 +406,10 @@ 復原提交操作進行中。 正在復原提交 互動式重定基底 - 目標分支: 起始提交: - 在瀏覽器中開啟連結 + 目標分支: 複製連結 + 在瀏覽器中開啟連結 發生錯誤 系統提示 合併分支 @@ -434,16 +435,16 @@ 複製存放庫路徑 新分頁 貼上 - 剛剛 - {0} 分鐘前 + {0} 天前 1 小時前 {0} 小時前 - 昨天 - {0} 天前 + 剛剛 上個月 - {0} 個月前 一年前 + {0} 分鐘前 + {0} 個月前 {0} 年前 + 昨天 偏好設定 AI 分析變更差異提示詞 @@ -484,24 +485,24 @@ 電子郵件 預設 Git 使用者電子郵件 拉取變更時進行清理 (--prune) + 本軟體要求 Git 最低版本為 2.23.0 安裝路徑 啟用 HTTP SSL 驗證 使用者名稱 預設 Git 使用者名稱 Git 版本 - 本軟體要求 Git 最低版本為 2.23.0 GPG 簽章 啟用提交簽章 - 啟用標籤簽章 GPG 簽章格式 可執行檔案路徑 填寫 gpg.exe 所在路徑 + 啟用標籤簽章 使用者簽章金鑰 填寫簽章提交所使用的金鑰 第三方工具整合 終端機/Shell - 終端機/Shell 安裝路徑 + 終端機/Shell 清理遠端已刪除分支 目標: 清理工作區 @@ -668,11 +669,11 @@ 提交統計 提交次數 提交者 + 總覽 本月 本週 - 提交次數: 貢獻者人數: - 總覽 + 提交次數: 子模組 新增子模組 複製路徑 @@ -687,13 +688,13 @@ 刪除 ${0}$... 合併 ${0}$ 到 ${1}$... 推送 ${0}$... - 存放庫網址: 更新子模組 更新所有子模組 啟用 [--init] 選項 啟用 [--recursive] 選項 子模組: 啟用 [--remote] 選項 + 存放庫網址: 警告 起始頁 新增群組 @@ -706,8 +707,8 @@ 開啟所有包含存放庫 開啟本機存放庫 開啟終端機 - 快速搜尋存放庫... 重新掃描預設複製 (clone) 目錄下的存放庫 + 快速搜尋存放庫... 排序 本機變更 加入至 .gitignore 忽略清單 @@ -723,13 +724,13 @@ 觸發點擊事件 提交 (修改原始提交) 自動暫存全部變更並提交 - 您已暫存 {0} 檔案,但只顯示 {1} 檔案 ({2} 檔案被篩選器隱藏)。您要繼續嗎? 未包含任何檔案變更! 您是否仍要提交 (--allow-empty)? 檢測到衝突 檔案衝突已解決 顯示未追蹤檔案 沒有提交訊息記錄 沒有可套用的提交訊息範本 + 請選擇發生衝突的檔案,開啟右鍵選單,選擇合適的解決方式 署名 已暫存 取消暫存選取的檔案 @@ -739,7 +740,6 @@ 暫存所有檔案 檢視不追蹤變更的檔案 範本: ${0}$ - 請選擇發生衝突的檔案,開啟右鍵選單,選擇合適的解決方式 工作區: 設定工作區... 本機工作區 From f29402ceec9f2c6fcf796c2a5248c656a2c46cb8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 7 Apr 2025 12:05:43 +0000 Subject: [PATCH 088/571] doc: Update translation status and missing keys --- TRANSLATION.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 0f44cbcf..2fd8672b 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -36,12 +36,13 @@ This document shows the translation status of each locale file in the repository -### ![fr__FR](https://img.shields.io/badge/fr__FR-99.73%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-99.60%25-yellow)
Missing keys in fr_FR.axaml - Text.Configure.Git.PreferredMergeMode +- Text.PruneRemote - Text.WorkingCopy.ConfirmCommitWithFilter
@@ -147,16 +148,33 @@ This document shows the translation status of each locale file in the repository -### ![ru__RU](https://img.shields.io/badge/ru__RU-99.73%25-yellow) +### ![ru__RU](https://img.shields.io/badge/ru__RU-99.33%25-yellow)
Missing keys in ru_RU.axaml +- Text.BranchCM.CompareWithHead - Text.Configure.Git.PreferredMergeMode +- Text.Launcher.Error +- Text.Welcome.ScanDefaultCloneDir - Text.WorkingCopy.ConfirmCommitWithFilter
-### ![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen) +### ![zh__CN](https://img.shields.io/badge/zh__CN-99.87%25-yellow) -### ![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen) \ No newline at end of file +
+Missing keys in zh_CN.axaml + +- Text.WorkingCopy.ConfirmCommitWithFilter + +
+ +### ![zh__TW](https://img.shields.io/badge/zh__TW-99.87%25-yellow) + +
+Missing keys in zh_TW.axaml + +- Text.WorkingCopy.ConfirmCommitWithFilter + +
\ No newline at end of file From 2c5ee4fa99b00e25c49e144f8a105a910b5af62b Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 7 Apr 2025 20:19:00 +0800 Subject: [PATCH 089/571] localization: add keys deleted by sorter tools back Signed-off-by: leo --- src/Resources/Locales/fr_FR.axaml | 1 + src/Resources/Locales/ru_RU.axaml | 3 +++ src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + 4 files changed, 6 insertions(+) diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index f3cf80eb..ac2ed8b8 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -505,6 +505,7 @@ SHELL/TERMINAL Chemin Shell/Terminal + Élaguer une branche distant Cible : Élaguer les Worktrees Élaguer les information de worktree dans `$GIT_COMMON_DIR/worktrees` diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index 7da65b5e..e778af86 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -43,6 +43,7 @@ Расследование РАССЛЕДОВАНИЕ В ЭТОМ ФАЙЛЕ НЕ ПОДДЕРЖИВАЕТСЯ!!! Проверить ${0}$... + Сравнить с ГОЛОВОЙ (HEAD) Сравнить с рабочим каталогом Копировать имя ветки Изменить действие @@ -409,6 +410,7 @@ Целевая ветка: Копировать ссылку Открыть в браузере + ОШИБКА УВЕДОМЛЕНИЕ Влить ветку В: @@ -706,6 +708,7 @@ Открыть все репозитории Открыть репозиторий Открыть терминал + Повторное сканирование репозиториев в каталоге клонирования по умолчанию Поиск репозиториев... Сортировка Изменения diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 281d6a4d..c1cbcc77 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -725,6 +725,7 @@ 触发点击事件 提交(修改原始提交) 自动暂存所有变更并提交 + 当前有 {0} 个文件在暂存区中,但仅显示了 {1} 个文件({2} 个文件被过滤掉了),是否继续提交? 提交未包含变更文件!是否继续(--allow-empty)? 检测到冲突 文件冲突已解决 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index e090fe2a..34dac155 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -724,6 +724,7 @@ 觸發點擊事件 提交 (修改原始提交) 自動暫存全部變更並提交 + 您已暫存 {0} 檔案,但只顯示 {1} 檔案 ({2} 檔案被篩選器隱藏)。您要繼續嗎? 未包含任何檔案變更! 您是否仍要提交 (--allow-empty)? 檢測到衝突 檔案衝突已解決 From 7fedef396f2f964a392cf9b422818eaf663d840d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 7 Apr 2025 12:19:19 +0000 Subject: [PATCH 090/571] doc: Update translation status and missing keys --- TRANSLATION.md | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 2fd8672b..0f44cbcf 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -36,13 +36,12 @@ This document shows the translation status of each locale file in the repository -### ![fr__FR](https://img.shields.io/badge/fr__FR-99.60%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-99.73%25-yellow)
Missing keys in fr_FR.axaml - Text.Configure.Git.PreferredMergeMode -- Text.PruneRemote - Text.WorkingCopy.ConfirmCommitWithFilter
@@ -148,33 +147,16 @@ This document shows the translation status of each locale file in the repository -### ![ru__RU](https://img.shields.io/badge/ru__RU-99.33%25-yellow) +### ![ru__RU](https://img.shields.io/badge/ru__RU-99.73%25-yellow)
Missing keys in ru_RU.axaml -- Text.BranchCM.CompareWithHead - Text.Configure.Git.PreferredMergeMode -- Text.Launcher.Error -- Text.Welcome.ScanDefaultCloneDir - Text.WorkingCopy.ConfirmCommitWithFilter
-### ![zh__CN](https://img.shields.io/badge/zh__CN-99.87%25-yellow) +### ![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen) -
-Missing keys in zh_CN.axaml - -- Text.WorkingCopy.ConfirmCommitWithFilter - -
- -### ![zh__TW](https://img.shields.io/badge/zh__TW-99.87%25-yellow) - -
-Missing keys in zh_TW.axaml - -- Text.WorkingCopy.ConfirmCommitWithFilter - -
\ No newline at end of file +### ![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen) \ No newline at end of file From 1555abd027cbf2d9eafdba88edb8ff76995305db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20W?= <44604769+goran-w@users.noreply.github.com> Date: Mon, 7 Apr 2025 14:22:53 +0200 Subject: [PATCH 091/571] Added new ExternalMerger - Plastic SCM (#1162) Motivation: https://m-pixel.com/how-to-use-plastic-scms-merge-tool-with-p4v/ --- src/Models/ExternalMerger.cs | 1 + .../Images/ExternalToolIcons/plastic_merge.png | Bin 0 -> 6369 bytes 2 files changed, 1 insertion(+) create mode 100644 src/Resources/Images/ExternalToolIcons/plastic_merge.png diff --git a/src/Models/ExternalMerger.cs b/src/Models/ExternalMerger.cs index 49d31df5..d97d3933 100644 --- a/src/Models/ExternalMerger.cs +++ b/src/Models/ExternalMerger.cs @@ -42,6 +42,7 @@ namespace SourceGit.Models new ExternalMerger(7, "win_merge", "WinMerge", "WinMergeU.exe", "\"$MERGED\"", "-u -e -sw \"$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\""), + new ExternalMerger(10, "plastic_merge", "Plastic SCM", "mergetool.exe", "-s=\"$REMOTE\" -b=\"$BASE\" -d=\"$LOCAL\" -r=\"$MERGED\" --automatic", "-s=\"$LOCAL\" -d=\"$REMOTE\""), }; } else if (OperatingSystem.IsMacOS()) diff --git a/src/Resources/Images/ExternalToolIcons/plastic_merge.png b/src/Resources/Images/ExternalToolIcons/plastic_merge.png new file mode 100644 index 0000000000000000000000000000000000000000..0d82fc86f7f266a9be39ed16757d02f609febcc3 GIT binary patch literal 6369 zcmeH~c{G&m|Ho&{WQ(#!Lemt9W*^KwTFLZy**GEfR)vc_2y>9}S|wIBqx$ z7I%;D6{K+qjcF_ zSm3bk#E$K0K4mQRrI~g1<+F@)674h{_V)Ig)X&lXz^tIvQwCr3m@00Xk9xIf-{BpZ z6D`Hp(U(%6B%W;?uiv1cSV{A_W-I4q-hR1sFRQ2?Eg!0GtG3`OdMUxjb70Qsuzu+H z@W?yt-zU#@e56ih?QMe>PWqv&Z5M=hN01U1KZEb zb?nr8Kcv4llUeb$`oZ~%HAgS_Tp&1gnuMCvS42PRt++j}LhSkJoQrGF-)r-qDta>= z_2#DSzG17nj+u7z*d7+zeadzA=jtaNyWNfbRd?#Y=}J~^8%h2A*K5JG(Z0>OTCQ>l zxVn!7Wn^qh%+0!%41QyR+(bc&S><4NB%D-GY}pt%q^R2^kF9Dvcvd0!70ki2f#b5P z@6RQf?b4~a2|nt&XJ?!%7YOqc^60Sm7i*r&Qz*zwrkPDoM_zdeg`W>Se>;vikSD5p z(N}B<)m#i0sx2mC1&uA_V*!qk1!Cj)(NNLBU{*G9(EvLNl%QB(1Xo~zapR~YjmVU5>3P5Vq;^m zu_UZe6oDg9sZ<=Eh$9j)kOf8@FOUFn7=d`94Dp5G2#VPvZnT6e6rf~GfF)cfu|}hz zanv{e_|Xi;cf3ISRRu^7TpSRMBVh43J|Fkv46(#127-Kb=s(U7`$Ah3=M9R5>qKnO zDFzfs7XFA>?#l4`PLPEZ!R1F!2L*}u(_$RP za}vgq%)(>HR4RaBS+L0%B7s0AQwac`g$I5>xeCM*K)?oNCRj4 zL*}sY7#5L8#aKXj=71D}C51@(0pTg)LRAUye)LL);y@@$I7lLr03wD(0*M$h3!q{E z8I%J84T0g=p@8_KMKF<1^N2l{C&;Ce{%^G z>h~hQr0;LJe#`Ys3jC7s@9O$3*DopXOUA#e>;FwI<$ph>Kmqgy6bpSS1*vGfgg&$6 zS?;DfZ~~RX$@`ZV$nmhEgHKlaA?S!L zy-`wHA;Er#TrGdivvcON&w6sFQV~3P0i&y5J1l*4Sl%3d@9~@-LXQ|cHi4ef1`H_5Lm!;+lLmcNCDJ=wCCAjyo!G+*Wh6Gk;}%`%*deiyyV=+B^2(D_c63Y)5Wi`nT7g+&6*8y; zc}l5vzWoM}U)^!JqGgZQ0J_k_Fg6``+{bW0^`lTNYJZe&$Ber+7hd=haFfJghp>vr zPDyGuLeDT)6QCzF{#SBn+JM*$i6zU3z^#F&T8%3Tov!K zF+No8;hT$SdYIZrZM=WHB-g?|W3F@noDoS(xigD#53sC0jT}xJ3VB%_w2XXlG8(_t zc&<`mG2q&&ur&Lii-KN|KE7Q-iS@a0CVJ9D!uv`1qp&Q%_qUE5z#q9~d~~1rlt_G>_M?X417wZ2Y1;JuxC1EM`$`e zwcmMYiIo1b+I`srEw<_guTws_%w6?6>*|VchDGE|GE^pNS;#@ z8o3Wu-&!cPh-O|=d-SMP>?Ccc&nifVwS-uZxv2%7{)Q*_4qe%v7RQLcDpxwM*FleY z#K3S@SASlaBfV#PU#c+ZkN1Y1;gr0kUWS;Gp>~I~xRvpzU^5*fe1ocNv=2shW}#5G zW_wCXx8_rF4mU<$++O4QVPo#|%jE_Zm%HN->h~AXc@4d-MYana;#&w4Tk95p8u(Y< zg;!(Es>*MYi#OD0wP)%OUBv&ei(-2B8HpZ+mKy9r%qz>1j)h!W%cI&}sZIWjdKH}0 z`z|RUzDEf$v2@tfj*oiSnsW!f+|jto+71z~XS!QZ$?>T67dytkb%wR9UZ%hM>h(Ve zYXq>EHQNyPlx+G;GD6l&<;a&K;pv)7?iFcMn36Hie@fvBCAfa%>2f>UXN9}+YqAeD zGM%4R%IjX#kgr#r8#y!XG;DFV$BhHqZoF$!Io=uGa~}6+KxeI+ZChm{?6Xx)?^QJh zyUBR<&24Fc@DO*u`^iC4ZO60alpAG7%WsfxMQts4=LZj|Md`+0e!WuPCU?`;a)oA7 zyWv3Ll25JoKPw$Qx6C56r1_3K{6H|EV8?%5qS4TVT;V6++zwDR)w$fKtUx+*j=X8j z>k-`>Po!4;M8+9?m4}E9qZtpZOxU)@{?RGvNbp@RTNrYP;ft*TJ_fk$exx6~>@T#& zsFc=SSBL1%Y|SvUyiL3w;H*~MlkJq2r>}+7QeUgj^uYd=PHgvAGPPOhny~}p4~TE;h{1*ne14u0t)ee#MM? zXOlxUN2ZRtF{KIG)e`~I1>JRq@Ay%1D#MRy?MINEfab(QTX&VX#~=KpHaxC*OY45x@g+}_8#CK^{UY+#t5ZEq8ceNA&DiSsWvXLb&&fK! zoHlI>zvQ$UsZTRM0nv5iR%>lSPf=LaN-{67CK_j_`b1L_2E-jZTFY(-tx<} zO|whaEGQ0{A0slZe{mw@%+^6t0Ntd9?Ge0U`y$jnGs#3>_KFNr8hu{)LkD{c z6P=U;kW(`z;NYs@E4;-i3R&$Pny{9AJ$r8%C`l57&hT*DxmWv??<>7}#LLXjE@O=H zqxK1d`iJH<^jT}J=vkLNxGp>2wh{ip>Be2H8T1is$LY#+R=DdJG9qPLO67sz1+VYl zo}ZH8q-1HXL!W)h%(8BBLtBS`+T1@i_fMJjA2f3@;)@gRAM}U@o-b6o(2cG)sa2bZ z+*wkFe0s>JUOBeO?k!GZSz>{fPutYSB#~RuEd;ThJvsPxE%MpYSeI2MZQ%3Qg?CF2 zEx}NO#_U>8SGpHmTzYtZ`b)f=BzrCKN#)j84}%-9ud~Ogj20jFX8uETYSZZ!WLg0Z zvC3%p%|LS2m426`OQAIn4hn-vi|7vmP2uaYbGB1Y3_Xf`HoAS{{md-gSf?Es&H3Ji zbL0loKT%G+HXUBPH-WrPZvuO;vSc#8Q_BJdIPUaCk=Y7~nxE`!J z>~}Jmej6VsQYNL$sY#x-sk|mPE2{ZnK--vb<7C-wJt?sOdR>9JI(ax&*@tcVAGdk& A_y7O^ literal 0 HcmV?d00001 From 7cda7211f1035a63bf444c57051a308cebbe8d48 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 7 Apr 2025 21:20:59 +0800 Subject: [PATCH 092/571] refactor: statistics dialog - use `%aN+%aE` instead of `%aN` to get commit author - show user avatar in statistics dialog Signed-off-by: leo --- src/Commands/Statistics.cs | 2 +- src/Models/Statistics.cs | 16 +++++++++------- src/Views/Statistics.axaml | 16 ++++++++++------ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Commands/Statistics.cs b/src/Commands/Statistics.cs index 1439cedd..41b3889e 100644 --- a/src/Commands/Statistics.cs +++ b/src/Commands/Statistics.cs @@ -8,7 +8,7 @@ namespace SourceGit.Commands { WorkingDirectory = repo; Context = repo; - Args = $"log --date-order --branches --remotes -{max} --format=%ct$%aN"; + Args = $"log --date-order --branches --remotes -{max} --format=%ct$%aN±%aE"; } public Models.Statistics Result() diff --git a/src/Models/Statistics.cs b/src/Models/Statistics.cs index 969d3945..87a6eabd 100644 --- a/src/Models/Statistics.cs +++ b/src/Models/Statistics.cs @@ -18,9 +18,9 @@ namespace SourceGit.Models ThisWeek, } - public class StaticsticsAuthor(string name, int count) + public class StaticsticsAuthor(User user, int count) { - public string Name { get; set; } = name; + public User User { get; set; } = user; public int Count { get; set; } = count; } @@ -73,7 +73,7 @@ namespace SourceGit.Models } } - public void AddCommit(DateTime time, string author) + public void AddCommit(DateTime time, User author) { Total++; @@ -126,7 +126,7 @@ namespace SourceGit.Models } private StaticsticsMode _mode = StaticsticsMode.All; - private Dictionary _mapUsers = new Dictionary(); + private Dictionary _mapUsers = new Dictionary(); private Dictionary _mapSamples = new Dictionary(); } @@ -150,14 +150,16 @@ namespace SourceGit.Models public void AddCommit(string author, double timestamp) { + var user = User.FindOrAdd(author); + var time = DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime(); if (time >= _thisWeekStart) - Week.AddCommit(time, author); + Week.AddCommit(time, user); if (time >= _thisMonthStart) - Month.AddCommit(time, author); + Month.AddCommit(time, user); - All.AddCommit(time, author); + All.AddCommit(time, user); } public void Complete() diff --git a/src/Views/Statistics.axaml b/src/Views/Statistics.axaml index 0c002407..3bbdafbe 100644 --- a/src/Views/Statistics.axaml +++ b/src/Views/Statistics.axaml @@ -136,7 +136,7 @@ - + - - - + + + + - + @@ -177,7 +181,7 @@ - + From da38b72ee5b3f653bfd197975a73b66ef430b571 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 8 Apr 2025 18:03:40 +0800 Subject: [PATCH 093/571] ux: disable commit button when commit message is empty Signed-off-by: leo --- src/Converters/StringConverters.cs | 3 +++ src/ViewModels/WorkingCopy.cs | 9 +++------ src/Views/WorkingCopy.axaml | 30 +++++++++++++++++++++++++----- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/Converters/StringConverters.cs b/src/Converters/StringConverters.cs index 5e4608c5..bcadfae9 100644 --- a/src/Converters/StringConverters.cs +++ b/src/Converters/StringConverters.cs @@ -81,5 +81,8 @@ namespace SourceGit.Converters public static readonly FuncValueConverter ContainsSpaces = new FuncValueConverter(v => v != null && v.Contains(' ')); + + public static readonly FuncValueConverter IsNotNullOrWhitespace = + new FuncValueConverter(v => v != null && v.Trim().Length > 0); } } diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index a0933ea3..784328cc 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -1652,6 +1652,9 @@ namespace SourceGit.ViewModels private void DoCommit(bool autoStage, bool autoPush, bool allowEmpty = false, bool confirmWithFilter = false) { + if (string.IsNullOrWhiteSpace(_commitMessage)) + return; + if (!_repo.CanCreatePopup()) { App.RaiseException(_repo.FullPath, "Repository has unfinished job! Please wait!"); @@ -1672,12 +1675,6 @@ namespace SourceGit.ViewModels return; } - if (string.IsNullOrWhiteSpace(_commitMessage)) - { - App.RaiseException(_repo.FullPath, "Commit without message is NOT allowed!"); - return; - } - if (!_useAmend && !allowEmpty) { if ((autoStage && _count == 0) || (!autoStage && _staged.Count == 0)) diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index 94dd0c30..4ca854fa 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -295,7 +295,9 @@ - + @@ -309,7 +311,6 @@ Command="{Binding Commit}" HotKey="{OnPlatform Ctrl+Enter, macOS=⌘+Enter}" IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNull}}" - IsEnabled="{Binding !IsCommitting}" ToolTip.Placement="Top" ToolTip.VerticalOffset="0"> @@ -324,6 +325,13 @@ + + + + + + + @@ -331,8 +339,14 @@ Width="0" Height="0" Background="Transparent" Command="{Binding CommitWithAutoStage}" - HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}" - IsEnabled="{Binding !IsCommitting}"/> + HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"> + + + + + + + + - - - - From a99ab377977776cf0c45c483fd6fa3b44fc09265 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 11 Apr 2025 01:33:18 +0000 Subject: [PATCH 101/571] doc: Update translation status and missing keys --- TRANSLATION.md | 66 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 9 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 0a469262..aee13ea5 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,7 +6,7 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-97.86%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-97.34%25-yellow)
Missing keys in de_DE.axaml @@ -27,10 +27,14 @@ This document shows the translation status of each locale file in the repository - Text.Preferences.General.ShowTagsInGraph - Text.StashCM.SaveAsPatch - Text.WorkingCopy.ConfirmCommitWithFilter +- Text.WorkingCopy.Conflicts.OpenExternalMergeTool +- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts +- Text.WorkingCopy.Conflicts.UseMine +- Text.WorkingCopy.Conflicts.UseTheirs
-### ![es__ES](https://img.shields.io/badge/es__ES-99.20%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-98.67%25-yellow)
Missing keys in es_ES.axaml @@ -41,10 +45,14 @@ This document shows the translation status of each locale file in the repository - Text.ConfirmEmptyCommit.Continue - Text.ConfirmEmptyCommit.StageAllThenCommit - Text.WorkingCopy.ConfirmCommitWithFilter +- Text.WorkingCopy.Conflicts.OpenExternalMergeTool +- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts +- Text.WorkingCopy.Conflicts.UseMine +- Text.WorkingCopy.Conflicts.UseTheirs
-### ![fr__FR](https://img.shields.io/badge/fr__FR-99.20%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-98.67%25-yellow)
Missing keys in fr_FR.axaml @@ -55,10 +63,14 @@ This document shows the translation status of each locale file in the repository - Text.ConfirmEmptyCommit.Continue - Text.ConfirmEmptyCommit.StageAllThenCommit - Text.WorkingCopy.ConfirmCommitWithFilter +- Text.WorkingCopy.Conflicts.OpenExternalMergeTool +- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts +- Text.WorkingCopy.Conflicts.UseMine +- Text.WorkingCopy.Conflicts.UseTheirs
-### ![it__IT](https://img.shields.io/badge/it__IT-98.93%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-98.40%25-yellow)
Missing keys in it_IT.axaml @@ -71,10 +83,14 @@ This document shows the translation status of each locale file in the repository - Text.CopyFullPath - Text.Preferences.General.ShowTagsInGraph - Text.WorkingCopy.ConfirmCommitWithFilter +- Text.WorkingCopy.Conflicts.OpenExternalMergeTool +- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts +- Text.WorkingCopy.Conflicts.UseMine +- Text.WorkingCopy.Conflicts.UseTheirs
-### ![ja__JP](https://img.shields.io/badge/ja__JP-98.93%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-98.40%25-yellow)
Missing keys in ja_JP.axaml @@ -87,10 +103,14 @@ This document shows the translation status of each locale file in the repository - Text.Repository.FilterCommits - Text.Repository.Tags.OrderByNameDes - Text.WorkingCopy.ConfirmCommitWithFilter +- Text.WorkingCopy.Conflicts.OpenExternalMergeTool +- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts +- Text.WorkingCopy.Conflicts.UseMine +- Text.WorkingCopy.Conflicts.UseTheirs
-### ![pt__BR](https://img.shields.io/badge/pt__BR-90.24%25-yellow) +### ![pt__BR](https://img.shields.io/badge/pt__BR-89.76%25-yellow)
Missing keys in pt_BR.axaml @@ -167,11 +187,15 @@ This document shows the translation status of each locale file in the repository - Text.StashCM.SaveAsPatch - Text.WorkingCopy.CommitToEdit - Text.WorkingCopy.ConfirmCommitWithFilter +- Text.WorkingCopy.Conflicts.OpenExternalMergeTool +- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts +- Text.WorkingCopy.Conflicts.UseMine +- Text.WorkingCopy.Conflicts.UseTheirs - Text.WorkingCopy.SignOff
-### ![ru__RU](https://img.shields.io/badge/ru__RU-99.20%25-yellow) +### ![ru__RU](https://img.shields.io/badge/ru__RU-98.67%25-yellow)
Missing keys in ru_RU.axaml @@ -182,9 +206,33 @@ This document shows the translation status of each locale file in the repository - Text.ConfirmEmptyCommit.Continue - Text.ConfirmEmptyCommit.StageAllThenCommit - Text.WorkingCopy.ConfirmCommitWithFilter +- Text.WorkingCopy.Conflicts.OpenExternalMergeTool +- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts +- Text.WorkingCopy.Conflicts.UseMine +- Text.WorkingCopy.Conflicts.UseTheirs
-### ![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen) +### ![zh__CN](https://img.shields.io/badge/zh__CN-99.47%25-yellow) -### ![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen) \ No newline at end of file +
+Missing keys in zh_CN.axaml + +- Text.WorkingCopy.Conflicts.OpenExternalMergeTool +- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts +- Text.WorkingCopy.Conflicts.UseMine +- Text.WorkingCopy.Conflicts.UseTheirs + +
+ +### ![zh__TW](https://img.shields.io/badge/zh__TW-99.47%25-yellow) + +
+Missing keys in zh_TW.axaml + +- Text.WorkingCopy.Conflicts.OpenExternalMergeTool +- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts +- Text.WorkingCopy.Conflicts.UseMine +- Text.WorkingCopy.Conflicts.UseTheirs + +
\ No newline at end of file From 1799de4907c9b01290cd9e9700c80717b1238b41 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 11 Apr 2025 10:02:33 +0800 Subject: [PATCH 102/571] code_review: PR #1173 - rename c-style `file_arg` to `fileArg` - add missing translations for zh_CN and zh_TW - re-design conflict view and add tooltip for `USE THEIRS` and `USE MINE` - re-order unstaged toolbar buttons Signed-off-by: leo --- src/Commands/MergeTool.cs | 6 +- src/Resources/Locales/zh_CN.axaml | 4 + src/Resources/Locales/zh_TW.axaml | 4 + src/Views/Conflict.axaml | 167 ++++++++++++++++-------------- src/Views/WorkingCopy.axaml | 26 ++--- 5 files changed, 115 insertions(+), 92 deletions(-) diff --git a/src/Commands/MergeTool.cs b/src/Commands/MergeTool.cs index 276c078b..f67f5e48 100644 --- a/src/Commands/MergeTool.cs +++ b/src/Commands/MergeTool.cs @@ -14,11 +14,11 @@ namespace SourceGit.Commands cmd.RaiseError = true; // NOTE: If no names are specified, 'git mergetool' will run the merge tool program on every file with merge conflicts. - var file_arg = string.IsNullOrEmpty(file) ? "" : $"\"{file}\""; + var fileArg = string.IsNullOrEmpty(file) ? "" : $"\"{file}\""; if (toolType == 0) { - cmd.Args = $"mergetool {file_arg}"; + cmd.Args = $"mergetool {fileArg}"; return cmd.Exec(); } @@ -35,7 +35,7 @@ namespace SourceGit.Commands return false; } - cmd.Args = $"-c mergetool.sourcegit.cmd=\"\\\"{toolPath}\\\" {supported.Cmd}\" -c mergetool.writeToTemp=true -c mergetool.keepBackup=false -c mergetool.trustExitCode=true mergetool --tool=sourcegit {file_arg}"; + cmd.Args = $"-c mergetool.sourcegit.cmd=\"\\\"{toolPath}\\\" {supported.Cmd}\" -c mergetool.writeToTemp=true -c mergetool.keepBackup=false -c mergetool.trustExitCode=true mergetool --tool=sourcegit {fileArg}"; return cmd.Exec(); } diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index b303374f..1b878b29 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -731,7 +731,11 @@ 自动暂存所有变更并提交 当前有 {0} 个文件在暂存区中,但仅显示了 {1} 个文件({2} 个文件被过滤掉了),是否继续提交? 检测到冲突 + 打开合并工具 + 打开合并工具解决冲突 文件冲突已解决 + 使用 MINE + 使用 THEIRS 显示未跟踪文件 没有提交信息记录 没有可应用的提交信息模板 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 4239667f..e090d32d 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -730,7 +730,11 @@ 自動暫存全部變更並提交 您已暫存 {0} 檔案,但只顯示 {1} 檔案 ({2} 檔案被篩選器隱藏)。您要繼續嗎? 檢測到衝突 + 使用外部合併工具開啟 + 使用外部合併工具開啟 檔案衝突已解決 + 使用 MINE + 使用 THEIRS 顯示未追蹤檔案 沒有提交訊息記錄 沒有可套用的提交訊息範本 diff --git a/src/Views/Conflict.axaml b/src/Views/Conflict.axaml index 7f13f14e..f2d7bdec 100644 --- a/src/Views/Conflict.axaml +++ b/src/Views/Conflict.axaml @@ -12,83 +12,83 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -105,9 +105,24 @@ - + + diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index 7d471142..41d80b04 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -68,6 +68,19 @@ + + - - + + +
diff --git a/src/Views/ConfigureWorkspace.axaml.cs b/src/Views/ConfigureWorkspace.axaml.cs index 9e458f6f..8ef5dec7 100644 --- a/src/Views/ConfigureWorkspace.axaml.cs +++ b/src/Views/ConfigureWorkspace.axaml.cs @@ -1,4 +1,7 @@ using Avalonia.Controls; +using Avalonia.Interactivity; +using Avalonia.Platform.Storage; +using System; namespace SourceGit.Views { @@ -16,5 +19,28 @@ namespace SourceGit.Views if (!Design.IsDesignMode) ViewModels.Preferences.Instance.Save(); } + + private async void SelectDefaultCloneDir(object _, RoutedEventArgs e) + { + var workspace = DataContext as ViewModels.ConfigureWorkspace; + if (workspace?.Selected == null) + return; + + var options = new FolderPickerOpenOptions() { AllowMultiple = false }; + try + { + var selected = await StorageProvider.OpenFolderPickerAsync(options); + if (selected.Count == 1) + { + workspace.Selected.DefaultCloneDir = selected[0].Path.LocalPath; + } + } + catch (Exception ex) + { + App.RaiseException(string.Empty, $"Failed to select default clone directory: {ex.Message}"); + } + + e.Handled = true; + } } } From b7aa49403bdb3805460b1c70d7e3b7fa4887c13c Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 14 Apr 2025 17:03:08 +0800 Subject: [PATCH 120/571] code_review: PR #1183 - code style in `Clone` constructor - re-design workspace configuration dialog Signed-off-by: leo --- src/Resources/Locales/de_DE.axaml | 1 + src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/es_ES.axaml | 1 + src/Resources/Locales/fr_FR.axaml | 1 + src/Resources/Locales/it_IT.axaml | 1 + src/Resources/Locales/ja_JP.axaml | 1 + src/Resources/Locales/pt_BR.axaml | 1 + src/Resources/Locales/ta_IN.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/Resources/Locales/zh_TW.axaml | 1 + src/ViewModels/Clone.cs | 17 +++++------------ src/Views/ConfigureWorkspace.axaml | 29 +++++++++++++++++------------ 12 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 1ceac07c..3cb70cea 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -176,6 +176,7 @@ Benutzername für dieses Repository Arbeitsplätze Farbe + Name Zuletzt geöffnete Tabs beim Starten wiederherstellen Konventionelle Commit-Hilfe Breaking Change: diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 7ec38670..7e931998 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -176,6 +176,7 @@ User name for this repository Workspaces Color + Name Restore tabs on startup CONTINUE Empty commit detected! Do you want to continue (--allow-empty)? diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index 04fdde4b..24deeabd 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -179,6 +179,7 @@ Nombre de usuario para este repositorio Espacios de Trabajo Color + Nombre Restaurar pestañas al iniciar Asistente de Commit Convencional Cambio Importante: diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index f5679ab8..61098493 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -180,6 +180,7 @@ Nom d'utilisateur pour ce dépôt Espaces de travail Couleur + Nom Restaurer les onglets au démarrage Assistant Commits Conventionnels Changement Radical : diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index 5ed81da2..1d9901a8 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -179,6 +179,7 @@ Nome utente per questo repository Spazi di Lavoro Colore + Nome Ripristina schede all'avvio Guida Commit Convenzionali Modifica Sostanziale: diff --git a/src/Resources/Locales/ja_JP.axaml b/src/Resources/Locales/ja_JP.axaml index 1b94ed6f..db671768 100644 --- a/src/Resources/Locales/ja_JP.axaml +++ b/src/Resources/Locales/ja_JP.axaml @@ -179,6 +179,7 @@ このリポジトリにおけるユーザー名 ワークスペース + 名前 起動時にタブを復元 Conventional Commitヘルパー 破壊的変更: diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index e78c1a36..299ececd 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -161,6 +161,7 @@ Nome de usuário para este repositório Workspaces Cor + Nome Restaurar abas ao inicializar Assistente de Conventional Commit Breaking Change: diff --git a/src/Resources/Locales/ta_IN.axaml b/src/Resources/Locales/ta_IN.axaml index 30c2244b..d8d6f540 100644 --- a/src/Resources/Locales/ta_IN.axaml +++ b/src/Resources/Locales/ta_IN.axaml @@ -179,6 +179,7 @@ இந்த களஞ்சியத்திற்கான பயனர் பெயர் பணியிடங்கள் நிறம் + பெயர் தாவல்களை மீட்டமை வழக்கமான உறுதிமொழி உதவியாளர் உடைக்கும் மாற்றம்: diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index d8b63422..9040644a 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -180,6 +180,7 @@ 应用于本仓库的用户名 工作区 颜色 + 名称 启动时恢复打开的仓库 确认继续 提交未包含变更文件!是否继续(--allow-empty)? diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 833e6610..8437eefc 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -180,6 +180,7 @@ 用於本存放庫的使用者名稱 工作區 顏色 + 名稱 啟動時還原上次開啟的存放庫 确认继续 未包含任何檔案變更! 您是否仍要提交 (--allow-empty)? diff --git a/src/ViewModels/Clone.cs b/src/ViewModels/Clone.cs index 2b7c2580..97c90523 100644 --- a/src/ViewModels/Clone.cs +++ b/src/ViewModels/Clone.cs @@ -62,18 +62,13 @@ namespace SourceGit.ViewModels public Clone(string pageId) { _pageId = pageId; - View = new Views.Clone() { DataContext = this }; - // Use workspace-specific DefaultCloneDir if available var activeWorkspace = Preferences.Instance.GetActiveWorkspace(); - if (activeWorkspace != null && !string.IsNullOrEmpty(activeWorkspace.DefaultCloneDir)) - { - ParentFolder = activeWorkspace.DefaultCloneDir; - } - else - { - ParentFolder = Preferences.Instance.GitDefaultCloneDir; - } + _parentFolder = activeWorkspace?.DefaultCloneDir; + if (string.IsNullOrEmpty(ParentFolder)) + _parentFolder = Preferences.Instance.GitDefaultCloneDir; + + View = new Views.Clone() { DataContext = this }; Task.Run(async () => { @@ -81,9 +76,7 @@ namespace SourceGit.ViewModels { var text = await App.GetClipboardTextAsync(); if (Models.Remote.IsValidURL(text)) - { Dispatcher.UIThread.Invoke(() => Remote = text); - } } catch { diff --git a/src/Views/ConfigureWorkspace.axaml b/src/Views/ConfigureWorkspace.axaml index 0bef89b9..169df154 100644 --- a/src/Views/ConfigureWorkspace.axaml +++ b/src/Views/ConfigureWorkspace.axaml @@ -98,20 +98,25 @@ - - - + + + + + + + + + + + + + + - - - - - - - From 558eb7c9ac0ddff802047227e806770e303526cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 14 Apr 2025 09:03:23 +0000 Subject: [PATCH 121/571] doc: Update translation status and missing keys --- TRANSLATION.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index a2991c6e..7ae5b13f 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -70,7 +70,7 @@ This document shows the translation status of each locale file in the repository -### ![it__IT](https://img.shields.io/badge/it__IT-98.40%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-98.41%25-yellow)
Missing keys in it_IT.axaml @@ -90,7 +90,7 @@ This document shows the translation status of each locale file in the repository
-### ![ja__JP](https://img.shields.io/badge/ja__JP-98.40%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-98.41%25-yellow)
Missing keys in ja_JP.axaml @@ -110,7 +110,7 @@ This document shows the translation status of each locale file in the repository
-### ![pt__BR](https://img.shields.io/badge/pt__BR-89.76%25-yellow) +### ![pt__BR](https://img.shields.io/badge/pt__BR-89.77%25-yellow)
Missing keys in pt_BR.axaml From 09c0edef8e97f00e3dc479a2abd02ca416ac9d78 Mon Sep 17 00:00:00 2001 From: Massimo Date: Mon, 14 Apr 2025 13:16:15 +0200 Subject: [PATCH 122/571] feat: implement IPC for opening repositories in new tabs (#1185) * refactor: improve diff handling for EOL changes and enhance text diff display - Updated `Diff.cs` to streamline whitespace handling in diff arguments. - Enhanced `DiffContext.cs` to check for EOL changes when old and new hashes differ, creating a text diff if necessary. - Added support for showing end-of-line symbols in `TextDiffView.axaml.cs` options. * localization: update translations to include EOF handling in ignore whitespace messages - Modified the ignore whitespace text in multiple language files to specify that EOF changes are also ignored. - Ensured consistency across all localization files for the patch application feature. * revert: Typo in DiffResult comment * revert: update diff arguments to ignore CR at EOL in whitespace handling (like before changes) * revert: update translations to remove EOF references in Text.Apply.IgnoreWS and fixed typo in Text.Diff.IgnoreWhitespace (EOF => EOL) * feat: add workspace-specific default clone directory functionality - Implemented logic in Clone.cs to set ParentFolder based on the active workspace's DefaultCloneDir if available, falling back to the global GitDefaultCloneDir. - Added DefaultCloneDir property to Workspace.cs to store the default clone directory for each workspace. - Updated ConfigureWorkspace.axaml to include a TextBox and Button for setting the DefaultCloneDir in the UI. - Implemented folder selection functionality in ConfigureWorkspace.axaml.cs to allow users to choose a directory for cloning. - This closes issue #1145 * feat: implement IPC for opening repositories in new tabs - Added functionality to send repository paths to an existing instance of the application using named pipes. - Introduced a new preference option to open repositories in a new tab instead of a new window. - Updated UI to include a checkbox for the new preference. - Enhanced the handling of IPC server lifecycle based on the new preference setting. - This closes issue #1184 --------- Co-authored-by: mpagani --- src/App.axaml.cs | 145 +++++++++++++++++++++++++++++- src/Resources/Locales/en_US.axaml | 1 + src/ViewModels/Preferences.cs | 7 ++ src/Views/Preferences.axaml | 7 +- 4 files changed, 157 insertions(+), 3 deletions(-) diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 0448a247..b1be7072 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -2,12 +2,14 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.IO.Pipes; using System.Net.Http; using System.Reflection; using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using System.Linq; using Avalonia; using Avalonia.Controls; @@ -46,6 +48,8 @@ namespace SourceGit Environment.Exit(exitTodo); else if (TryLaunchAsRebaseMessageEditor(args, out int exitMessage)) Environment.Exit(exitMessage); + else if (TrySendArgsToExistingInstance(args)) + Environment.Exit(0); else BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); } @@ -77,6 +81,44 @@ namespace SourceGit return builder; } + private static bool TrySendArgsToExistingInstance(string[] args) + { + if (args == null || args.Length != 1 || !Directory.Exists(args[0])) + return false; + + var pref = ViewModels.Preferences.Instance; + + if (!pref.OpenReposInNewTab) + return false; + + try + { + var processes = Process.GetProcessesByName("SourceGit"); + + if (processes.Length <= 1) + return false; + + using var client = new NamedPipeClientStream(".", "SourceGitIPC", PipeDirection.Out); + + client.Connect(1000); + + if (client.IsConnected) + { + using var writer = new StreamWriter(client); + + writer.WriteLine(args[0]); + writer.Flush(); + + return true; + } + } + catch (Exception) + { + } + + return false; + } + private static void LogException(Exception ex) { if (ex == null) @@ -328,7 +370,13 @@ namespace SourceGit AvaloniaXamlLoader.Load(this); var pref = ViewModels.Preferences.Instance; - pref.PropertyChanged += (_, _) => pref.Save(); + + pref.PropertyChanged += (s, e) => { + pref.Save(); + + if (e.PropertyName.Equals(nameof(ViewModels.Preferences.OpenReposInNewTab))) + HandleOpenReposInNewTabChanged(); + }; SetLocale(pref.Locale); SetTheme(pref.Theme, pref.ThemeOverrides); @@ -488,13 +536,104 @@ namespace SourceGit _launcher = new ViewModels.Launcher(startupRepo); desktop.MainWindow = new Views.Launcher() { DataContext = _launcher }; -#if !DISABLE_UPDATE_DETECTION var pref = ViewModels.Preferences.Instance; + + HandleOpenReposInNewTabChanged(); + +#if !DISABLE_UPDATE_DETECTION if (pref.ShouldCheck4UpdateOnStartup()) Check4Update(); #endif } + private void HandleOpenReposInNewTabChanged() + { + var pref = ViewModels.Preferences.Instance; + + if (pref.OpenReposInNewTab) + { + if (_ipcServerTask == null || _ipcServerTask.IsCompleted) + { + // Start IPC server + _ipcServerCts = new CancellationTokenSource(); + _ipcServerTask = Task.Run(() => StartIPCServer(_ipcServerCts.Token)); + } + } + else + { + // Stop IPC server if running + if (_ipcServerCts != null && !_ipcServerCts.IsCancellationRequested) + { + _ipcServerCts.Cancel(); + _ipcServerCts.Dispose(); + _ipcServerCts = null; + } + _ipcServerTask = null; + } + } + + private void StartIPCServer(CancellationToken cancellationToken) + { + try + { + while (!cancellationToken.IsCancellationRequested) + { + using var server = new NamedPipeServerStream("SourceGitIPC", PipeDirection.In); + + // Use WaitForConnectionAsync with cancellation token + try + { + Task connectionTask = server.WaitForConnectionAsync(cancellationToken); + connectionTask.Wait(cancellationToken); + } + catch (OperationCanceledException) + { + return; + } + catch (AggregateException ae) when (ae.InnerExceptions.Any(e => e is OperationCanceledException)) + { + return; + } + + // Process the connection + using var reader = new StreamReader(server); + var repoPath = reader.ReadLine(); + + if (!string.IsNullOrEmpty(repoPath) && Directory.Exists(repoPath)) + { + Dispatcher.UIThread.Post(() => + { + try + { + var test = new Commands.QueryRepositoryRootPath(repoPath).ReadToEnd(); + + if (test.IsSuccess && !string.IsNullOrEmpty(test.StdOut)) + { + var repoRootPath = test.StdOut.Trim(); + var pref = ViewModels.Preferences.Instance; + var node = pref.FindOrAddNodeByRepositoryPath(repoRootPath, null, false); + + ViewModels.Welcome.Instance.Refresh(); + + _launcher?.OpenRepositoryInTab(node, null); + + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop && desktop.MainWindow != null) + desktop.MainWindow.Activate(); + } + } + catch (Exception) + { + } + }); + } + } + } + catch (Exception) + { + // Pipe server failed, we can just exit the thread + } + } + private void Check4Update(bool manually = false) { Task.Run(async () => @@ -584,5 +723,7 @@ namespace SourceGit private ResourceDictionary _activeLocale = null; private ResourceDictionary _themeOverrides = null; private ResourceDictionary _fontsOverrides = null; + private Task _ipcServerTask = null; + private CancellationTokenSource _ipcServerCts = null; } } diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 7e931998..123b6381 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -752,4 +752,5 @@ Lock Remove Unlock + Open repositories in new tab instead of new window diff --git a/src/ViewModels/Preferences.cs b/src/ViewModels/Preferences.cs index cad6c224..d1e78d6a 100644 --- a/src/ViewModels/Preferences.cs +++ b/src/ViewModels/Preferences.cs @@ -90,6 +90,12 @@ namespace SourceGit.ViewModels } } + public bool OpenReposInNewTab + { + get => _openReposInNewTab; + set => SetProperty(ref _openReposInNewTab, value); + } + public bool UseSystemWindowFrame { get => _useSystemWindowFrame; @@ -632,6 +638,7 @@ namespace SourceGit.ViewModels private string _defaultFontFamily = string.Empty; private string _monospaceFontFamily = string.Empty; private bool _onlyUseMonoFontInEditor = false; + private bool _openReposInNewTab = false; private bool _useSystemWindowFrame = false; private double _defaultFontSize = 13; private double _editorFontSize = 13; diff --git a/src/Views/Preferences.axaml b/src/Views/Preferences.axaml index 702ec20f..704757df 100644 --- a/src/Views/Preferences.axaml +++ b/src/Views/Preferences.axaml @@ -46,7 +46,7 @@ - + + + Date: Mon, 14 Apr 2025 22:03:51 +0800 Subject: [PATCH 123/571] code_review: PR #1185 - make `SourceGit` running in singleton mode - `TrySendArgsToExistingInstance` should not be called before `BuildAvaloniaApp().StartWithClassicDesktopLifetime(args)` since we may want to launch `SourceGit` as a core editor. - avoid `preference.json` to be saved by multiple instances. - move IPC code to models. Signed-off-by: leo --- src/App.axaml.cs | 166 +++++------------------------- src/Models/IpcChannel.cs | 97 +++++++++++++++++ src/Resources/Locales/en_US.axaml | 1 - src/ViewModels/Preferences.cs | 15 ++- src/Views/Preferences.axaml | 7 +- 5 files changed, 133 insertions(+), 153 deletions(-) create mode 100644 src/Models/IpcChannel.cs diff --git a/src/App.axaml.cs b/src/App.axaml.cs index b1be7072..6504e85b 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -2,14 +2,12 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.IO.Pipes; using System.Net.Http; using System.Reflection; using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using System.Linq; using Avalonia; using Avalonia.Controls; @@ -48,8 +46,6 @@ namespace SourceGit Environment.Exit(exitTodo); else if (TryLaunchAsRebaseMessageEditor(args, out int exitMessage)) Environment.Exit(exitMessage); - else if (TrySendArgsToExistingInstance(args)) - Environment.Exit(0); else BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); } @@ -81,44 +77,6 @@ namespace SourceGit return builder; } - private static bool TrySendArgsToExistingInstance(string[] args) - { - if (args == null || args.Length != 1 || !Directory.Exists(args[0])) - return false; - - var pref = ViewModels.Preferences.Instance; - - if (!pref.OpenReposInNewTab) - return false; - - try - { - var processes = Process.GetProcessesByName("SourceGit"); - - if (processes.Length <= 1) - return false; - - using var client = new NamedPipeClientStream(".", "SourceGitIPC", PipeDirection.Out); - - client.Connect(1000); - - if (client.IsConnected) - { - using var writer = new StreamWriter(client); - - writer.WriteLine(args[0]); - writer.Flush(); - - return true; - } - } - catch (Exception) - { - } - - return false; - } - private static void LogException(Exception ex) { if (ex == null) @@ -370,13 +328,7 @@ namespace SourceGit AvaloniaXamlLoader.Load(this); var pref = ViewModels.Preferences.Instance; - - pref.PropertyChanged += (s, e) => { - pref.Save(); - - if (e.PropertyName.Equals(nameof(ViewModels.Preferences.OpenReposInNewTab))) - HandleOpenReposInNewTabChanged(); - }; + pref.PropertyChanged += (_, _) => pref.Save(); SetLocale(pref.Locale); SetTheme(pref.Theme, pref.ThemeOverrides); @@ -395,7 +347,17 @@ namespace SourceGit if (TryLaunchAsAskpass(desktop)) return; - TryLaunchAsNormal(desktop); + _ipcChannel = new Models.IpcChannel(); + if (!_ipcChannel.IsFirstInstance) + { + _ipcChannel.SendToFirstInstance(desktop.Args is { Length: 1 } ? desktop.Args[0] : string.Empty); + Quit(0); + } + else + { + _ipcChannel.MessageReceived += TryOpenRepository; + TryLaunchAsNormal(desktop); + } } } #endregion @@ -533,12 +495,12 @@ namespace SourceGit if (desktop.Args != null && desktop.Args.Length == 1 && Directory.Exists(desktop.Args[0])) startupRepo = desktop.Args[0]; + var pref = ViewModels.Preferences.Instance; + pref.SetCanModify(); + _launcher = new ViewModels.Launcher(startupRepo); desktop.MainWindow = new Views.Launcher() { DataContext = _launcher }; - - var pref = ViewModels.Preferences.Instance; - - HandleOpenReposInNewTabChanged(); + desktop.Exit += (_, _) => _ipcChannel.Dispose(); #if !DISABLE_UPDATE_DETECTION if (pref.ShouldCheck4UpdateOnStartup()) @@ -546,91 +508,20 @@ namespace SourceGit #endif } - private void HandleOpenReposInNewTabChanged() + private void TryOpenRepository(string repo) { - var pref = ViewModels.Preferences.Instance; - - if (pref.OpenReposInNewTab) + if (string.IsNullOrEmpty(repo) || !Directory.Exists(repo)) + return; + + var test = new Commands.QueryRepositoryRootPath(repo).ReadToEnd(); + if (test.IsSuccess && !string.IsNullOrEmpty(test.StdOut)) { - if (_ipcServerTask == null || _ipcServerTask.IsCompleted) + Dispatcher.UIThread.Invoke(() => { - // Start IPC server - _ipcServerCts = new CancellationTokenSource(); - _ipcServerTask = Task.Run(() => StartIPCServer(_ipcServerCts.Token)); - } - } - else - { - // Stop IPC server if running - if (_ipcServerCts != null && !_ipcServerCts.IsCancellationRequested) - { - _ipcServerCts.Cancel(); - _ipcServerCts.Dispose(); - _ipcServerCts = null; - } - _ipcServerTask = null; - } - } - - private void StartIPCServer(CancellationToken cancellationToken) - { - try - { - while (!cancellationToken.IsCancellationRequested) - { - using var server = new NamedPipeServerStream("SourceGitIPC", PipeDirection.In); - - // Use WaitForConnectionAsync with cancellation token - try - { - Task connectionTask = server.WaitForConnectionAsync(cancellationToken); - connectionTask.Wait(cancellationToken); - } - catch (OperationCanceledException) - { - return; - } - catch (AggregateException ae) when (ae.InnerExceptions.Any(e => e is OperationCanceledException)) - { - return; - } - - // Process the connection - using var reader = new StreamReader(server); - var repoPath = reader.ReadLine(); - - if (!string.IsNullOrEmpty(repoPath) && Directory.Exists(repoPath)) - { - Dispatcher.UIThread.Post(() => - { - try - { - var test = new Commands.QueryRepositoryRootPath(repoPath).ReadToEnd(); - - if (test.IsSuccess && !string.IsNullOrEmpty(test.StdOut)) - { - var repoRootPath = test.StdOut.Trim(); - var pref = ViewModels.Preferences.Instance; - var node = pref.FindOrAddNodeByRepositoryPath(repoRootPath, null, false); - - ViewModels.Welcome.Instance.Refresh(); - - _launcher?.OpenRepositoryInTab(node, null); - - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop && desktop.MainWindow != null) - desktop.MainWindow.Activate(); - } - } - catch (Exception) - { - } - }); - } - } - } - catch (Exception) - { - // Pipe server failed, we can just exit the thread + var node = ViewModels.Preferences.Instance.FindOrAddNodeByRepositoryPath(test.StdOut.Trim(), null, false); + ViewModels.Welcome.Instance.Refresh(); + _launcher?.OpenRepositoryInTab(node, null); + }); } } @@ -719,11 +610,10 @@ namespace SourceGit return trimmed.Count > 0 ? string.Join(',', trimmed) : string.Empty; } + private Models.IpcChannel _ipcChannel = null; private ViewModels.Launcher _launcher = null; private ResourceDictionary _activeLocale = null; private ResourceDictionary _themeOverrides = null; private ResourceDictionary _fontsOverrides = null; - private Task _ipcServerTask = null; - private CancellationTokenSource _ipcServerCts = null; } } diff --git a/src/Models/IpcChannel.cs b/src/Models/IpcChannel.cs new file mode 100644 index 00000000..e2a34b29 --- /dev/null +++ b/src/Models/IpcChannel.cs @@ -0,0 +1,97 @@ +using System; +using System.IO; +using System.IO.Pipes; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace SourceGit.Models +{ + public class IpcChannel : IDisposable + { + public bool IsFirstInstance + { + get => _server != null; + } + + public event Action MessageReceived; + + public IpcChannel() + { + try + { + _server = new NamedPipeServerStream("SourceGitIPCChannel", PipeDirection.In, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous | PipeOptions.CurrentUserOnly); + _cancellationTokenSource = new CancellationTokenSource(); + Task.Run(StartServer); + } + catch + { + // IGNORE + } + } + + public void SendToFirstInstance(string cmd) + { + try + { + using (var client = new NamedPipeClientStream(".", "SourceGitIPCChannel", PipeDirection.Out)) + { + client.Connect(1000); + if (client.IsConnected) + { + using (var writer = new StreamWriter(client)) + { + writer.Write(Encoding.UTF8.GetBytes(cmd)); + writer.Flush(); + } + } + } + } + catch + { + // IGNORE + } + } + + public void Dispose() + { + _server?.Close(); + } + + private async void StartServer() + { + var buffer = new byte[1024]; + + while (true) + { + try + { + await _server.WaitForConnectionAsync(_cancellationTokenSource.Token); + + using (var stream = new MemoryStream()) + { + while (true) + { + var readed = await _server.ReadAsync(buffer.AsMemory(0, 1024), _cancellationTokenSource.Token); + if (readed == 0) + break; + + stream.Write(buffer, 0, readed); + } + + stream.Seek(0, SeekOrigin.Begin); + MessageReceived?.Invoke(Encoding.UTF8.GetString(stream.ToArray()).Trim()); + _server.Disconnect(); + } + } + catch + { + // IGNORE + } + } + } + + private NamedPipeServerStream _server = null; + private CancellationTokenSource _cancellationTokenSource = null; + } +} diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 123b6381..7e931998 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -752,5 +752,4 @@ Lock Remove Unlock - Open repositories in new tab instead of new window diff --git a/src/ViewModels/Preferences.cs b/src/ViewModels/Preferences.cs index d1e78d6a..9395e0a7 100644 --- a/src/ViewModels/Preferences.cs +++ b/src/ViewModels/Preferences.cs @@ -90,12 +90,6 @@ namespace SourceGit.ViewModels } } - public bool OpenReposInNewTab - { - get => _openReposInNewTab; - set => SetProperty(ref _openReposInNewTab, value); - } - public bool UseSystemWindowFrame { get => _useSystemWindowFrame; @@ -369,6 +363,11 @@ namespace SourceGit.ViewModels set => SetProperty(ref _lastCheckUpdateTime, value); } + public void SetCanModify() + { + _isReadonly = false; + } + public bool IsGitConfigured() { var path = GitInstallPath; @@ -496,7 +495,7 @@ namespace SourceGit.ViewModels public void Save() { - if (_isLoading) + if (_isLoading || _isReadonly) return; var file = Path.Combine(Native.OS.DataDir, "preference.json"); @@ -632,13 +631,13 @@ namespace SourceGit.ViewModels private static Preferences _instance = null; private static bool _isLoading = false; + private bool _isReadonly = true; private string _locale = "en_US"; private string _theme = "Default"; private string _themeOverrides = string.Empty; private string _defaultFontFamily = string.Empty; private string _monospaceFontFamily = string.Empty; private bool _onlyUseMonoFontInEditor = false; - private bool _openReposInNewTab = false; private bool _useSystemWindowFrame = false; private double _defaultFontSize = 13; private double _editorFontSize = 13; diff --git a/src/Views/Preferences.axaml b/src/Views/Preferences.axaml index 704757df..702ec20f 100644 --- a/src/Views/Preferences.axaml +++ b/src/Views/Preferences.axaml @@ -46,7 +46,7 @@ - + - - Date: Mon, 14 Apr 2025 22:05:05 +0800 Subject: [PATCH 124/571] fix: update visible staged changes retrieval in WorkingCopy (#1187) * doc: Update translation status and missing keys * fix: update visible staged changes retrieval in WorkingCopy * fix: prevent unintended amend behavior when changing current branch --------- Co-authored-by: github-actions[bot] --- TRANSLATION.md | 48 +++++++++++++++++++++++++++-------- src/ViewModels/Repository.cs | 10 +++++++- src/ViewModels/WorkingCopy.cs | 1 + 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 7ae5b13f..b4194fd9 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,7 +6,7 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-97.34%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-97.21%25-yellow)
Missing keys in de_DE.axaml @@ -31,10 +31,11 @@ This document shows the translation status of each locale file in the repository - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts - Text.WorkingCopy.Conflicts.UseMine - Text.WorkingCopy.Conflicts.UseTheirs +- Text.Preferences.General.OpenReposInNewTab
-### ![es__ES](https://img.shields.io/badge/es__ES-98.67%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-98.54%25-yellow)
Missing keys in es_ES.axaml @@ -49,10 +50,11 @@ This document shows the translation status of each locale file in the repository - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts - Text.WorkingCopy.Conflicts.UseMine - Text.WorkingCopy.Conflicts.UseTheirs +- Text.Preferences.General.OpenReposInNewTab
-### ![fr__FR](https://img.shields.io/badge/fr__FR-98.67%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-98.54%25-yellow)
Missing keys in fr_FR.axaml @@ -67,10 +69,11 @@ This document shows the translation status of each locale file in the repository - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts - Text.WorkingCopy.Conflicts.UseMine - Text.WorkingCopy.Conflicts.UseTheirs +- Text.Preferences.General.OpenReposInNewTab
-### ![it__IT](https://img.shields.io/badge/it__IT-98.41%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-98.28%25-yellow)
Missing keys in it_IT.axaml @@ -87,10 +90,11 @@ This document shows the translation status of each locale file in the repository - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts - Text.WorkingCopy.Conflicts.UseMine - Text.WorkingCopy.Conflicts.UseTheirs +- Text.Preferences.General.OpenReposInNewTab
-### ![ja__JP](https://img.shields.io/badge/ja__JP-98.41%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-98.28%25-yellow)
Missing keys in ja_JP.axaml @@ -107,10 +111,11 @@ This document shows the translation status of each locale file in the repository - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts - Text.WorkingCopy.Conflicts.UseMine - Text.WorkingCopy.Conflicts.UseTheirs +- Text.Preferences.General.OpenReposInNewTab
-### ![pt__BR](https://img.shields.io/badge/pt__BR-89.77%25-yellow) +### ![pt__BR](https://img.shields.io/badge/pt__BR-89.66%25-yellow)
Missing keys in pt_BR.axaml @@ -192,12 +197,20 @@ This document shows the translation status of each locale file in the repository - Text.WorkingCopy.Conflicts.UseMine - Text.WorkingCopy.Conflicts.UseTheirs - Text.WorkingCopy.SignOff +- Text.Preferences.General.OpenReposInNewTab
-### ![ru__RU](https://img.shields.io/badge/ru__RU-%E2%88%9A-brightgreen) +### ![ru__RU](https://img.shields.io/badge/ru__RU-99.87%25-yellow) -### ![ta__IN](https://img.shields.io/badge/ta__IN-98.67%25-yellow) +
+Missing keys in ru_RU.axaml + +- Text.Preferences.General.OpenReposInNewTab + +
+ +### ![ta__IN](https://img.shields.io/badge/ta__IN-98.54%25-yellow)
Missing keys in ta_IN.axaml @@ -212,9 +225,24 @@ This document shows the translation status of each locale file in the repository - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts - Text.WorkingCopy.Conflicts.UseMine - Text.WorkingCopy.Conflicts.UseTheirs +- Text.Preferences.General.OpenReposInNewTab
-### ![zh__CN](https://img.shields.io/badge/zh__CN-%E2%88%9A-brightgreen) +### ![zh__CN](https://img.shields.io/badge/zh__CN-99.87%25-yellow) -### ![zh__TW](https://img.shields.io/badge/zh__TW-%E2%88%9A-brightgreen) \ No newline at end of file +
+Missing keys in zh_CN.axaml + +- Text.Preferences.General.OpenReposInNewTab + +
+ +### ![zh__TW](https://img.shields.io/badge/zh__TW-99.87%25-yellow) + +
+Missing keys in zh_TW.axaml + +- Text.Preferences.General.OpenReposInNewTab + +
\ No newline at end of file diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index 9b720c7b..97d47a77 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -162,7 +162,15 @@ namespace SourceGit.ViewModels public Models.Branch CurrentBranch { get => _currentBranch; - private set => SetProperty(ref _currentBranch, value); + private set + { + var oldHead = _currentBranch?.Head; + if (SetProperty(ref _currentBranch, value)) + { + if (oldHead != _currentBranch.Head && _workingCopy is { UseAmend: true }) + _workingCopy.UseAmend = false; + } + } } public List LocalBranchTrees diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index 802c6c5d..3d7b9a28 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -94,6 +94,7 @@ namespace SourceGit.ViewModels } Staged = GetStagedChanges(); + VisibleStaged = GetVisibleChanges(_staged); SelectedStaged = []; } } From 1e0fd63543607b07664eb5083f6368ab804479e8 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Mon, 14 Apr 2025 22:07:24 +0800 Subject: [PATCH 125/571] localization: add translation sorting and formatting (#1186) * doc: Update translation status and missing keys * localization: add translation sorting and formatting --------- Co-authored-by: github-actions[bot] --- .github/workflows/localization-check.yml | 5 ++-- build/scripts/localization-check.js | 34 +++++++++++++++++++++++- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/localization-check.yml b/.github/workflows/localization-check.yml index cc5201ab..8dcd61c8 100644 --- a/.github/workflows/localization-check.yml +++ b/.github/workflows/localization-check.yml @@ -4,7 +4,6 @@ on: branches: [ develop ] paths: - 'src/Resources/Locales/**' - - 'README.md' workflow_dispatch: workflow_call: @@ -32,8 +31,8 @@ jobs: git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' if [ -n "$(git status --porcelain)" ]; then - git add README.md TRANSLATION.md - git commit -m 'doc: Update translation status and missing keys' + git add TRANSLATION.md src/Resources/Locales/*.axaml + git commit -m 'doc: Update translation status and sort locale files' git push else echo "No changes to commit" diff --git a/build/scripts/localization-check.js b/build/scripts/localization-check.js index 1e8f1f0d..fc27fd1b 100644 --- a/build/scripts/localization-check.js +++ b/build/scripts/localization-check.js @@ -14,6 +14,22 @@ async function parseXml(filePath) { return parser.parseStringPromise(data); } +async function filterAndSortTranslations(localeData, enUSKeys, enUSData) { + const strings = localeData.ResourceDictionary['x:String']; + // Remove keys that don't exist in English file + const filtered = strings.filter(item => enUSKeys.has(item.$['x:Key'])); + + // Sort based on the key order in English file + const enUSKeysArray = enUSData.ResourceDictionary['x:String'].map(item => item.$['x:Key']); + filtered.sort((a, b) => { + const aIndex = enUSKeysArray.indexOf(a.$['x:Key']); + const bIndex = enUSKeysArray.indexOf(b.$['x:Key']); + return aIndex - bIndex; + }); + + return filtered; +} + async function calculateTranslationRate() { const enUSData = await parseXml(enUSFile); const enUSKeys = new Set(enUSData.ResourceDictionary['x:String'].map(item => item.$['x:Key'])); @@ -33,6 +49,22 @@ async function calculateTranslationRate() { const localeKeys = new Set(localeData.ResourceDictionary['x:String'].map(item => item.$['x:Key'])); const missingKeys = [...enUSKeys].filter(key => !localeKeys.has(key)); + // Sort and clean up extra translations + const sortedAndCleaned = await filterAndSortTranslations(localeData, enUSKeys, enUSData); + localeData.ResourceDictionary['x:String'] = sortedAndCleaned; + + // Save the updated file + const builder = new xml2js.Builder({ + headless: true, + renderOpts: { pretty: true, indent: ' ' } + }); + let xmlStr = builder.buildObject(localeData); + + // Add an empty line before the first x:String + xmlStr = xmlStr.replace(' 0) { const progress = ((enUSKeys.size - missingKeys.length) / enUSKeys.size) * 100; const badgeColor = progress >= 75 ? 'yellow' : 'red'; @@ -41,7 +73,7 @@ async function calculateTranslationRate() { lines.push(`
\nMissing keys in ${file}\n\n${missingKeys.map(key => `- ${key}`).join('\n')}\n\n
`) } else { lines.push(`### ![${locale}](https://img.shields.io/badge/${locale}-%E2%88%9A-brightgreen)`); - } + } } const content = lines.join('\n\n'); From e5dc211c35cb2a0d72a0d8910dee1c2dd06e9df6 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 14 Apr 2025 22:24:48 +0800 Subject: [PATCH 126/571] refactor: simpfy IPC code Signed-off-by: leo --- src/Models/IpcChannel.cs | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/src/Models/IpcChannel.cs b/src/Models/IpcChannel.cs index e2a34b29..9a9e0315 100644 --- a/src/Models/IpcChannel.cs +++ b/src/Models/IpcChannel.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.IO.Pipes; -using System.Text; using System.Threading; using System.Threading.Tasks; @@ -41,7 +40,7 @@ namespace SourceGit.Models { using (var writer = new StreamWriter(client)) { - writer.Write(Encoding.UTF8.GetBytes(cmd)); + writer.WriteLine(cmd); writer.Flush(); } } @@ -55,34 +54,22 @@ namespace SourceGit.Models public void Dispose() { - _server?.Close(); + _cancellationTokenSource?.Cancel(); } private async void StartServer() { - var buffer = new byte[1024]; + using var reader = new StreamReader(_server); - while (true) + while (!_cancellationTokenSource.IsCancellationRequested) { try { await _server.WaitForConnectionAsync(_cancellationTokenSource.Token); - - using (var stream = new MemoryStream()) - { - while (true) - { - var readed = await _server.ReadAsync(buffer.AsMemory(0, 1024), _cancellationTokenSource.Token); - if (readed == 0) - break; - - stream.Write(buffer, 0, readed); - } - - stream.Seek(0, SeekOrigin.Begin); - MessageReceived?.Invoke(Encoding.UTF8.GetString(stream.ToArray()).Trim()); - _server.Disconnect(); - } + + var line = (await reader.ReadLineAsync(_cancellationTokenSource.Token))?.Trim(); + MessageReceived?.Invoke(line); + _server.Disconnect(); } catch { From 05982e6dc0df4784c8c3863b6b08c45eb1f87fc2 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 14 Apr 2025 23:23:40 +0800 Subject: [PATCH 127/571] style: re-design style for disabled primary button Signed-off-by: leo --- src/Resources/Styles.axaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index 38321356..391b9523 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -499,6 +499,12 @@ + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ diff --git a/src/Views/ViewLogs.axaml.cs b/src/Views/ViewLogs.axaml.cs new file mode 100644 index 00000000..624ff21e --- /dev/null +++ b/src/Views/ViewLogs.axaml.cs @@ -0,0 +1,108 @@ +using System; +using System.ComponentModel; + +using Avalonia; +using Avalonia.Controls; +using Avalonia.Controls.Primitives; +using Avalonia.Interactivity; + +using AvaloniaEdit; +using AvaloniaEdit.Document; +using AvaloniaEdit.Editing; +using AvaloniaEdit.TextMate; + +namespace SourceGit.Views +{ + public class LogContentPresenter : TextEditor + { + public static readonly StyledProperty LogProperty = + AvaloniaProperty.Register(nameof(Log)); + + public ViewModels.CommandLog Log + { + get => GetValue(LogProperty); + set => SetValue(LogProperty, value); + } + + protected override Type StyleKeyOverride => typeof(TextEditor); + + public LogContentPresenter() : base(new TextArea(), new TextDocument()) + { + IsReadOnly = true; + ShowLineNumbers = false; + WordWrap = false; + HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; + VerticalScrollBarVisibility = ScrollBarVisibility.Auto; + + TextArea.TextView.Margin = new Thickness(4, 0); + TextArea.TextView.Options.EnableHyperlinks = true; + TextArea.TextView.Options.EnableEmailHyperlinks = true; + } + + protected override void OnLoaded(RoutedEventArgs e) + { + base.OnLoaded(e); + + if (_textMate == null) + { + _textMate = Models.TextMateHelper.CreateForEditor(this); + Models.TextMateHelper.SetGrammarByFileName(_textMate, "Log.log"); + } + } + + protected override void OnUnloaded(RoutedEventArgs e) + { + base.OnUnloaded(e); + + if (_textMate != null) + { + _textMate.Dispose(); + _textMate = null; + } + + GC.Collect(); + } + + protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) + { + base.OnPropertyChanged(change); + + if (change.Property == LogProperty) + { + if (change.NewValue is ViewModels.CommandLog log) + { + Text = log.Content; + log.Register(OnLogLineReceived); + } + else + { + Text = string.Empty; + } + } + } + + private void OnLogLineReceived(string newline) + { + AppendText("\n"); + AppendText(newline); + } + + private TextMate.Installation _textMate = null; + } + + public partial class ViewLogs : ChromelessWindow + { + public ViewLogs() + { + InitializeComponent(); + } + + private void OnRemoveLog(object sender, RoutedEventArgs e) + { + if (sender is Button { DataContext: ViewModels.CommandLog log } && DataContext is ViewModels.ViewLogs vm) + vm.Logs.Remove(log); + + e.Handled = true; + } + } +} From c23177229836cf9329bb40f9048e2b7a0c8e922d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 17 Apr 2025 05:24:26 +0000 Subject: [PATCH 153/571] doc: Update translation status and sort locale files --- TRANSLATION.md | 36 +++++++++++++++++++++++-------- src/Resources/Locales/zh_CN.axaml | 2 +- src/Resources/Locales/zh_TW.axaml | 2 +- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index d942a328..e2535903 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,7 +6,7 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-97.21%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-96.96%25-yellow)
Missing keys in de_DE.axaml @@ -26,7 +26,9 @@ This document shows the translation status of each locale file in the repository - Text.Preferences.AI.Streaming - Text.Preferences.Appearance.EditorTabWidth - Text.Preferences.General.ShowTagsInGraph +- Text.Repository.ViewLogs - Text.StashCM.SaveAsPatch +- Text.ViewLogs - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts @@ -35,7 +37,7 @@ This document shows the translation status of each locale file in the repository
-### ![es__ES](https://img.shields.io/badge/es__ES-98.54%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-98.28%25-yellow)
Missing keys in es_ES.axaml @@ -46,6 +48,8 @@ This document shows the translation status of each locale file in the repository - Text.ConfirmEmptyCommit.NoLocalChanges - Text.ConfirmEmptyCommit.StageAllThenCommit - Text.ConfirmEmptyCommit.WithLocalChanges +- Text.Repository.ViewLogs +- Text.ViewLogs - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts @@ -54,7 +58,7 @@ This document shows the translation status of each locale file in the repository
-### ![fr__FR](https://img.shields.io/badge/fr__FR-98.54%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-98.28%25-yellow)
Missing keys in fr_FR.axaml @@ -65,6 +69,8 @@ This document shows the translation status of each locale file in the repository - Text.ConfirmEmptyCommit.NoLocalChanges - Text.ConfirmEmptyCommit.StageAllThenCommit - Text.ConfirmEmptyCommit.WithLocalChanges +- Text.Repository.ViewLogs +- Text.ViewLogs - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts @@ -73,7 +79,7 @@ This document shows the translation status of each locale file in the repository
-### ![it__IT](https://img.shields.io/badge/it__IT-98.28%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-98.02%25-yellow)
Missing keys in it_IT.axaml @@ -86,6 +92,8 @@ This document shows the translation status of each locale file in the repository - Text.ConfirmEmptyCommit.WithLocalChanges - Text.CopyFullPath - Text.Preferences.General.ShowTagsInGraph +- Text.Repository.ViewLogs +- Text.ViewLogs - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts @@ -94,7 +102,7 @@ This document shows the translation status of each locale file in the repository
-### ![ja__JP](https://img.shields.io/badge/ja__JP-98.28%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-98.02%25-yellow)
Missing keys in ja_JP.axaml @@ -107,6 +115,8 @@ This document shows the translation status of each locale file in the repository - Text.ConfirmEmptyCommit.WithLocalChanges - Text.Repository.FilterCommits - Text.Repository.Tags.OrderByNameDes +- Text.Repository.ViewLogs +- Text.ViewLogs - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts @@ -115,7 +125,7 @@ This document shows the translation status of each locale file in the repository
-### ![pt__BR](https://img.shields.io/badge/pt__BR-89.66%25-yellow) +### ![pt__BR](https://img.shields.io/badge/pt__BR-89.42%25-yellow)
Missing keys in pt_BR.axaml @@ -183,6 +193,7 @@ This document shows the translation status of each locale file in the repository - Text.Repository.Tags.OrderByNameDes - Text.Repository.Tags.Sort - Text.Repository.UseRelativeTimeInHistories +- Text.Repository.ViewLogs - Text.SetUpstream - Text.SetUpstream.Local - Text.SetUpstream.Unset @@ -191,6 +202,7 @@ This document shows the translation status of each locale file in the repository - Text.Stash.AutoRestore - Text.Stash.AutoRestore.Tip - Text.StashCM.SaveAsPatch +- Text.ViewLogs - Text.WorkingCopy.CommitToEdit - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool @@ -201,16 +213,18 @@ This document shows the translation status of each locale file in the repository
-### ![ru__RU](https://img.shields.io/badge/ru__RU-99.87%25-yellow) +### ![ru__RU](https://img.shields.io/badge/ru__RU-99.60%25-yellow)
Missing keys in ru_RU.axaml - Text.CommitMessageTextBox.SubjectCount +- Text.Repository.ViewLogs +- Text.ViewLogs
-### ![ta__IN](https://img.shields.io/badge/ta__IN-98.54%25-yellow) +### ![ta__IN](https://img.shields.io/badge/ta__IN-98.28%25-yellow)
Missing keys in ta_IN.axaml @@ -221,7 +235,9 @@ This document shows the translation status of each locale file in the repository - Text.ConfirmEmptyCommit.NoLocalChanges - Text.ConfirmEmptyCommit.StageAllThenCommit - Text.ConfirmEmptyCommit.WithLocalChanges +- Text.Repository.ViewLogs - Text.UpdateSubmodules.Target +- Text.ViewLogs - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts - Text.WorkingCopy.Conflicts.UseMine @@ -229,13 +245,15 @@ This document shows the translation status of each locale file in the repository
-### ![uk__UA](https://img.shields.io/badge/uk__UA-99.73%25-yellow) +### ![uk__UA](https://img.shields.io/badge/uk__UA-99.47%25-yellow)
Missing keys in uk_UA.axaml - Text.CommitMessageTextBox.SubjectCount - Text.ConfigureWorkspace.Name +- Text.Repository.ViewLogs +- Text.ViewLogs
diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index a4d33601..cb99d6f0 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -759,4 +759,4 @@ 锁定工作树 移除工作树 解除工作树锁定 - + \ No newline at end of file diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 581f25f2..2fa67983 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -759,4 +759,4 @@ 鎖定工作區 移除工作區 解除鎖定工作區 - + \ No newline at end of file From 0e967ffc8e28a361d3bc4a48a1f72e38a58897c7 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 13:30:25 +0800 Subject: [PATCH 154/571] fix: pressing `Alt+Enter` to commit and push in a repository that has no remotes will crash (#1205) Signed-off-by: leo --- src/ViewModels/WorkingCopy.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index 60b8fd11..10544970 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -1735,7 +1735,7 @@ namespace SourceGit.ViewModels CommitMessage = string.Empty; UseAmend = false; - if (autoPush) + if (autoPush && _repo.Remotes.Count > 0) _repo.ShowAndStartPopup(new Push(_repo, null)); } From 33ae6a998959bc63aa8796f10bdd4c705e7c021b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20J=2E=20Mart=C3=ADnez=20M=2E?= <56406225+jjesus-dev@users.noreply.github.com> Date: Wed, 16 Apr 2025 23:34:27 -0600 Subject: [PATCH 155/571] localization: update spanish translations (#1206) add missing translations modify instances of `stagear` with `hacer stage` --- src/Resources/Locales/es_ES.axaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index d4d442b0..ff6d02f7 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -136,6 +136,7 @@ SHA Abrir en Navegador Descripción + ASUNTO Introducir asunto del commit Configurar Repositorio PLANTILLA DE COMMIT @@ -157,6 +158,7 @@ Fetch remotos automáticamente Minuto(s) Remoto por Defecto + Modo preferido de Merge SEGUIMIENTO DE INCIDENCIAS Añadir Regla de Ejemplo para Azure DevOps Añadir Regla de Ejemplo para Incidencias de Gitee @@ -181,6 +183,10 @@ Color Nombre Restaurar pestañas al iniciar + CONTINUAR + ¡Commit vacío detectado! ¿Quieres continuar (--allow-empty)? + HACER STAGE A TODO & COMMIT + ¡Commit vacío detectado! ¿Quieres continuar (--allow-empty) o hacer stage a todo y después commit? Asistente de Commit Convencional Cambio Importante: Incidencia Cerrada: @@ -717,15 +723,20 @@ Ignorar archivos en la misma carpeta Ignorar solo este archivo Enmendar - Puedes stagear este archivo ahora. + Puedes hacer stage a este archivo ahora. COMMIT COMMIT & PUSH Plantilla/Historias Activar evento de clic Commit (Editar) - Stagear todos los cambios y commit + Hacer stage a todos los cambios y commit + Tienes {0} archivo(s) en stage, pero solo {1} archivo(s) mostrado(s) ({2} archivo(s) están filtrados). ¿Quieres continuar? CONFLICTOS DETECTADOS + ABRIR HERRAMIENTA DE MERGE EXTERNA + ABRIR TODOS LOS CONFLICTOS EN HERRAMIENTA DE MERGE EXTERNA LOS CONFLICTOS DE ARCHIVOS ESTÁN RESUELTOS + USAR MÍOS + USAR SUYOS INCLUIR ARCHIVOS NO RASTREADOS NO HAY MENSAJES DE ENTRADA RECIENTES NO HAY PLANTILLAS DE COMMIT From 2a43efde07864bdfac359757cfcf1d17fe3f3e9d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 17 Apr 2025 05:34:40 +0000 Subject: [PATCH 156/571] doc: Update translation status and sort locale files --- TRANSLATION.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index e2535903..62fe960f 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -37,24 +37,13 @@ This document shows the translation status of each locale file in the repository
-### ![es__ES](https://img.shields.io/badge/es__ES-98.28%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-99.74%25-yellow)
Missing keys in es_ES.axaml -- Text.CommitMessageTextBox.SubjectCount -- Text.Configure.Git.PreferredMergeMode -- Text.ConfirmEmptyCommit.Continue -- Text.ConfirmEmptyCommit.NoLocalChanges -- Text.ConfirmEmptyCommit.StageAllThenCommit -- Text.ConfirmEmptyCommit.WithLocalChanges - Text.Repository.ViewLogs - Text.ViewLogs -- Text.WorkingCopy.ConfirmCommitWithFilter -- Text.WorkingCopy.Conflicts.OpenExternalMergeTool -- Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts -- Text.WorkingCopy.Conflicts.UseMine -- Text.WorkingCopy.Conflicts.UseTheirs
From c1e31ac4e3a1a7ca062761c50533de65d455e692 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 15:48:02 +0800 Subject: [PATCH 157/571] ci: try to remove zlib1g-dev:arm64 Signed-off-by: leo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcb32580..12792cf6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,7 +58,7 @@ jobs: if: ${{ matrix.runtime == 'linux-arm64' }} run: | sudo apt-get update - sudo apt-get install -y llvm gcc-aarch64-linux-gnu zlib1g-dev:arm64 + sudo apt-get install -y llvm gcc-aarch64-linux-gnu - name: Build run: dotnet build -c Release - name: Publish From 021aab84087fd348a56283fda640caa9c89ec054 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 16:07:40 +0800 Subject: [PATCH 158/571] enhance: add a button to clear all git command logs Signed-off-by: leo --- build/scripts/localization-check.js | 3 +-- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 3 ++- src/Resources/Locales/zh_TW.axaml | 3 ++- src/ViewModels/ViewLogs.cs | 6 ++++++ src/Views/ViewLogs.axaml | 11 ++++++++++- 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/build/scripts/localization-check.js b/build/scripts/localization-check.js index fc27fd1b..8d636b5b 100644 --- a/build/scripts/localization-check.js +++ b/build/scripts/localization-check.js @@ -62,8 +62,7 @@ async function calculateTranslationRate() { // Add an empty line before the first x:String xmlStr = xmlStr.replace(' 0) { const progress = ((enUSKeys.size - missingKeys.length) / enUSKeys.size) * 100; diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 5d1bb7e1..1e92ae38 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -699,6 +699,7 @@ Use --remote option URL: Logs + CLEAR ALL Warning Welcome Page Create Group diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index cb99d6f0..0471285f 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -703,6 +703,7 @@ 启用 '--remote' 仓库地址 : 日志列表 + 清空日志 警告 起始页 新建分组 @@ -759,4 +760,4 @@ 锁定工作树 移除工作树 解除工作树锁定 - \ No newline at end of file + diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 2fa67983..edd8cf8c 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -703,6 +703,7 @@ 啟用 [--remote] 選項 存放庫網址: 日誌清單 + 清除所有日誌 警告 起始頁 新增群組 @@ -759,4 +760,4 @@ 鎖定工作區 移除工作區 解除鎖定工作區 - \ No newline at end of file + diff --git a/src/ViewModels/ViewLogs.cs b/src/ViewModels/ViewLogs.cs index 44c819ce..21ab81ab 100644 --- a/src/ViewModels/ViewLogs.cs +++ b/src/ViewModels/ViewLogs.cs @@ -21,6 +21,12 @@ namespace SourceGit.ViewModels _repo = repo; } + public void ClearAll() + { + SelectedLog = null; + Logs.Clear(); + } + private Repository _repo = null; private CommandLog _selectedLog = null; } diff --git a/src/Views/ViewLogs.axaml b/src/Views/ViewLogs.axaml index 8272078d..125caa22 100644 --- a/src/Views/ViewLogs.axaml +++ b/src/Views/ViewLogs.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.ViewLogs" x:DataType="vm:ViewLogs" @@ -13,7 +14,7 @@ Width="800" Height="500" CanResize="False" WindowStartupLocation="CenterOwner"> - + + + +
diff --git a/src/Views/ViewLogs.axaml.cs b/src/Views/ViewLogs.axaml.cs index 624ff21e..62bf288d 100644 --- a/src/Views/ViewLogs.axaml.cs +++ b/src/Views/ViewLogs.axaml.cs @@ -97,10 +97,33 @@ namespace SourceGit.Views InitializeComponent(); } - private void OnRemoveLog(object sender, RoutedEventArgs e) + private void OnLogContextRequested(object sender, ContextRequestedEventArgs e) { - if (sender is Button { DataContext: ViewModels.CommandLog log } && DataContext is ViewModels.ViewLogs vm) + if (sender is not Grid { DataContext: ViewModels.CommandLog log } grid || DataContext is not ViewModels.ViewLogs vm) + return; + + var copy = new MenuItem(); + copy.Header = App.Text("ViewLogs.CopyLog"); + copy.Icon = App.CreateMenuIcon("Icons.Copy"); + copy.Click += (_, ev) => + { + App.CopyText(log.Content); + ev.Handled = true; + }; + + var rm = new MenuItem(); + rm.Header = App.Text("ViewLogs.Delete"); + rm.Icon = App.CreateMenuIcon("Icons.Clear"); + rm.Click += (_, ev) => + { vm.Logs.Remove(log); + ev.Handled = true; + }; + + var menu = new ContextMenu(); + menu.Items.Add(copy); + menu.Items.Add(rm); + menu.Open(grid); e.Handled = true; } From a06d1183d76049bd7df1e6136025895dddbe1655 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 17 Apr 2025 08:32:08 +0000 Subject: [PATCH 161/571] doc: Update translation status and sort locale files --- TRANSLATION.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 5e316750..4f13d26a 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,7 +6,7 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-96.83%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-96.57%25-yellow)
Missing keys in de_DE.axaml @@ -30,6 +30,8 @@ This document shows the translation status of each locale file in the repository - Text.StashCM.SaveAsPatch - Text.ViewLogs - Text.ViewLogs.Clear +- Text.ViewLogs.CopyLog +- Text.ViewLogs.Delete - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts @@ -38,7 +40,7 @@ This document shows the translation status of each locale file in the repository
-### ![es__ES](https://img.shields.io/badge/es__ES-99.60%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-99.34%25-yellow)
Missing keys in es_ES.axaml @@ -46,10 +48,12 @@ This document shows the translation status of each locale file in the repository - Text.Repository.ViewLogs - Text.ViewLogs - Text.ViewLogs.Clear +- Text.ViewLogs.CopyLog +- Text.ViewLogs.Delete
-### ![fr__FR](https://img.shields.io/badge/fr__FR-98.15%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-97.89%25-yellow)
Missing keys in fr_FR.axaml @@ -63,6 +67,8 @@ This document shows the translation status of each locale file in the repository - Text.Repository.ViewLogs - Text.ViewLogs - Text.ViewLogs.Clear +- Text.ViewLogs.CopyLog +- Text.ViewLogs.Delete - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts @@ -71,7 +77,7 @@ This document shows the translation status of each locale file in the repository
-### ![it__IT](https://img.shields.io/badge/it__IT-97.89%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-97.63%25-yellow)
Missing keys in it_IT.axaml @@ -87,6 +93,8 @@ This document shows the translation status of each locale file in the repository - Text.Repository.ViewLogs - Text.ViewLogs - Text.ViewLogs.Clear +- Text.ViewLogs.CopyLog +- Text.ViewLogs.Delete - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts @@ -95,7 +103,7 @@ This document shows the translation status of each locale file in the repository
-### ![ja__JP](https://img.shields.io/badge/ja__JP-97.89%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-97.63%25-yellow)
Missing keys in ja_JP.axaml @@ -111,6 +119,8 @@ This document shows the translation status of each locale file in the repository - Text.Repository.ViewLogs - Text.ViewLogs - Text.ViewLogs.Clear +- Text.ViewLogs.CopyLog +- Text.ViewLogs.Delete - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts @@ -119,7 +129,7 @@ This document shows the translation status of each locale file in the repository
-### ![pt__BR](https://img.shields.io/badge/pt__BR-89.30%25-yellow) +### ![pt__BR](https://img.shields.io/badge/pt__BR-89.06%25-yellow)
Missing keys in pt_BR.axaml @@ -198,6 +208,8 @@ This document shows the translation status of each locale file in the repository - Text.StashCM.SaveAsPatch - Text.ViewLogs - Text.ViewLogs.Clear +- Text.ViewLogs.CopyLog +- Text.ViewLogs.Delete - Text.WorkingCopy.CommitToEdit - Text.WorkingCopy.ConfirmCommitWithFilter - Text.WorkingCopy.Conflicts.OpenExternalMergeTool @@ -208,7 +220,7 @@ This document shows the translation status of each locale file in the repository
-### ![ru__RU](https://img.shields.io/badge/ru__RU-99.47%25-yellow) +### ![ru__RU](https://img.shields.io/badge/ru__RU-99.21%25-yellow)
Missing keys in ru_RU.axaml @@ -217,10 +229,12 @@ This document shows the translation status of each locale file in the repository - Text.Repository.ViewLogs - Text.ViewLogs - Text.ViewLogs.Clear +- Text.ViewLogs.CopyLog +- Text.ViewLogs.Delete
-### ![ta__IN](https://img.shields.io/badge/ta__IN-98.15%25-yellow) +### ![ta__IN](https://img.shields.io/badge/ta__IN-97.89%25-yellow)
Missing keys in ta_IN.axaml @@ -235,6 +249,8 @@ This document shows the translation status of each locale file in the repository - Text.UpdateSubmodules.Target - Text.ViewLogs - Text.ViewLogs.Clear +- Text.ViewLogs.CopyLog +- Text.ViewLogs.Delete - Text.WorkingCopy.Conflicts.OpenExternalMergeTool - Text.WorkingCopy.Conflicts.OpenExternalMergeToolAllConflicts - Text.WorkingCopy.Conflicts.UseMine @@ -242,7 +258,7 @@ This document shows the translation status of each locale file in the repository
-### ![uk__UA](https://img.shields.io/badge/uk__UA-99.34%25-yellow) +### ![uk__UA](https://img.shields.io/badge/uk__UA-99.08%25-yellow)
Missing keys in uk_UA.axaml @@ -252,6 +268,8 @@ This document shows the translation status of each locale file in the repository - Text.Repository.ViewLogs - Text.ViewLogs - Text.ViewLogs.Clear +- Text.ViewLogs.CopyLog +- Text.ViewLogs.Delete
From 104a3f0bbf762063cadb7d97119f0e50139243db Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 16:35:18 +0800 Subject: [PATCH 162/571] code_style: run `dotnet format` Signed-off-by: leo --- src/Commands/QueryLocalChanges.cs | 226 +++++++++++++++--------------- src/ViewModels/CommandLog.cs | 2 +- src/Views/TextDiffView.axaml.cs | 2 +- src/Views/ViewLogs.axaml.cs | 1 - 4 files changed, 115 insertions(+), 116 deletions(-) diff --git a/src/Commands/QueryLocalChanges.cs b/src/Commands/QueryLocalChanges.cs index e85e79c9..4e626a79 100644 --- a/src/Commands/QueryLocalChanges.cs +++ b/src/Commands/QueryLocalChanges.cs @@ -36,119 +36,119 @@ namespace SourceGit.Commands switch (status) { - case " M": - change.Set(Models.ChangeState.None, Models.ChangeState.Modified); - break; - case " T": - change.Set(Models.ChangeState.None, Models.ChangeState.TypeChanged); - break; - case " A": - change.Set(Models.ChangeState.None, Models.ChangeState.Added); - break; - case " D": - change.Set(Models.ChangeState.None, Models.ChangeState.Deleted); - break; - case " R": - change.Set(Models.ChangeState.None, Models.ChangeState.Renamed); - break; - case " C": - change.Set(Models.ChangeState.None, Models.ChangeState.Copied); - break; - case "M": - change.Set(Models.ChangeState.Modified); - break; - case "MM": - change.Set(Models.ChangeState.Modified, Models.ChangeState.Modified); - break; - case "MT": - change.Set(Models.ChangeState.Modified, Models.ChangeState.TypeChanged); - break; - case "MD": - change.Set(Models.ChangeState.Modified, Models.ChangeState.Deleted); - break; - case "T": - change.Set(Models.ChangeState.TypeChanged); - break; - case "TM": - change.Set(Models.ChangeState.TypeChanged, Models.ChangeState.Modified); - break; - case "TT": - change.Set(Models.ChangeState.TypeChanged, Models.ChangeState.TypeChanged); - break; - case "TD": - change.Set(Models.ChangeState.TypeChanged, Models.ChangeState.Deleted); - break; - case "A": - change.Set(Models.ChangeState.Added); - break; - case "AM": - change.Set(Models.ChangeState.Added, Models.ChangeState.Modified); - break; - case "AT": - change.Set(Models.ChangeState.Added, Models.ChangeState.TypeChanged); - break; - case "AD": - change.Set(Models.ChangeState.Added, Models.ChangeState.Deleted); - break; - case "D": - change.Set(Models.ChangeState.Deleted); - break; - case "R": - change.Set(Models.ChangeState.Renamed); - break; - case "RM": - change.Set(Models.ChangeState.Renamed, Models.ChangeState.Modified); - break; - case "RT": - change.Set(Models.ChangeState.Renamed, Models.ChangeState.TypeChanged); - break; - case "RD": - change.Set(Models.ChangeState.Renamed, Models.ChangeState.Deleted); - break; - case "C": - change.Set(Models.ChangeState.Copied); - break; - case "CM": - change.Set(Models.ChangeState.Copied, Models.ChangeState.Modified); - break; - case "CT": - change.Set(Models.ChangeState.Copied, Models.ChangeState.TypeChanged); - break; - case "CD": - change.Set(Models.ChangeState.Copied, Models.ChangeState.Deleted); - break; - case "DR": - change.Set(Models.ChangeState.Deleted, Models.ChangeState.Renamed); - break; - case "DC": - change.Set(Models.ChangeState.Deleted, Models.ChangeState.Copied); - break; - case "DD": - change.Set(Models.ChangeState.Deleted, Models.ChangeState.Deleted); - break; - case "AU": - change.Set(Models.ChangeState.Added, Models.ChangeState.Unmerged); - break; - case "UD": - change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Deleted); - break; - case "UA": - change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Added); - break; - case "DU": - change.Set(Models.ChangeState.Deleted, Models.ChangeState.Unmerged); - break; - case "AA": - change.Set(Models.ChangeState.Added, Models.ChangeState.Added); - break; - case "UU": - change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Unmerged); - break; - case "??": - change.Set(Models.ChangeState.Untracked, Models.ChangeState.Untracked); - break; - default: - break; + case " M": + change.Set(Models.ChangeState.None, Models.ChangeState.Modified); + break; + case " T": + change.Set(Models.ChangeState.None, Models.ChangeState.TypeChanged); + break; + case " A": + change.Set(Models.ChangeState.None, Models.ChangeState.Added); + break; + case " D": + change.Set(Models.ChangeState.None, Models.ChangeState.Deleted); + break; + case " R": + change.Set(Models.ChangeState.None, Models.ChangeState.Renamed); + break; + case " C": + change.Set(Models.ChangeState.None, Models.ChangeState.Copied); + break; + case "M": + change.Set(Models.ChangeState.Modified); + break; + case "MM": + change.Set(Models.ChangeState.Modified, Models.ChangeState.Modified); + break; + case "MT": + change.Set(Models.ChangeState.Modified, Models.ChangeState.TypeChanged); + break; + case "MD": + change.Set(Models.ChangeState.Modified, Models.ChangeState.Deleted); + break; + case "T": + change.Set(Models.ChangeState.TypeChanged); + break; + case "TM": + change.Set(Models.ChangeState.TypeChanged, Models.ChangeState.Modified); + break; + case "TT": + change.Set(Models.ChangeState.TypeChanged, Models.ChangeState.TypeChanged); + break; + case "TD": + change.Set(Models.ChangeState.TypeChanged, Models.ChangeState.Deleted); + break; + case "A": + change.Set(Models.ChangeState.Added); + break; + case "AM": + change.Set(Models.ChangeState.Added, Models.ChangeState.Modified); + break; + case "AT": + change.Set(Models.ChangeState.Added, Models.ChangeState.TypeChanged); + break; + case "AD": + change.Set(Models.ChangeState.Added, Models.ChangeState.Deleted); + break; + case "D": + change.Set(Models.ChangeState.Deleted); + break; + case "R": + change.Set(Models.ChangeState.Renamed); + break; + case "RM": + change.Set(Models.ChangeState.Renamed, Models.ChangeState.Modified); + break; + case "RT": + change.Set(Models.ChangeState.Renamed, Models.ChangeState.TypeChanged); + break; + case "RD": + change.Set(Models.ChangeState.Renamed, Models.ChangeState.Deleted); + break; + case "C": + change.Set(Models.ChangeState.Copied); + break; + case "CM": + change.Set(Models.ChangeState.Copied, Models.ChangeState.Modified); + break; + case "CT": + change.Set(Models.ChangeState.Copied, Models.ChangeState.TypeChanged); + break; + case "CD": + change.Set(Models.ChangeState.Copied, Models.ChangeState.Deleted); + break; + case "DR": + change.Set(Models.ChangeState.Deleted, Models.ChangeState.Renamed); + break; + case "DC": + change.Set(Models.ChangeState.Deleted, Models.ChangeState.Copied); + break; + case "DD": + change.Set(Models.ChangeState.Deleted, Models.ChangeState.Deleted); + break; + case "AU": + change.Set(Models.ChangeState.Added, Models.ChangeState.Unmerged); + break; + case "UD": + change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Deleted); + break; + case "UA": + change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Added); + break; + case "DU": + change.Set(Models.ChangeState.Deleted, Models.ChangeState.Unmerged); + break; + case "AA": + change.Set(Models.ChangeState.Added, Models.ChangeState.Added); + break; + case "UU": + change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Unmerged); + break; + case "??": + change.Set(Models.ChangeState.Untracked, Models.ChangeState.Untracked); + break; + default: + break; } if (change.Index != Models.ChangeState.None || change.WorkTree != Models.ChangeState.None) diff --git a/src/ViewModels/CommandLog.cs b/src/ViewModels/CommandLog.cs index e10aa724..a677d0be 100644 --- a/src/ViewModels/CommandLog.cs +++ b/src/ViewModels/CommandLog.cs @@ -82,6 +82,6 @@ namespace SourceGit.ViewModels private string _content = string.Empty; private StringBuilder _builder = new StringBuilder(); - private event Action _onNewLineReceived; + private event Action _onNewLineReceived; } } diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 722d6912..ad2f8cea 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -1261,7 +1261,7 @@ namespace SourceGit.Views if (line.NoNewLineEndOfFile) builder.Append("\u26D4"); - + builder.Append('\n'); } diff --git a/src/Views/ViewLogs.axaml.cs b/src/Views/ViewLogs.axaml.cs index 62bf288d..107341ab 100644 --- a/src/Views/ViewLogs.axaml.cs +++ b/src/Views/ViewLogs.axaml.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel; using Avalonia; using Avalonia.Controls; From 3358ff9aee18918c67cdbf3fb7055ccb43b9fd35 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 17:24:56 +0800 Subject: [PATCH 163/571] enhance: disable hyper link and email link in git command logs Signed-off-by: leo --- src/Views/ViewLogs.axaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Views/ViewLogs.axaml.cs b/src/Views/ViewLogs.axaml.cs index 107341ab..dcfc3dc9 100644 --- a/src/Views/ViewLogs.axaml.cs +++ b/src/Views/ViewLogs.axaml.cs @@ -34,8 +34,8 @@ namespace SourceGit.Views VerticalScrollBarVisibility = ScrollBarVisibility.Auto; TextArea.TextView.Margin = new Thickness(4, 0); - TextArea.TextView.Options.EnableHyperlinks = true; - TextArea.TextView.Options.EnableEmailHyperlinks = true; + TextArea.TextView.Options.EnableHyperlinks = false; + TextArea.TextView.Options.EnableEmailHyperlinks = false; } protected override void OnLoaded(RoutedEventArgs e) From 231010abc666c1d3e0bb2cc36e0da4cf207b633d Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 17:45:49 +0800 Subject: [PATCH 164/571] ux: custom style for command line in git command log Signed-off-by: leo --- src/Views/ViewLogs.axaml.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Views/ViewLogs.axaml.cs b/src/Views/ViewLogs.axaml.cs index dcfc3dc9..8a3426d2 100644 --- a/src/Views/ViewLogs.axaml.cs +++ b/src/Views/ViewLogs.axaml.cs @@ -4,16 +4,39 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Controls.Primitives; using Avalonia.Interactivity; +using Avalonia.Media; using AvaloniaEdit; using AvaloniaEdit.Document; using AvaloniaEdit.Editing; +using AvaloniaEdit.Rendering; using AvaloniaEdit.TextMate; namespace SourceGit.Views { public class LogContentPresenter : TextEditor { + public class LineStyleTransformer : DocumentColorizingTransformer + { + protected override void ColorizeLine(DocumentLine line) + { + var content = CurrentContext.Document.GetText(line); + if (content.StartsWith("$ git ", StringComparison.Ordinal)) + { + ChangeLinePart(line.Offset, line.Offset + 1, v => + { + v.TextRunProperties.SetForegroundBrush(Brushes.Orange); + }); + + ChangeLinePart(line.Offset + 2, line.EndOffset, v => + { + var old = v.TextRunProperties.Typeface; + v.TextRunProperties.SetTypeface(new Typeface(old.FontFamily, old.Style, FontWeight.Bold)); + }); + } + } + } + public static readonly StyledProperty LogProperty = AvaloniaProperty.Register(nameof(Log)); @@ -46,6 +69,7 @@ namespace SourceGit.Views { _textMate = Models.TextMateHelper.CreateForEditor(this); Models.TextMateHelper.SetGrammarByFileName(_textMate, "Log.log"); + TextArea.TextView.LineTransformers.Add(new LineStyleTransformer()); } } From 090b64d68dcfdc19d1b05366f9b9b96e6027dc1e Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 18:21:55 +0800 Subject: [PATCH 165/571] refactor: notification popup uses the same text presenter with git command log viewer (#1149) Signed-off-by: leo --- src/Views/CommandLogContentPresenter.cs | 152 ++++++++++++++++++++++++ src/Views/LauncherPage.axaml | 8 +- src/Views/ViewLogs.axaml | 4 +- src/Views/ViewLogs.axaml.cs | 111 ----------------- 4 files changed, 159 insertions(+), 116 deletions(-) create mode 100644 src/Views/CommandLogContentPresenter.cs diff --git a/src/Views/CommandLogContentPresenter.cs b/src/Views/CommandLogContentPresenter.cs new file mode 100644 index 00000000..a2499f8d --- /dev/null +++ b/src/Views/CommandLogContentPresenter.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; + +using Avalonia; +using Avalonia.Controls.Primitives; +using Avalonia.Interactivity; +using Avalonia.Media; + +using AvaloniaEdit; +using AvaloniaEdit.Document; +using AvaloniaEdit.Editing; +using AvaloniaEdit.Rendering; +using AvaloniaEdit.TextMate; + +namespace SourceGit.Views +{ + public class CommandLogContentPresenter : TextEditor + { + public class LineStyleTransformer : DocumentColorizingTransformer + { + protected override void ColorizeLine(DocumentLine line) + { + var content = CurrentContext.Document.GetText(line); + if (content.StartsWith("$ git ", StringComparison.Ordinal)) + { + ChangeLinePart(line.Offset, line.Offset + 1, v => + { + v.TextRunProperties.SetForegroundBrush(Brushes.Orange); + }); + + ChangeLinePart(line.Offset + 2, line.EndOffset, v => + { + var old = v.TextRunProperties.Typeface; + v.TextRunProperties.SetTypeface(new Typeface(old.FontFamily, old.Style, FontWeight.Bold)); + }); + } + else if (content.StartsWith("remote: ", StringComparison.Ordinal)) + { + ChangeLinePart(line.Offset, line.Offset + 7, v => + { + v.TextRunProperties.SetForegroundBrush(Brushes.SeaGreen); + }); + } + else + { + foreach (var err in _errors) + { + var idx = content.IndexOf(err, StringComparison.Ordinal); + if (idx >= 0) + { + ChangeLinePart(line.Offset + idx, line.Offset + err.Length + 1, v => + { + v.TextRunProperties.SetForegroundBrush(Brushes.Red); + }); + } + } + } + } + + private readonly List _errors = ["! [rejected]", "! [remote rejected]"]; + } + + public static readonly StyledProperty LogProperty = + AvaloniaProperty.Register(nameof(Log)); + + public ViewModels.CommandLog Log + { + get => GetValue(LogProperty); + set => SetValue(LogProperty, value); + } + + public static readonly StyledProperty PureTextProperty = + AvaloniaProperty.Register(nameof(PureText)); + + public string PureText + { + get => GetValue(PureTextProperty); + set => SetValue(PureTextProperty, value); + } + + protected override Type StyleKeyOverride => typeof(TextEditor); + + public CommandLogContentPresenter() : base(new TextArea(), new TextDocument()) + { + IsReadOnly = true; + ShowLineNumbers = false; + WordWrap = false; + HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; + VerticalScrollBarVisibility = ScrollBarVisibility.Auto; + + TextArea.TextView.Margin = new Thickness(4, 0); + TextArea.TextView.Options.EnableHyperlinks = false; + TextArea.TextView.Options.EnableEmailHyperlinks = false; + } + + protected override void OnLoaded(RoutedEventArgs e) + { + base.OnLoaded(e); + + if (_textMate == null) + { + _textMate = Models.TextMateHelper.CreateForEditor(this); + Models.TextMateHelper.SetGrammarByFileName(_textMate, "Log.log"); + TextArea.TextView.LineTransformers.Add(new LineStyleTransformer()); + } + } + + protected override void OnUnloaded(RoutedEventArgs e) + { + base.OnUnloaded(e); + + if (_textMate != null) + { + _textMate.Dispose(); + _textMate = null; + } + + GC.Collect(); + } + + protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) + { + base.OnPropertyChanged(change); + + if (change.Property == LogProperty) + { + if (change.NewValue is ViewModels.CommandLog log) + { + Text = log.Content; + log.Register(OnLogLineReceived); + } + else + { + Text = string.Empty; + } + } + else if (change.Property == PureTextProperty) + { + if (!string.IsNullOrEmpty(PureText)) + Text = PureText; + } + } + + private void OnLogLineReceived(string newline) + { + AppendText("\n"); + AppendText(newline); + } + + private TextMate.Installation _textMate = null; + } +} diff --git a/src/Views/LauncherPage.axaml b/src/Views/LauncherPage.axaml index 7ce450de..46fb97f6 100644 --- a/src/Views/LauncherPage.axaml +++ b/src/Views/LauncherPage.axaml @@ -141,9 +141,11 @@
- - - +
diff --git a/src/Views/ViewLogs.axaml b/src/Views/ViewLogs.axaml index 9c1ae435..c4aa46f7 100644 --- a/src/Views/ViewLogs.axaml +++ b/src/Views/ViewLogs.axaml @@ -100,8 +100,8 @@ BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1" Background="{DynamicResource Brush.Contents}"> - +
diff --git a/src/Views/ViewLogs.axaml.cs b/src/Views/ViewLogs.axaml.cs index 8a3426d2..f0a27884 100644 --- a/src/Views/ViewLogs.axaml.cs +++ b/src/Views/ViewLogs.axaml.cs @@ -1,118 +1,7 @@ -using System; - -using Avalonia; using Avalonia.Controls; -using Avalonia.Controls.Primitives; -using Avalonia.Interactivity; -using Avalonia.Media; - -using AvaloniaEdit; -using AvaloniaEdit.Document; -using AvaloniaEdit.Editing; -using AvaloniaEdit.Rendering; -using AvaloniaEdit.TextMate; namespace SourceGit.Views { - public class LogContentPresenter : TextEditor - { - public class LineStyleTransformer : DocumentColorizingTransformer - { - protected override void ColorizeLine(DocumentLine line) - { - var content = CurrentContext.Document.GetText(line); - if (content.StartsWith("$ git ", StringComparison.Ordinal)) - { - ChangeLinePart(line.Offset, line.Offset + 1, v => - { - v.TextRunProperties.SetForegroundBrush(Brushes.Orange); - }); - - ChangeLinePart(line.Offset + 2, line.EndOffset, v => - { - var old = v.TextRunProperties.Typeface; - v.TextRunProperties.SetTypeface(new Typeface(old.FontFamily, old.Style, FontWeight.Bold)); - }); - } - } - } - - public static readonly StyledProperty LogProperty = - AvaloniaProperty.Register(nameof(Log)); - - public ViewModels.CommandLog Log - { - get => GetValue(LogProperty); - set => SetValue(LogProperty, value); - } - - protected override Type StyleKeyOverride => typeof(TextEditor); - - public LogContentPresenter() : base(new TextArea(), new TextDocument()) - { - IsReadOnly = true; - ShowLineNumbers = false; - WordWrap = false; - HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; - VerticalScrollBarVisibility = ScrollBarVisibility.Auto; - - TextArea.TextView.Margin = new Thickness(4, 0); - TextArea.TextView.Options.EnableHyperlinks = false; - TextArea.TextView.Options.EnableEmailHyperlinks = false; - } - - protected override void OnLoaded(RoutedEventArgs e) - { - base.OnLoaded(e); - - if (_textMate == null) - { - _textMate = Models.TextMateHelper.CreateForEditor(this); - Models.TextMateHelper.SetGrammarByFileName(_textMate, "Log.log"); - TextArea.TextView.LineTransformers.Add(new LineStyleTransformer()); - } - } - - protected override void OnUnloaded(RoutedEventArgs e) - { - base.OnUnloaded(e); - - if (_textMate != null) - { - _textMate.Dispose(); - _textMate = null; - } - - GC.Collect(); - } - - protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) - { - base.OnPropertyChanged(change); - - if (change.Property == LogProperty) - { - if (change.NewValue is ViewModels.CommandLog log) - { - Text = log.Content; - log.Register(OnLogLineReceived); - } - else - { - Text = string.Empty; - } - } - } - - private void OnLogLineReceived(string newline) - { - AppendText("\n"); - AppendText(newline); - } - - private TextMate.Installation _textMate = null; - } - public partial class ViewLogs : ChromelessWindow { public ViewLogs() From 4c1a04477e69c2dfa146cc0fd32db822632c6461 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 20:03:46 +0800 Subject: [PATCH 166/571] refactor: enhanced copy commit information context menu (#1209) Signed-off-by: leo --- src/Resources/Icons.axaml | 3 ++ src/Resources/Locales/de_DE.axaml | 4 +-- src/Resources/Locales/en_US.axaml | 7 ++-- src/Resources/Locales/es_ES.axaml | 4 +-- src/Resources/Locales/fr_FR.axaml | 4 +-- src/Resources/Locales/it_IT.axaml | 4 +-- src/Resources/Locales/ja_JP.axaml | 4 +-- src/Resources/Locales/pt_BR.axaml | 4 +-- src/Resources/Locales/ru_RU.axaml | 4 +-- src/Resources/Locales/ta_IN.axaml | 4 +-- src/Resources/Locales/uk_UA.axaml | 4 +-- src/Resources/Locales/zh_CN.axaml | 7 ++-- src/Resources/Locales/zh_TW.axaml | 7 ++-- src/ViewModels/Histories.cs | 56 ++++++++++++++++++++++++++----- 14 files changed, 84 insertions(+), 32 deletions(-) diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml index a966d47d..51e3d8bf 100644 --- a/src/Resources/Icons.axaml +++ b/src/Resources/Icons.axaml @@ -46,6 +46,7 @@ M416 832H128V128h384v192C512 355 541 384 576 384L768 384v32c0 19 13 32 32 32S832 435 832 416v-64c0-6 0-19-6-25l-256-256c-6-6-19-6-25-6H128A64 64 0 0064 128v704C64 867 93 896 129 896h288c19 0 32-13 32-32S435 832 416 832zM576 172 722 320H576V172zM736 512C614 512 512 614 512 736S614 960 736 960s224-102 224-224S858 512 736 512zM576 736C576 646 646 576 736 576c32 0 58 6 83 26l-218 218c-19-26-26-51-26-83zm160 160c-32 0-64-13-96-32l224-224c19 26 32 58 32 96 0 90-70 160-160 160z M896 320c0-19-6-32-19-45l-192-192c-13-13-26-19-45-19H192c-38 0-64 26-64 64v768c0 38 26 64 64 64h640c38 0 64-26 64-64V320zm-256 384H384c-19 0-32-13-32-32s13-32 32-32h256c19 0 32 13 32 32s-13 32-32 32zm166-384H640V128l192 192h-26z M599 425 599 657 425 832 425 425 192 192 832 192Z + M505 74c-145 3-239 68-239 68-12 8-15 25-7 37 9 13 25 15 38 6 0 0 184-136 448 2 12 7 29 3 36-10 8-13 3-29-12-37-71-38-139-56-199-63-23-3-44-3-65-3m17 111c-254-3-376 201-376 201-8 12-5 29 7 37 12 8 29 4 39-10 0 0 103-178 329-175 226 3 325 173 325 173 8 12 24 17 37 9 14-8 17-24 9-37 0 0-117-195-370-199m-31 106c-72 5-140 31-192 74C197 449 132 603 204 811c5 14 20 21 34 17 14-5 21-20 16-34-66-191-7-316 79-388 84-69 233-85 343-17 54 34 96 93 118 151 22 58 20 114 3 141-18 28-54 38-86 30-32-8-58-31-59-80-1-73-58-118-118-125-57-7-123 24-140 92-32 125 49 302 238 361 14 4 29-3 34-17 4-14-3-29-18-34-163-51-225-206-202-297 10-41 46-55 84-52 37 4 69 26 69 73 2 70 48 117 100 131 52 13 112-3 144-52 33-50 28-120 3-188-26-68-73-136-140-178a356 356 0 00-213-52m15 104v0c-76 3-152 42-195 125-56 106-31 215 7 293 38 79 90 131 90 131 10 11 27 11 38 0s11-26 0-38c0 0-46-47-79-116s-54-157-8-244c48-90 133-111 208-90 76 22 140 88 138 186-2 15 9 28 24 29 15 1 27-10 29-27 3-122-79-210-176-239a246 246 0 00-75-9m9 213c-15 0-26 13-26 27 0 0 1 63 36 124 36 61 112 119 244 107 15-1 26-13 25-28-1-15-14-26-30-25-116 11-165-33-193-81-28-47-29-98-29-98a27 27 0 00-27-27z m211 611a142 142 0 00-90-4v-190a142 142 0 0090-4v198zm0 262v150h-90v-146a142 142 0 0090-4zm0-723a142 142 0 00-90-4v-146h90zm-51 246a115 115 0 11115-115 115 115 0 01-115 115zm0 461a115 115 0 11115-115 115 115 0 01-115 115zm256-691h563v90h-563zm0 461h563v90h-563zm0-282h422v90h-422zm0 474h422v90h-422z M853 267H514c-4 0-6-2-9-4l-38-66c-13-21-38-36-64-36H171c-41 0-75 34-75 75v555c0 41 34 75 75 75h683c41 0 75-34 75-75V341c0-41-34-75-75-75zm-683-43h233c4 0 6 2 9 4l38 66c13 21 38 36 64 36H853c6 0 11 4 11 11v75h-704V235c0-6 4-11 11-11zm683 576H171c-6 0-11-4-11-11V480h704V789c0 6-4 11-11 11z M1088 227H609L453 78a11 11 0 00-7-3H107a43 43 0 00-43 43v789a43 43 0 0043 43h981a43 43 0 0043-43V270a43 43 0 00-43-43zM757 599c0 5-5 9-10 9h-113v113c0 5-4 9-9 9h-56c-5 0-9-4-9-9V608h-113c-5 0-10-4-10-9V543c0-5 5-9 10-9h113V420c0-5 4-9 9-9h56c5 0 9 4 9 9V533h113c5 0 10 4 10 9v56z @@ -116,6 +117,7 @@ M558 545 790 403c24-15 31-47 16-71-15-24-46-31-70-17L507 457 277 315c-24-15-56-7-71 17-15 24-7 56 17 71l232 143V819c0 28 23 51 51 51 28 0 51-23 51-51V545h0zM507 0l443 256v512L507 1024 63 768v-512L507 0z M770 320a41 41 0 00-56-14l-252 153L207 306a41 41 0 10-43 70l255 153 2 296a41 41 0 0082 0l-2-295 255-155a41 41 0 0014-56zM481 935a42 42 0 01-42 0L105 741a42 42 0 01-21-36v-386a42 42 0 0121-36L439 89a42 42 0 0142 0l335 193a42 42 0 0121 36v87h84v-87a126 126 0 00-63-109L523 17a126 126 0 00-126 0L63 210a126 126 0 00-63 109v386a126 126 0 0063 109l335 193a126 126 0 00126 0l94-54-42-72zM1029 700h-126v-125a42 42 0 00-84 0v126h-126a42 42 0 000 84h126v126a42 42 0 1084 0v-126h126a42 42 0 000-84z M416 587c21 0 37 17 37 37v299A37 37 0 01416 960h-299a37 37 0 01-37-37v-299c0-21 17-37 37-37h299zm448 0c21 0 37 17 37 37v299A37 37 0 01864 960h-299a37 37 0 01-37-37v-299c0-21 17-37 37-37h299zM758 91l183 189a37 37 0 010 52l-182 188a37 37 0 01-53 1l-183-189a37 37 0 010-52l182-188a37 37 0 0153-1zM416 139c21 0 37 17 37 37v299A37 37 0 01416 512h-299a37 37 0 01-37-37v-299c0-21 17-37 37-37h299z + M653 435l-26 119H725c9 0 13 4 13 13v47c0 9-4 13-13 13h-107l-21 115c0 9-4 13-13 13h-47c-9 0-13-4-13-13l21-111H427l-21 115c0 9-4 13-13 13H346c-9 0-13-4-13-13l21-107h-85c-4-9-9-21-13-34v-38c0-9 4-13 13-13h98l26-119H294c-9 0-13-4-13-13V375c0-9 4-13 13-13h115l13-81c0-9 4-13 13-13h43c9 0 13 4 13 13L469 363h119l13-81c0-9 4-13 13-13h47c9 0 13 4 13 13l-13 77h85c9 0 13 4 13 13v47c0 9-4 13-13 13h-98v4zM512 0C230 0 0 230 0 512c0 145 60 282 166 375L90 1024H512c282 0 512-230 512-512S794 0 512 0zm-73 559h124l26-119h-128l-21 119z M875 128h-725A107 107 0 0043 235v555A107 107 0 00149 896h725a107 107 0 00107-107v-555A107 107 0 00875 128zm-115 640h-183v-58l25-3c15 0 19-8 14-24l-22-61H419l-28 82 39 2V768h-166v-58l18-3c18-2 22-11 26-24l125-363-40-4V256h168l160 448 39 3zM506 340l-72 218h145l-71-218h-2z M177 156c-22 5-33 17-36 37c-10 57-33 258-13 278l445 445c23 23 61 23 84 0l246-246c23-23 23-61 0-84l-445-445C437 120 231 145 177 156zM331 344c-26 26-69 26-95 0c-26-26-26-69 0-95s69-26 95 0C357 276 357 318 331 344z M683 537h-144v-142h-142V283H239a44 44 0 00-41 41v171a56 56 0 0014 34l321 321a41 41 0 0058 0l174-174a41 41 0 000-58zm-341-109a41 41 0 110-58a41 41 0 010 58zM649 284V142h-69v142h-142v68h142v142h69v-142h142v-68h-142z @@ -130,6 +132,7 @@ M762 1024C876 818 895 504 448 514V768L64 384l384-384v248c535-14 595 472 314 776z M832 464H332V240c0-31 25-56 56-56h248c31 0 56 25 56 56v68c0 4 4 8 8 8h56c4 0 8-4 8-8v-68c0-71-57-128-128-128H388c-71 0-128 57-128 128v224h-68c-18 0-32 14-32 32v384c0 18 14 32 32 32h640c18 0 32-14 32-32V496c0-18-14-32-32-32zM540 701v53c0 4-4 8-8 8h-40c-4 0-8-4-8-8v-53c-12-9-20-23-20-39 0-27 22-48 48-48s48 22 48 48c0 16-8 30-20 39z M170 831l343-342L855 831l105-105-448-448L64 726 170 831z + M667 607c-3-2-7-14-0-38 73-77 118-187 118-290C784 115 668 0 508 0 348 0 236 114 236 278c0 104 45 215 119 292 7 24-2 33-8 35C274 631 0 725 0 854L0 1024l1024 0 0-192C989 714 730 627 667 607L667 607z M880 128A722 722 0 01555 13a77 77 0 00-85 0 719 719 0 01-325 115c-40 4-71 38-71 80v369c0 246 329 446 439 446 110 0 439-200 439-446V207c0-41-31-76-71-80zM465 692a36 36 0 01-53 0L305 579a42 42 0 010-57 36 36 0 0153 0l80 85L678 353a36 36 0 0153 0 42 42 0 01-0 57L465 692z M812 864h-29V654c0-21-11-40-28-52l-133-88 134-89c18-12 28-31 28-52V164h28c18 0 32-14 32-32s-14-32-32-32H212c-18 0-32 14-32 32s14 32 32 32h30v210c0 21 11 40 28 52l133 88-134 89c-18 12-28 31-28 52V864H212c-18 0-32 14-32 32s14 32 32 32h600c18 0 32-14 32-32s-14-32-32-32zM441 566c18-12 28-31 28-52s-11-40-28-52L306 373V164h414v209l-136 90c-18 12-28 31-28 52 0 21 11 40 28 52l135 89V695c-9-7-20-13-32-19-30-15-93-41-176-41-63 0-125 14-175 38-12 6-22 12-31 18v-36l136-90z M0 512M1024 512M512 0M512 1024M762 412v100h-500v-100h-150v200h800v-200h-150z diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index 3cb70cea..7a3da294 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -102,8 +102,8 @@ Mehrere cherry-picken Mit HEAD vergleichen Mit Worktree vergleichen - Info kopieren - SHA kopieren + Information + SHA Benutzerdefinierte Aktion Interactives Rebase von ${0}$ auf diesen Commit Merge in ${0}$ hinein diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index bd4cfc56..20a70f22 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -99,8 +99,11 @@ Cherry-Pick ... Compare with HEAD Compare with Worktree - Copy Info - Copy SHA + Author + Committer + Information + SHA + Subject Custom Action Interactively Rebase ${0}$ on Here Merge to ${0}$ diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index e316a470..204cfc1a 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -103,8 +103,8 @@ Cherry-Pick ... Comparar con HEAD Comparar con Worktree - Copiar Información - Copiar SHA + Información + SHA Acción personalizada Rebase Interactivo ${0}$ hasta Aquí Merge a ${0}$ diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index fd41b4f0..f45a83d9 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -103,8 +103,8 @@ Cherry-Pick ... Comparer avec HEAD Comparer avec le worktree - Copier les informations - Copier le SHA + Informations + SHA Action personnalisée Rebase interactif de ${0}$ ici Fusionner dans ${0}$ diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index 4498348d..b7d2568a 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -103,8 +103,8 @@ Cherry-Pick... Confronta con HEAD Confronta con Worktree - Copia Info - Copia SHA + Informazioni + SHA Azione Personalizzata Riallinea Interattivamente ${0}$ fino a Qui Unisci a ${0}$ diff --git a/src/Resources/Locales/ja_JP.axaml b/src/Resources/Locales/ja_JP.axaml index 4b785c3d..c50504e1 100644 --- a/src/Resources/Locales/ja_JP.axaml +++ b/src/Resources/Locales/ja_JP.axaml @@ -103,8 +103,8 @@ チェリーピック... HEADと比較 ワークツリーと比較 - 情報をコピー - SHAをコピー + 情報 + SHA カスタムアクション ${0}$ ブランチをここにインタラクティブリベース ${0}$ にマージ diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index 299ececd..a4e9d883 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -93,8 +93,8 @@ Cherry-Pick ... Comparar com HEAD Comparar com Worktree - Copiar Informações - Copiar SHA + Informações + SHA Ação customizada Rebase Interativo ${0}$ até Aqui Rebase ${0}$ até Aqui diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index c3e8b87a..b8c86415 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -103,8 +103,8 @@ Применить несколько ревизий ... Сравнить c ГОЛОВОЙ (HEAD) Сравнить с рабочим каталогом - Копировать информацию - Копировать SHA + Информацию + SHA Пользовательское действие Интерактивное перемещение (rebase -i) ${0}$ сюда Влить в ${0}$ diff --git a/src/Resources/Locales/ta_IN.axaml b/src/Resources/Locales/ta_IN.axaml index c62dd2b5..b4e4d939 100644 --- a/src/Resources/Locales/ta_IN.axaml +++ b/src/Resources/Locales/ta_IN.axaml @@ -103,8 +103,8 @@ கனி-பறி ... தலையுடன் ஒப்பிடுக பணிமரத்துடன் ஒப்பிடுக - தகவலை நகலெடு - பாகொவ-வை நகலெடு + தகவலை + பாகொவ-வை தனிப்பயன் செயல் இங்கே ${0}$ ஐ ஊடாடும் வகையில் மறுதளம் ${0}$ இதற்கு ஒன்றிணை diff --git a/src/Resources/Locales/uk_UA.axaml b/src/Resources/Locales/uk_UA.axaml index 828c36f8..a3b63bde 100644 --- a/src/Resources/Locales/uk_UA.axaml +++ b/src/Resources/Locales/uk_UA.axaml @@ -103,8 +103,8 @@ Cherry-pick ... Порівняти з HEAD Порівняти з робочим деревом - Копіювати інформацію - Копіювати SHA + Iнформацію + SHA Спеціальна дія Інтерактивно перебазувати ${0}$ сюди Злиття в ${0}$ diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 7546b3c4..3d41bccd 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -103,8 +103,11 @@ 挑选(cherry-pick)... 与当前HEAD比较 与本地工作树比较 - 复制简要信息 - 复制提交指纹 + 作者 + 提交者 + 简要信息 + 提交指纹 + 主题 自定义操作 交互式变基(rebase -i) ${0}$ 到此处 合并(merge)此提交至 ${0}$ diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 61921ea4..3a10f6ca 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -103,8 +103,11 @@ 揀選 (cherry-pick)... 與目前 HEAD 比較 與本機工作區比較 - 複製摘要資訊 - 複製提交編號 + 作者 + 提交者 + 摘要資訊 + 提交編號 + 標題 自訂動作 互動式重定基底 (rebase -i) ${0}$ 到此處 合併 (merge) 此提交到 ${0}$ diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index b3216a91..ee5e5891 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -330,7 +330,7 @@ namespace SourceGit.ViewModels var copyMultipleSHAs = new MenuItem(); copyMultipleSHAs.Header = App.Text("CommitCM.CopySHA"); - copyMultipleSHAs.Icon = App.CreateMenuIcon("Icons.Copy"); + copyMultipleSHAs.Icon = App.CreateMenuIcon("Icons.Fingerprint"); copyMultipleSHAs.Click += (_, e) => { var builder = new StringBuilder(); @@ -340,11 +340,10 @@ namespace SourceGit.ViewModels App.CopyText(builder.ToString()); e.Handled = true; }; - multipleMenu.Items.Add(copyMultipleSHAs); var copyMultipleInfo = new MenuItem(); copyMultipleInfo.Header = App.Text("CommitCM.CopyInfo"); - copyMultipleInfo.Icon = App.CreateMenuIcon("Icons.Copy"); + copyMultipleInfo.Icon = App.CreateMenuIcon("Icons.Info"); copyMultipleInfo.Click += (_, e) => { var builder = new StringBuilder(); @@ -354,7 +353,13 @@ namespace SourceGit.ViewModels App.CopyText(builder.ToString()); e.Handled = true; }; - multipleMenu.Items.Add(copyMultipleInfo); + + var copyMultiple = new MenuItem(); + copyMultiple.Header = App.Text("Copy"); + copyMultiple.Icon = App.CreateMenuIcon("Icons.Copy"); + copyMultiple.Items.Add(copyMultipleSHAs); + copyMultiple.Items.Add(copyMultipleInfo); + multipleMenu.Items.Add(copyMultiple); return multipleMenu; } @@ -715,23 +720,58 @@ namespace SourceGit.ViewModels var copySHA = new MenuItem(); copySHA.Header = App.Text("CommitCM.CopySHA"); - copySHA.Icon = App.CreateMenuIcon("Icons.Copy"); + copySHA.Icon = App.CreateMenuIcon("Icons.Fingerprint"); copySHA.Click += (_, e) => { App.CopyText(commit.SHA); e.Handled = true; }; - menu.Items.Add(copySHA); + + var copySubject = new MenuItem(); + copySubject.Header = App.Text("CommitCM.CopySubject"); + copySubject.Icon = App.CreateMenuIcon("Icons.Subject"); + copySubject.Click += (_, e) => + { + App.CopyText(commit.Subject); + e.Handled = true; + }; var copyInfo = new MenuItem(); copyInfo.Header = App.Text("CommitCM.CopyInfo"); - copyInfo.Icon = App.CreateMenuIcon("Icons.Copy"); + copyInfo.Icon = App.CreateMenuIcon("Icons.Info"); copyInfo.Click += (_, e) => { App.CopyText($"{commit.SHA.Substring(0, 10)} - {commit.Subject}"); e.Handled = true; }; - menu.Items.Add(copyInfo); + + var copyAuthor = new MenuItem(); + copyAuthor.Header = App.Text("CommitCM.CopyAuthor"); + copyAuthor.Icon = App.CreateMenuIcon("Icons.User"); + copyAuthor.Click += (_, e) => + { + App.CopyText(commit.Author.ToString()); + e.Handled = true; + }; + + var copyCommitter = new MenuItem(); + copyCommitter.Header = App.Text("CommitCM.CopyCommitter"); + copyCommitter.Icon = App.CreateMenuIcon("Icons.User"); + copyCommitter.Click += (_, e) => + { + App.CopyText(commit.Committer.ToString()); + e.Handled = true; + }; + + var copy = new MenuItem(); + copy.Header = App.Text("Copy"); + copy.Icon = App.CreateMenuIcon("Icons.Copy"); + copy.Items.Add(copySHA); + copy.Items.Add(copySubject); + copy.Items.Add(copyInfo); + copy.Items.Add(copyAuthor); + copy.Items.Add(copyCommitter); + menu.Items.Add(copy); return menu; } From 5bd7dd428dc0df2616f8a7a8cf21af8c9d65981a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 17 Apr 2025 12:04:02 +0000 Subject: [PATCH 167/571] doc: Update translation status and sort locale files --- TRANSLATION.md | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/TRANSLATION.md b/TRANSLATION.md index 4f13d26a..866aac65 100644 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -6,12 +6,15 @@ This document shows the translation status of each locale file in the repository ### ![en_US](https://img.shields.io/badge/en__US-%E2%88%9A-brightgreen) -### ![de__DE](https://img.shields.io/badge/de__DE-96.57%25-yellow) +### ![de__DE](https://img.shields.io/badge/de__DE-96.19%25-yellow)
Missing keys in de_DE.axaml - Text.BranchUpstreamInvalid +- Text.CommitCM.CopyAuthor +- Text.CommitCM.CopyCommitter +- Text.CommitCM.CopySubject - Text.CommitMessageTextBox.SubjectCount - Text.Configure.CustomAction.WaitForExit - Text.Configure.Git.PreferredMergeMode @@ -40,11 +43,14 @@ This document shows the translation status of each locale file in the repository
-### ![es__ES](https://img.shields.io/badge/es__ES-99.34%25-yellow) +### ![es__ES](https://img.shields.io/badge/es__ES-98.95%25-yellow)
Missing keys in es_ES.axaml +- Text.CommitCM.CopyAuthor +- Text.CommitCM.CopyCommitter +- Text.CommitCM.CopySubject - Text.Repository.ViewLogs - Text.ViewLogs - Text.ViewLogs.Clear @@ -53,11 +59,14 @@ This document shows the translation status of each locale file in the repository
-### ![fr__FR](https://img.shields.io/badge/fr__FR-97.89%25-yellow) +### ![fr__FR](https://img.shields.io/badge/fr__FR-97.51%25-yellow)
Missing keys in fr_FR.axaml +- Text.CommitCM.CopyAuthor +- Text.CommitCM.CopyCommitter +- Text.CommitCM.CopySubject - Text.CommitMessageTextBox.SubjectCount - Text.Configure.Git.PreferredMergeMode - Text.ConfirmEmptyCommit.Continue @@ -77,11 +86,14 @@ This document shows the translation status of each locale file in the repository
-### ![it__IT](https://img.shields.io/badge/it__IT-97.63%25-yellow) +### ![it__IT](https://img.shields.io/badge/it__IT-97.24%25-yellow)
Missing keys in it_IT.axaml +- Text.CommitCM.CopyAuthor +- Text.CommitCM.CopyCommitter +- Text.CommitCM.CopySubject - Text.CommitMessageTextBox.SubjectCount - Text.Configure.Git.PreferredMergeMode - Text.ConfirmEmptyCommit.Continue @@ -103,11 +115,14 @@ This document shows the translation status of each locale file in the repository
-### ![ja__JP](https://img.shields.io/badge/ja__JP-97.63%25-yellow) +### ![ja__JP](https://img.shields.io/badge/ja__JP-97.24%25-yellow)
Missing keys in ja_JP.axaml +- Text.CommitCM.CopyAuthor +- Text.CommitCM.CopyCommitter +- Text.CommitCM.CopySubject - Text.CommitMessageTextBox.SubjectCount - Text.Configure.Git.PreferredMergeMode - Text.ConfirmEmptyCommit.Continue @@ -129,7 +144,7 @@ This document shows the translation status of each locale file in the repository
-### ![pt__BR](https://img.shields.io/badge/pt__BR-89.06%25-yellow) +### ![pt__BR](https://img.shields.io/badge/pt__BR-88.71%25-yellow)
Missing keys in pt_BR.axaml @@ -144,6 +159,9 @@ This document shows the translation status of each locale file in the repository - Text.BranchCM.MergeMultiBranches - Text.BranchUpstreamInvalid - Text.Clone.RecurseSubmodules +- Text.CommitCM.CopyAuthor +- Text.CommitCM.CopyCommitter +- Text.CommitCM.CopySubject - Text.CommitCM.Merge - Text.CommitCM.MergeMultiple - Text.CommitDetail.Files.Search @@ -220,11 +238,14 @@ This document shows the translation status of each locale file in the repository
-### ![ru__RU](https://img.shields.io/badge/ru__RU-99.21%25-yellow) +### ![ru__RU](https://img.shields.io/badge/ru__RU-98.82%25-yellow)
Missing keys in ru_RU.axaml +- Text.CommitCM.CopyAuthor +- Text.CommitCM.CopyCommitter +- Text.CommitCM.CopySubject - Text.CommitMessageTextBox.SubjectCount - Text.Repository.ViewLogs - Text.ViewLogs @@ -234,11 +255,14 @@ This document shows the translation status of each locale file in the repository
-### ![ta__IN](https://img.shields.io/badge/ta__IN-97.89%25-yellow) +### ![ta__IN](https://img.shields.io/badge/ta__IN-97.51%25-yellow)
Missing keys in ta_IN.axaml +- Text.CommitCM.CopyAuthor +- Text.CommitCM.CopyCommitter +- Text.CommitCM.CopySubject - Text.CommitMessageTextBox.SubjectCount - Text.Configure.Git.PreferredMergeMode - Text.ConfirmEmptyCommit.Continue @@ -258,11 +282,14 @@ This document shows the translation status of each locale file in the repository
-### ![uk__UA](https://img.shields.io/badge/uk__UA-99.08%25-yellow) +### ![uk__UA](https://img.shields.io/badge/uk__UA-98.69%25-yellow)
Missing keys in uk_UA.axaml +- Text.CommitCM.CopyAuthor +- Text.CommitCM.CopyCommitter +- Text.CommitCM.CopySubject - Text.CommitMessageTextBox.SubjectCount - Text.ConfigureWorkspace.Name - Text.Repository.ViewLogs From de31d4bad417e50ddea85496fe00da284f04e28f Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 21:17:54 +0800 Subject: [PATCH 168/571] ux: layout of git command log item Signed-off-by: leo --- src/Views/ViewLogs.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/ViewLogs.axaml b/src/Views/ViewLogs.axaml index c4aa46f7..e29a5afd 100644 --- a/src/Views/ViewLogs.axaml +++ b/src/Views/ViewLogs.axaml @@ -75,7 +75,7 @@ Date: Thu, 17 Apr 2025 17:14:52 +0100 Subject: [PATCH 169/571] Fixed tooltip Tooltip for chosing mine was wrong. Was --theirs when should be --ours. (cherry picked from commit 26a471933c21a135e946273d49b9135b401bbd7f) --- src/Views/Conflict.axaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/Conflict.axaml b/src/Views/Conflict.axaml index f2d7bdec..cf2e25a0 100644 --- a/src/Views/Conflict.axaml +++ b/src/Views/Conflict.axaml @@ -111,7 +111,7 @@ -