Compare commits

..

No commits in common. "14334b08d2728a99cab5477ee6e090a8d226059e" and "8ddf6e87e913ac890740b392491cd759be7e95ed" have entirely different histories.

14 changed files with 43 additions and 63 deletions

View file

@ -7,23 +7,17 @@ namespace SourceGit.Commands
{
public Config(string repository)
{
if (string.IsNullOrEmpty(repository))
{
WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
}
else
{
WorkingDirectory = repository;
Context = repository;
_isLocal = true;
}
WorkingDirectory = repository;
Context = repository;
RaiseError = false;
}
public Dictionary<string, string> ListAll()
{
Args = "config -l";
if (string.IsNullOrEmpty(WorkingDirectory))
Args = "config --global -l";
else
Args = "config -l";
var output = ReadToEnd();
var rs = new Dictionary<string, string>();
@ -53,16 +47,22 @@ namespace SourceGit.Commands
public bool Set(string key, string value, bool allowEmpty = false)
{
var scope = _isLocal ? "--local" : "--global";
if (!allowEmpty && string.IsNullOrWhiteSpace(value))
Args = $"config {scope} --unset {key}";
{
if (string.IsNullOrEmpty(WorkingDirectory))
Args = $"config --global --unset {key}";
else
Args = $"config --unset {key}";
}
else
Args = $"config {scope} {key} \"{value}\"";
{
if (string.IsNullOrWhiteSpace(WorkingDirectory))
Args = $"config --global {key} \"{value}\"";
else
Args = $"config {key} \"{value}\"";
}
return Exec();
}
private bool _isLocal = false;
}
}

View file

@ -16,7 +16,7 @@ namespace SourceGit.Commands
public static bool Add(string repo, string name, string basedOn, string message, bool sign)
{
var param = sign ? "--sign -a" : "--no-sign -a";
var param = sign ? "-s -a" : "-a";
var cmd = new Command();
cmd.WorkingDirectory = repo;
cmd.Context = repo;

View file

@ -141,7 +141,6 @@
<x:String x:Key="Text.Configure.Git" xml:space="preserve">GIT</x:String>
<x:String x:Key="Text.Configure.Git.AutoFetch" xml:space="preserve">Remotes automatisch fetchen</x:String>
<x:String x:Key="Text.Configure.Git.AutoFetchIntervalSuffix" xml:space="preserve">Minute(n)</x:String>
<x:String x:Key="Text.Configure.Git.DefaultRemote" xml:space="preserve">Standard Remote</x:String>
<x:String x:Key="Text.Configure.IssueTracker" xml:space="preserve">TICKETSYSTEM</x:String>
<x:String x:Key="Text.Configure.IssueTracker.AddSampleGithub" xml:space="preserve">Beispiel für Github-Regel hinzufügen</x:String>
<x:String x:Key="Text.Configure.IssueTracker.AddSampleJira" xml:space="preserve">Beispiel für Jira-Regel hinzufügen</x:String>
@ -207,7 +206,6 @@
<x:String x:Key="Text.Diff.Binary.Old" xml:space="preserve">ALT</x:String>
<x:String x:Key="Text.Diff.Copy" xml:space="preserve">Kopieren</x:String>
<x:String x:Key="Text.Diff.FileModeChanged" xml:space="preserve">Dateimodus geändert</x:String>
<x:String x:Key="Text.Diff.IgnoreWhitespace" xml:space="preserve">Ignoriere Leerzeichenänderungen</x:String>
<x:String x:Key="Text.Diff.LFS" xml:space="preserve">LFS OBJEKT ÄNDERUNG</x:String>
<x:String x:Key="Text.Diff.Next" xml:space="preserve">Nächste Änderung</x:String>
<x:String x:Key="Text.Diff.NoChange" xml:space="preserve">KEINE ÄNDERUNG ODER NUR ZEILEN-ENDE ÄNDERUNGEN</x:String>
@ -227,7 +225,6 @@
<x:String x:Key="Text.Discard" xml:space="preserve">Änderungen verwerfen</x:String>
<x:String x:Key="Text.Discard.All" xml:space="preserve">Alle Änderungen in der Arbeitskopie.</x:String>
<x:String x:Key="Text.Discard.Changes" xml:space="preserve">Änderungen:</x:String>
<x:String x:Key="Text.Discard.IncludeIgnored" xml:space="preserve">Ignorierte Dateien inkludieren</x:String>
<x:String x:Key="Text.Discard.Total" xml:space="preserve">Insgesamt {0} Änderungen werden verworfen</x:String>
<x:String x:Key="Text.Discard.Warning" xml:space="preserve">Du kannst das nicht rückgängig machen!!!</x:String>
<x:String x:Key="Text.EditRepositoryNode.Bookmark" xml:space="preserve">Lesezeichen:</x:String>
@ -333,7 +330,6 @@
<x:String x:Key="Text.Hotkeys.Repo" xml:space="preserve">REPOSITORY</x:String>
<x:String x:Key="Text.Hotkeys.Repo.Commit" xml:space="preserve">Gestagte Änderungen committen</x:String>
<x:String x:Key="Text.Hotkeys.Repo.CommitAndPush" xml:space="preserve">Gestagte Änderungen committen und pushen</x:String>
<x:String x:Key="Text.Hotkeys.Repo.CommitWithAutoStage" xml:space="preserve">Alle Änderungen stagen und committen</x:String>
<x:String x:Key="Text.Hotkeys.Repo.DiscardSelected" xml:space="preserve">Ausgewählte Änderungen verwerfen</x:String>
<x:String x:Key="Text.Hotkeys.Repo.GoHome" xml:space="preserve">Dashboard Modus (Standard)</x:String>
<x:String x:Key="Text.Hotkeys.Repo.Refresh" xml:space="preserve">Erzwinge Neuladen des Repositorys</x:String>
@ -503,7 +499,7 @@
<x:String x:Key="Text.Repository.Configure" xml:space="preserve">Repository Einstellungen</x:String>
<x:String x:Key="Text.Repository.Continue" xml:space="preserve">WEITER</x:String>
<x:String x:Key="Text.Repository.Explore" xml:space="preserve">Öffne im Datei-Browser</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">Suche Branches/Tags/Submodule</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">Suche Branches &amp; Tags &amp; Submodule</x:String>
<x:String x:Key="Text.Repository.FilterCommitPrefix" xml:space="preserve">GEFILTERT:</x:String>
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">LOKALE BRANCHES</x:String>
<x:String x:Key="Text.Repository.NavigateToCurrentHead" xml:space="preserve">Zum HEAD wechseln</x:String>
@ -520,7 +516,6 @@
<x:String x:Key="Text.Repository.Search.ByMessage" xml:space="preserve">Commit-Nachricht</x:String>
<x:String x:Key="Text.Repository.Search.BySHA" xml:space="preserve">SHA</x:String>
<x:String x:Key="Text.Repository.Search.ByUser" xml:space="preserve">Autor &amp; Committer</x:String>
<x:String x:Key="Text.Repository.Search.InCurrentBranch" xml:space="preserve">Aktueller Branch</x:String>
<x:String x:Key="Text.Repository.ShowTagsAsTree" xml:space="preserve">Zeige Tags als Baum</x:String>
<x:String x:Key="Text.Repository.Statistics" xml:space="preserve">Statistiken</x:String>
<x:String x:Key="Text.Repository.Submodules" xml:space="preserve">SUBMODULE</x:String>
@ -628,8 +623,6 @@
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">COMMIT</x:String>
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT &amp; PUSH</x:String>
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">Template/Historie</x:String>
<x:String x:Key="Text.WorkingCopy.CommitTip" xml:space="preserve">Klick-Ereignis auslösen</x:String>
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">Alle Änderungen stagen und committen</x:String>
<x:String x:Key="Text.WorkingCopy.Conflicts" xml:space="preserve">KONFLIKTE ERKANNT</x:String>
<x:String x:Key="Text.WorkingCopy.Conflicts.Resolved" xml:space="preserve">DATEI KONFLIKTE GELÖST</x:String>
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">NICHT-VERFOLGTE DATEIEN INKLUDIEREN</x:String>

View file

@ -500,7 +500,7 @@
<x:String x:Key="Text.Repository.Configure" xml:space="preserve">Configure this repository</x:String>
<x:String x:Key="Text.Repository.Continue" xml:space="preserve">CONTINUE</x:String>
<x:String x:Key="Text.Repository.Explore" xml:space="preserve">Open In File Browser</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">Search Branches/Tags/Submodules</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">Search Branches &amp; Tags &amp; Submodules</x:String>
<x:String x:Key="Text.Repository.FilterCommitPrefix" xml:space="preserve">FILTERED BY:</x:String>
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">LOCAL BRANCHES</x:String>
<x:String x:Key="Text.Repository.NavigateToCurrentHead" xml:space="preserve">Navigate To HEAD</x:String>

View file

@ -2,6 +2,7 @@
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://SourceGit/Resources/Locales/en_US.axaml"/>
</ResourceDictionary.MergedDictionaries>
<x:String x:Key="Text.About" xml:space="preserve">À propos</x:String>
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Compilé avec </x:String>
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
@ -478,7 +479,7 @@
<x:String x:Key="Text.Repository.Configure" xml:space="preserve">Configure this repository</x:String>
<x:String x:Key="Text.Repository.Continue" xml:space="preserve">CONTINUE</x:String>
<x:String x:Key="Text.Repository.Explore" xml:space="preserve">Ouvrir dans l'explorateur Windows</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">Search Branches/Tags/Submodules</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">Search Branches &amp; Tags &amp; Submodules</x:String>
<x:String x:Key="Text.Repository.FilterCommitPrefix" xml:space="preserve">FILTERED BY:</x:String>
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">LOCAL BRANCHES</x:String>
<x:String x:Key="Text.Repository.NavigateToCurrentHead" xml:space="preserve">Navigate To HEAD</x:String>

View file

@ -471,7 +471,7 @@
<x:String x:Key="Text.Repository.Configure" xml:space="preserve">Configurar este repositório</x:String>
<x:String x:Key="Text.Repository.Continue" xml:space="preserve">CONTINUAR</x:String>
<x:String x:Key="Text.Repository.Explore" xml:space="preserve">Abrir no Navegador de Arquivos</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">Pesquisar Branches/Tags/Submódulos</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">Pesquisar Branches &amp; Tags &amp; Submódulos</x:String>
<x:String x:Key="Text.Repository.FilterCommitPrefix" xml:space="preserve">FILTRADO POR:</x:String>
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">BRANCHES LOCAIS</x:String>
<x:String x:Key="Text.Repository.NavigateToCurrentHead" xml:space="preserve">Navegar para HEAD</x:String>

View file

@ -498,7 +498,7 @@
<x:String x:Key="Text.Repository.Configure" xml:space="preserve">配置本仓库</x:String>
<x:String x:Key="Text.Repository.Continue" xml:space="preserve">下一步</x:String>
<x:String x:Key="Text.Repository.Explore" xml:space="preserve">在文件浏览器中打开</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">快速查找分支/标签/子模块</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">快速查找分支、标签、子模块</x:String>
<x:String x:Key="Text.Repository.FilterCommitPrefix" xml:space="preserve">过滤规则 </x:String>
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">本地分支</x:String>
<x:String x:Key="Text.Repository.NavigateToCurrentHead" xml:space="preserve">定位HEAD</x:String>

View file

@ -503,7 +503,7 @@
<x:String x:Key="Text.Repository.Configure" xml:space="preserve">設定本存放庫</x:String>
<x:String x:Key="Text.Repository.Continue" xml:space="preserve">下一步</x:String>
<x:String x:Key="Text.Repository.Explore" xml:space="preserve">在檔案瀏覽器中開啟</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">快速搜尋分支/標籤/子模組</x:String>
<x:String x:Key="Text.Repository.Filter" xml:space="preserve">快速搜尋分支、標籤、子模組</x:String>
<x:String x:Key="Text.Repository.FilterCommitPrefix" xml:space="preserve">篩選規則:</x:String>
<x:String x:Key="Text.Repository.LocalBranches" xml:space="preserve">本機分支</x:String>
<x:String x:Key="Text.Repository.NavigateToCurrentHead" xml:space="preserve">回到 HEAD</x:String>

View file

@ -1,5 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
namespace SourceGit.ViewModels
@ -51,7 +50,6 @@ namespace SourceGit.ViewModels
_basedOn = branch.Head;
BasedOn = branch;
SignTag = new Commands.Config(repo.FullPath).Get("tag.gpgsign").Equals("true", StringComparison.OrdinalIgnoreCase);
View = new Views.CreateTag() { DataContext = this };
}
@ -61,7 +59,6 @@ namespace SourceGit.ViewModels
_basedOn = commit.SHA;
BasedOn = commit;
SignTag = new Commands.Config(repo.FullPath).Get("tag.gpgsign").Equals("true", StringComparison.OrdinalIgnoreCase);
View = new Views.CreateTag() { DataContext = this };
}

View file

@ -15,17 +15,16 @@ namespace SourceGit.ViewModels
{
get
{
if (_instance != null)
return _instance;
_isLoading = true;
_instance = Load();
_isLoading = false;
if (_instance == null)
{
_isLoading = true;
_instance = Load();
_isLoading = false;
}
_instance.PrepareGit();
_instance.PrepareShellOrTerminal();
_instance.PrepareWorkspaces();
return _instance;
}
}

View file

@ -43,8 +43,7 @@
Fill="DarkOrange"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0"
Text="{DynamicResource Text.Checkout.Commit.Warning}"
TextWrapping="Wrap"
Foreground="DarkOrange"/>
TextWrapping="Wrap"/>
</Grid>
</Grid>
</StackPanel>

View file

@ -18,7 +18,7 @@
Fill="DarkOrange"/>
<TextBlock Margin="4,0,0,0"
Text="{DynamicResource Text.Discard.Warning}"
Foreground="DarkOrange"/>
Foreground="{DynamicResource Brush.FG2}"/>
</StackPanel>
<ContentControl Margin="0,16,0,8" Content="{Binding Mode}">

View file

@ -137,22 +137,7 @@ namespace SourceGit.Views
SetIfChanged(config, "gpg.format", GPGFormat.Value, "openpgp");
if (!GPGFormat.Value.Equals("ssh", StringComparison.Ordinal))
{
var oldGPG = string.Empty;
if (GPGFormat.Value == "openpgp" && config.TryGetValue("gpg.program", out var openpgp))
oldGPG = openpgp;
else if (config.TryGetValue($"gpg.{GPGFormat.Value}.program", out var gpgProgram))
oldGPG = gpgProgram;
bool changed = false;
if (!string.IsNullOrEmpty(oldGPG))
changed = oldGPG != GPGExecutableFile;
else if (!string.IsNullOrEmpty(GPGExecutableFile))
changed = true;
if (changed)
new Commands.Config(null).Set($"gpg.{GPGFormat.Value}.program", GPGExecutableFile);
}
SetIfChanged(config, $"gpg.{GPGFormat.Value}.program", GPGExecutableFile, "");
base.OnClosing(e);
}

View file

@ -128,7 +128,13 @@
BorderBrush="{DynamicResource Brush.Border2}"
Watermark="{DynamicResource Text.Repository.Filter}"
Text="{Binding Filter, Mode=TwoWay}"
VerticalContentAlignment="Center">
VerticalContentAlignment="Center">
<TextBox.Styles>
<Style Selector="TextBox /template/ TextBlock#PART_Watermark">
<Setter Property="FontSize" Value="12"/>
</Style>
</TextBox.Styles>
<TextBox.InnerLeftContent>
<Path Width="14" Height="14"
Margin="6,0,0,0"