mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-27 21:27:19 -08:00
Compare commits
7 commits
31e7bef01d
...
b9d7f908c9
Author | SHA1 | Date | |
---|---|---|---|
|
b9d7f908c9 | ||
|
077e35b860 | ||
|
93e964dcb6 | ||
|
728d003717 | ||
|
1855b43750 | ||
|
a8a7775b83 | ||
|
6dac26d525 |
25 changed files with 170 additions and 88 deletions
|
@ -1,6 +1,6 @@
|
||||||
# SourceGit
|
# SourceGit - Opensource Git GUI client.
|
||||||
|
|
||||||
Opensource Git GUI client.
|
![stars](https://img.shields.io/github/stars/sourcegit-scm/sourcegit.svg) ![forks](https://img.shields.io/github/forks/sourcegit-scm/sourcegit.svg) ![license](https://img.shields.io/github/license/sourcegit-scm/sourcegit.svg) ![latest](https://img.shields.io/github/v/release/sourcegit-scm/sourcegit.svg) ![downloads](https://img.shields.io/github/downloads/sourcegit-scm/sourcegit/total)
|
||||||
|
|
||||||
## Highlights
|
## Highlights
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace SourceGit.Commands
|
||||||
{
|
{
|
||||||
public class Commit : Command
|
public class Commit : Command
|
||||||
{
|
{
|
||||||
public Commit(string repo, string message, bool amend, bool allowEmpty = false)
|
public Commit(string repo, string message, bool amend)
|
||||||
{
|
{
|
||||||
var file = Path.GetTempFileName();
|
var file = Path.GetTempFileName();
|
||||||
File.WriteAllText(file, message);
|
File.WriteAllText(file, message);
|
||||||
|
@ -12,11 +12,9 @@ namespace SourceGit.Commands
|
||||||
WorkingDirectory = repo;
|
WorkingDirectory = repo;
|
||||||
Context = repo;
|
Context = repo;
|
||||||
TraitErrorAsOutput = true;
|
TraitErrorAsOutput = true;
|
||||||
Args = $"commit --file=\"{file}\"";
|
Args = $"commit --allow-empty --file=\"{file}\"";
|
||||||
if (amend)
|
if (amend)
|
||||||
Args += " --amend --no-edit";
|
Args += " --amend --no-edit";
|
||||||
if (allowEmpty)
|
|
||||||
Args += " --allow-empty";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace SourceGit.Commands
|
||||||
{
|
{
|
||||||
public class Fetch : Command
|
public class Fetch : Command
|
||||||
{
|
{
|
||||||
public Fetch(string repo, string remote, bool prune, bool noTags, Action<string> outputHandler)
|
public Fetch(string repo, string remote, bool noTags, Action<string> outputHandler)
|
||||||
{
|
{
|
||||||
_outputHandler = outputHandler;
|
_outputHandler = outputHandler;
|
||||||
WorkingDirectory = repo;
|
WorkingDirectory = repo;
|
||||||
|
@ -13,9 +13,6 @@ namespace SourceGit.Commands
|
||||||
SSHKey = new Config(repo).Get($"remote.{remote}.sshkey");
|
SSHKey = new Config(repo).Get($"remote.{remote}.sshkey");
|
||||||
Args = "fetch --progress --verbose ";
|
Args = "fetch --progress --verbose ";
|
||||||
|
|
||||||
if (prune)
|
|
||||||
Args += "--prune ";
|
|
||||||
|
|
||||||
if (noTags)
|
if (noTags)
|
||||||
Args += "--no-tags ";
|
Args += "--no-tags ";
|
||||||
else
|
else
|
||||||
|
|
|
@ -24,9 +24,12 @@ namespace SourceGit.Models
|
||||||
set => SetProperty(ref _content, value);
|
set => SetProperty(ref _content, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Apply(List<Change> changes)
|
public string Apply(Branch branch, List<Change> changes)
|
||||||
{
|
{
|
||||||
var content = _content.Replace("${files_num}", $"{changes.Count}");
|
var content = _content
|
||||||
|
.Replace("${files_num}", $"{changes.Count}")
|
||||||
|
.Replace("${branch_name}", branch.Name);
|
||||||
|
|
||||||
var matches = REG_COMMIT_TEMPLATE_FILES().Matches(content);
|
var matches = REG_COMMIT_TEMPLATE_FILES().Matches(content);
|
||||||
if (matches.Count == 0)
|
if (matches.Count == 0)
|
||||||
return content;
|
return content;
|
||||||
|
|
|
@ -70,12 +70,6 @@ namespace SourceGit.Models
|
||||||
set;
|
set;
|
||||||
} = true;
|
} = true;
|
||||||
|
|
||||||
public bool AutoStageBeforeCommit
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
} = false;
|
|
||||||
|
|
||||||
public AvaloniaList<string> Filters
|
public AvaloniaList<string> Filters
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
|
|
|
@ -243,7 +243,6 @@
|
||||||
<x:String x:Key="Text.Fetch" xml:space="preserve">Fetch</x:String>
|
<x:String x:Key="Text.Fetch" xml:space="preserve">Fetch</x:String>
|
||||||
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">Alle Remotes fetchen</x:String>
|
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">Alle Remotes fetchen</x:String>
|
||||||
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">Ohne Tags fetchen</x:String>
|
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">Ohne Tags fetchen</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Prune" xml:space="preserve">Alle verwaisten Branches entfernen</x:String>
|
|
||||||
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">Remote:</x:String>
|
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">Remote:</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">Remote-Änderungen fetchen</x:String>
|
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">Remote-Änderungen fetchen</x:String>
|
||||||
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">Als unverändert annehmen</x:String>
|
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">Als unverändert annehmen</x:String>
|
||||||
|
@ -622,7 +621,6 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">Ignoriere Dateien im selben Ordner</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">Ignoriere Dateien im selben Ordner</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">Ignoriere nur diese Datei</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">Ignoriere nur diese Datei</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">Amend</x:String>
|
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">Amend</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AutoStage" xml:space="preserve">Auto-Stage</x:String>
|
|
||||||
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">Du kannst diese Datei jetzt stagen.</x:String>
|
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">Du kannst diese Datei jetzt stagen.</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">COMMIT</x:String>
|
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">COMMIT</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT & PUSH</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT & PUSH</x:String>
|
||||||
|
|
|
@ -247,7 +247,6 @@
|
||||||
<x:String x:Key="Text.Fetch" xml:space="preserve">Fetch</x:String>
|
<x:String x:Key="Text.Fetch" xml:space="preserve">Fetch</x:String>
|
||||||
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">Fetch all remotes</x:String>
|
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">Fetch all remotes</x:String>
|
||||||
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">Fetch without tags</x:String>
|
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">Fetch without tags</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Prune" xml:space="preserve">Prune remote dead branches</x:String>
|
|
||||||
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">Remote:</x:String>
|
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">Remote:</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">Fetch Remote Changes</x:String>
|
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">Fetch Remote Changes</x:String>
|
||||||
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">Assume unchanged</x:String>
|
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">Assume unchanged</x:String>
|
||||||
|
@ -631,13 +630,13 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">Ignore files in the same folder</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">Ignore files in the same folder</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">Ignore this file only</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">Ignore this file only</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">Amend</x:String>
|
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">Amend</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AutoStage" xml:space="preserve">Auto-Stage</x:String>
|
|
||||||
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">You can stage this file now.</x:String>
|
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">You can stage this file now.</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">COMMIT</x:String>
|
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">COMMIT</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT & PUSH</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT & PUSH</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">Template/Histories</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">Template/Histories</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitTip" xml:space="preserve">Trigger click event</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitTip" xml:space="preserve">Trigger click event</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">Stage all changes and commit</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">Stage all changes and commit</x:String>
|
||||||
|
<x:String x:Key="Text.WorkingCopy.ConfirmCommitWithoutFiles" xml:space="preserve">Empty commit detected! Do you want to continue (--allow-empty)?</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Conflicts" xml:space="preserve">CONFLICTS DETECTED</x:String>
|
<x:String x:Key="Text.WorkingCopy.Conflicts" xml:space="preserve">CONFLICTS DETECTED</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Conflicts.Resolved" xml:space="preserve">FILE CONFLICTS ARE RESOLVED</x:String>
|
<x:String x:Key="Text.WorkingCopy.Conflicts.Resolved" xml:space="preserve">FILE CONFLICTS ARE RESOLVED</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">INCLUDE UNTRACKED FILES</x:String>
|
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">INCLUDE UNTRACKED FILES</x:String>
|
||||||
|
|
|
@ -229,7 +229,6 @@
|
||||||
<x:String x:Key="Text.Fetch" xml:space="preserve">Fetch</x:String>
|
<x:String x:Key="Text.Fetch" xml:space="preserve">Fetch</x:String>
|
||||||
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">Fetch toutes les branches distantes</x:String>
|
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">Fetch toutes les branches distantes</x:String>
|
||||||
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">Fetch sans les tags</x:String>
|
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">Fetch sans les tags</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Prune" xml:space="preserve">Élaguer les branches mortes distantes</x:String>
|
|
||||||
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">Remote :</x:String>
|
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">Remote :</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">Récupérer les changements distants</x:String>
|
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">Récupérer les changements distants</x:String>
|
||||||
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">Présumer inchangé</x:String>
|
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">Présumer inchangé</x:String>
|
||||||
|
@ -582,7 +581,6 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">Ignorer les fichiers dans le même dossier</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">Ignorer les fichiers dans le même dossier</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">N'ignorer que ce fichier</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">N'ignorer que ce fichier</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">Amender</x:String>
|
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">Amender</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AutoStage" xml:space="preserve">Auto-Index</x:String>
|
|
||||||
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">Vous pouvez indexer ce fichier.</x:String>
|
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">Vous pouvez indexer ce fichier.</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">COMMIT</x:String>
|
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">COMMIT</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT & PUSH</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT & PUSH</x:String>
|
||||||
|
|
|
@ -225,7 +225,6 @@
|
||||||
<x:String x:Key="Text.Fetch" xml:space="preserve">Buscar</x:String>
|
<x:String x:Key="Text.Fetch" xml:space="preserve">Buscar</x:String>
|
||||||
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">Buscar todos os remotos</x:String>
|
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">Buscar todos os remotos</x:String>
|
||||||
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">Buscar sem tags</x:String>
|
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">Buscar sem tags</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Prune" xml:space="preserve">Prune remotos mortos</x:String>
|
|
||||||
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">Remoto:</x:String>
|
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">Remoto:</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">Buscar Alterações Remotas</x:String>
|
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">Buscar Alterações Remotas</x:String>
|
||||||
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">Assumir não alterado</x:String>
|
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">Assumir não alterado</x:String>
|
||||||
|
@ -575,7 +574,6 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">Ignorar arquivos na mesma pasta</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">Ignorar arquivos na mesma pasta</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">Ignorar apenas este arquivo</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">Ignorar apenas este arquivo</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">Corrigir</x:String>
|
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">Corrigir</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AutoStage" xml:space="preserve">Auto-Stage</x:String>
|
|
||||||
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">Você pode stagear este arquivo agora.</x:String>
|
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">Você pode stagear este arquivo agora.</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">COMMIT</x:String>
|
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">COMMIT</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT & PUSH</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">COMMIT & PUSH</x:String>
|
||||||
|
|
|
@ -251,7 +251,6 @@
|
||||||
<x:String x:Key="Text.Fetch" xml:space="preserve">Извлечь</x:String>
|
<x:String x:Key="Text.Fetch" xml:space="preserve">Извлечь</x:String>
|
||||||
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">Извлечь все внешние хранилища</x:String>
|
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">Извлечь все внешние хранилища</x:String>
|
||||||
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">Извлечь без меток</x:String>
|
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">Извлечь без меток</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Prune" xml:space="preserve">Удалить внешние мёртвые ветки</x:String>
|
|
||||||
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">Внешнее хранилище:</x:String>
|
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">Внешнее хранилище:</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">Извлечь внешние изменения</x:String>
|
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">Извлечь внешние изменения</x:String>
|
||||||
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">Допустить без изменений</x:String>
|
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">Допустить без изменений</x:String>
|
||||||
|
@ -634,7 +633,6 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">Игнорировать файлы в том же каталоге</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">Игнорировать файлы в том же каталоге</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">Игнорировать только эти файлы</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">Игнорировать только эти файлы</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">Изменить</x:String>
|
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">Изменить</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AutoStage" xml:space="preserve">Автоподготовка</x:String>
|
|
||||||
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">Теперь вы можете подготовитть этот файл.</x:String>
|
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">Теперь вы можете подготовитть этот файл.</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">ЗАФИКСИРОВАТЬ</x:String>
|
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">ЗАФИКСИРОВАТЬ</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">ЗАФИКСИРОВАТЬ и ОТПРАВИТЬ</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">ЗАФИКСИРОВАТЬ и ОТПРАВИТЬ</x:String>
|
||||||
|
|
|
@ -250,7 +250,6 @@
|
||||||
<x:String x:Key="Text.Fetch" xml:space="preserve">拉取(fetch)</x:String>
|
<x:String x:Key="Text.Fetch" xml:space="preserve">拉取(fetch)</x:String>
|
||||||
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">拉取所有的远程仓库</x:String>
|
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">拉取所有的远程仓库</x:String>
|
||||||
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">不拉取远程标签</x:String>
|
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">不拉取远程标签</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Prune" xml:space="preserve">自动清理远程已删除分支</x:String>
|
|
||||||
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">远程仓库 :</x:String>
|
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">远程仓库 :</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">拉取远程仓库内容</x:String>
|
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">拉取远程仓库内容</x:String>
|
||||||
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">不跟踪此文件的更改</x:String>
|
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">不跟踪此文件的更改</x:String>
|
||||||
|
@ -629,13 +628,13 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">忽略同目录下所有文件</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">忽略同目录下所有文件</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">忽略本文件</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">忽略本文件</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">修补(--amend)</x:String>
|
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">修补(--amend)</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AutoStage" xml:space="preserve">自动暂存</x:String>
|
|
||||||
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">现在您已可将其加入暂存区中</x:String>
|
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">现在您已可将其加入暂存区中</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">提交</x:String>
|
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">提交</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">提交并推送</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">提交并推送</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">历史输入/模板</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">历史输入/模板</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitTip" xml:space="preserve">触发点击事件</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitTip" xml:space="preserve">触发点击事件</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">自动暂存所有变更并提交</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">自动暂存所有变更并提交</x:String>
|
||||||
|
<x:String x:Key="Text.WorkingCopy.ConfirmCommitWithoutFiles" xml:space="preserve">提交未包含变更文件!是否继续(--allow-empty)?</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Conflicts" xml:space="preserve">检测到冲突</x:String>
|
<x:String x:Key="Text.WorkingCopy.Conflicts" xml:space="preserve">检测到冲突</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Conflicts.Resolved" xml:space="preserve">文件冲突已解决</x:String>
|
<x:String x:Key="Text.WorkingCopy.Conflicts.Resolved" xml:space="preserve">文件冲突已解决</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">显示未跟踪文件</x:String>
|
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">显示未跟踪文件</x:String>
|
||||||
|
|
|
@ -250,7 +250,6 @@
|
||||||
<x:String x:Key="Text.Fetch" xml:space="preserve">提取 (fetch)</x:String>
|
<x:String x:Key="Text.Fetch" xml:space="preserve">提取 (fetch)</x:String>
|
||||||
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">提取所有的遠端存放庫</x:String>
|
<x:String x:Key="Text.Fetch.AllRemotes" xml:space="preserve">提取所有的遠端存放庫</x:String>
|
||||||
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">不提取遠端標籤</x:String>
|
<x:String x:Key="Text.Fetch.NoTags" xml:space="preserve">不提取遠端標籤</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Prune" xml:space="preserve">自動清理遠端已刪除分支</x:String>
|
|
||||||
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">遠端存放庫:</x:String>
|
<x:String x:Key="Text.Fetch.Remote" xml:space="preserve">遠端存放庫:</x:String>
|
||||||
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">提取遠端存放庫內容</x:String>
|
<x:String x:Key="Text.Fetch.Title" xml:space="preserve">提取遠端存放庫內容</x:String>
|
||||||
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">不追蹤此檔案的變更</x:String>
|
<x:String x:Key="Text.FileCM.AssumeUnchanged" xml:space="preserve">不追蹤此檔案的變更</x:String>
|
||||||
|
@ -634,13 +633,13 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">忽略同路徑下所有檔案</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.InSameFolder" xml:space="preserve">忽略同路徑下所有檔案</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">忽略本檔案</x:String>
|
<x:String x:Key="Text.WorkingCopy.AddToGitIgnore.SingleFile" xml:space="preserve">忽略本檔案</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">修補 (--amend)</x:String>
|
<x:String x:Key="Text.WorkingCopy.Amend" xml:space="preserve">修補 (--amend)</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.AutoStage" xml:space="preserve">自動暫存</x:String>
|
|
||||||
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">現在您已可將其加入暫存區中</x:String>
|
<x:String x:Key="Text.WorkingCopy.CanStageTip" xml:space="preserve">現在您已可將其加入暫存區中</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">提 交</x:String>
|
<x:String x:Key="Text.WorkingCopy.Commit" xml:space="preserve">提 交</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">提交並推送</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitAndPush" xml:space="preserve">提交並推送</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">歷史輸入/範本</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitMessageHelper" xml:space="preserve">歷史輸入/範本</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitTip" xml:space="preserve">觸發點擊事件</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitTip" xml:space="preserve">觸發點擊事件</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">自動暫存全部變更並提交</x:String>
|
<x:String x:Key="Text.WorkingCopy.CommitWithAutoStage" xml:space="preserve">自動暫存全部變更並提交</x:String>
|
||||||
|
<x:String x:Key="Text.WorkingCopy.ConfirmCommitWithoutFiles" xml:space="preserve">提交未包含變更檔案!是否繼續(--allow-empty)?</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Conflicts" xml:space="preserve">檢測到衝突</x:String>
|
<x:String x:Key="Text.WorkingCopy.Conflicts" xml:space="preserve">檢測到衝突</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Conflicts.Resolved" xml:space="preserve">檔案衝突已解決</x:String>
|
<x:String x:Key="Text.WorkingCopy.Conflicts.Resolved" xml:space="preserve">檔案衝突已解決</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">顯示未追蹤檔案</x:String>
|
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">顯示未追蹤檔案</x:String>
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
SetProgressDescription("Fetching from added remote ...");
|
SetProgressDescription("Fetching from added remote ...");
|
||||||
new Commands.Config(_repo.FullPath).Set($"remote.{_name}.sshkey", _useSSH ? SSHKey : null);
|
new Commands.Config(_repo.FullPath).Set($"remote.{_name}.sshkey", _useSSH ? SSHKey : null);
|
||||||
new Commands.Fetch(_repo.FullPath, _name, true, false, SetProgressDescription).Exec();
|
new Commands.Fetch(_repo.FullPath, _name, false, SetProgressDescription).Exec();
|
||||||
}
|
}
|
||||||
CallUIThread(() =>
|
CallUIThread(() =>
|
||||||
{
|
{
|
||||||
|
|
19
src/ViewModels/ConfirmCommitWithoutFiles.cs
Normal file
19
src/ViewModels/ConfirmCommitWithoutFiles.cs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,12 +22,6 @@ namespace SourceGit.ViewModels
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Prune
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
} = true;
|
|
||||||
|
|
||||||
public bool NoTags
|
public bool NoTags
|
||||||
{
|
{
|
||||||
get => _repo.Settings.FetchWithoutTags;
|
get => _repo.Settings.FetchWithoutTags;
|
||||||
|
@ -53,13 +47,13 @@ namespace SourceGit.ViewModels
|
||||||
foreach (var remote in _repo.Remotes)
|
foreach (var remote in _repo.Remotes)
|
||||||
{
|
{
|
||||||
SetProgressDescription($"Fetching remote: {remote.Name}");
|
SetProgressDescription($"Fetching remote: {remote.Name}");
|
||||||
new Commands.Fetch(_repo.FullPath, remote.Name, Prune, NoTags, SetProgressDescription).Exec();
|
new Commands.Fetch(_repo.FullPath, remote.Name, NoTags, SetProgressDescription).Exec();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetProgressDescription($"Fetching remote: {SelectedRemote.Name}");
|
SetProgressDescription($"Fetching remote: {SelectedRemote.Name}");
|
||||||
new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, Prune, NoTags, SetProgressDescription).Exec();
|
new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, NoTags, SetProgressDescription).Exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
CallUIThread(() =>
|
CallUIThread(() =>
|
||||||
|
|
|
@ -147,7 +147,7 @@ namespace SourceGit.ViewModels
|
||||||
if (FetchAllBranches)
|
if (FetchAllBranches)
|
||||||
{
|
{
|
||||||
SetProgressDescription($"Fetching remote: {_selectedRemote.Name}...");
|
SetProgressDescription($"Fetching remote: {_selectedRemote.Name}...");
|
||||||
rs = new Commands.Fetch(_repo.FullPath, _selectedRemote.Name, false, NoTags, SetProgressDescription).Exec();
|
rs = new Commands.Fetch(_repo.FullPath, _selectedRemote.Name, NoTags, SetProgressDescription).Exec();
|
||||||
if (!rs)
|
if (!rs)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -2114,7 +2114,7 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
IsAutoFetching = true;
|
IsAutoFetching = true;
|
||||||
Dispatcher.UIThread.Invoke(() => OnPropertyChanged(nameof(IsAutoFetching)));
|
Dispatcher.UIThread.Invoke(() => OnPropertyChanged(nameof(IsAutoFetching)));
|
||||||
new Commands.Fetch(_fullpath, "--all", true, false, null) { RaiseError = false }.Exec();
|
new Commands.Fetch(_fullpath, "--all", false, null) { RaiseError = false }.Exec();
|
||||||
_lastFetchTime = DateTime.Now;
|
_lastFetchTime = DateTime.Now;
|
||||||
IsAutoFetching = false;
|
IsAutoFetching = false;
|
||||||
Dispatcher.UIThread.Invoke(() => OnPropertyChanged(nameof(IsAutoFetching)));
|
Dispatcher.UIThread.Invoke(() => OnPropertyChanged(nameof(IsAutoFetching)));
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
return Task.Run(() =>
|
return Task.Run(() =>
|
||||||
{
|
{
|
||||||
var succ = new Commands.Commit(_repo.FullPath, _message, true, true).Exec();
|
var succ = new Commands.Commit(_repo.FullPath, _message, true).Exec();
|
||||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||||
return succ;
|
return succ;
|
||||||
});
|
});
|
||||||
|
|
|
@ -79,12 +79,6 @@ namespace SourceGit.ViewModels
|
||||||
private set => SetProperty(ref _isCommitting, value);
|
private set => SetProperty(ref _isCommitting, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AutoStageBeforeCommit
|
|
||||||
{
|
|
||||||
get => _repo.Settings.AutoStageBeforeCommit;
|
|
||||||
set => _repo.Settings.AutoStageBeforeCommit = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool UseAmend
|
public bool UseAmend
|
||||||
{
|
{
|
||||||
get => _useAmend;
|
get => _useAmend;
|
||||||
|
@ -416,17 +410,22 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
public void Commit()
|
public void Commit()
|
||||||
{
|
{
|
||||||
DoCommit(AutoStageBeforeCommit, false);
|
DoCommit(false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CommitWithAutoStage()
|
public void CommitWithAutoStage()
|
||||||
{
|
{
|
||||||
DoCommit(true, false);
|
DoCommit(true, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CommitWithPush()
|
public void CommitWithPush()
|
||||||
{
|
{
|
||||||
DoCommit(AutoStageBeforeCommit, true);
|
DoCommit(false, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CommitWithoutFiles(bool autoPush)
|
||||||
|
{
|
||||||
|
DoCommit(false, autoPush, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContextMenu CreateContextMenuForUnstagedChanges()
|
public ContextMenu CreateContextMenuForUnstagedChanges()
|
||||||
|
@ -1158,7 +1157,7 @@ namespace SourceGit.ViewModels
|
||||||
item.Icon = App.CreateMenuIcon("Icons.Code");
|
item.Icon = App.CreateMenuIcon("Icons.Code");
|
||||||
item.Click += (_, e) =>
|
item.Click += (_, e) =>
|
||||||
{
|
{
|
||||||
CommitMessage = template.Apply(_staged);
|
CommitMessage = template.Apply(_repo.CurrentBranch, _staged);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
menu.Items.Add(item);
|
menu.Items.Add(item);
|
||||||
|
@ -1274,7 +1273,7 @@ namespace SourceGit.ViewModels
|
||||||
_repo.SetWatcherEnabled(true);
|
_repo.SetWatcherEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DoCommit(bool autoStage, bool autoPush)
|
private void DoCommit(bool autoStage, bool autoPush, bool allowEmpty)
|
||||||
{
|
{
|
||||||
if (!PopupHost.CanCreatePopup())
|
if (!PopupHost.CanCreatePopup())
|
||||||
{
|
{
|
||||||
|
@ -1288,25 +1287,18 @@ namespace SourceGit.ViewModels
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_useAmend)
|
if (!_useAmend && !allowEmpty)
|
||||||
{
|
{
|
||||||
if (autoStage)
|
if ((autoStage && _count == 0) || (!autoStage && _staged.Count == 0))
|
||||||
{
|
{
|
||||||
if (_count == 0)
|
App.OpenDialog(new Views.ConfirmCommitWithoutFiles()
|
||||||
{
|
{
|
||||||
App.RaiseException(_repo.FullPath, "No files added to commit!");
|
DataContext = new ConfirmCommitWithoutFiles(this, autoPush)
|
||||||
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (_staged.Count == 0)
|
|
||||||
{
|
|
||||||
App.RaiseException(_repo.FullPath, "No files added to commit!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IsCommitting = true;
|
IsCommitting = true;
|
||||||
_repo.Settings.PushCommitMessage(_commitMessage);
|
_repo.Settings.PushCommitMessage(_commitMessage);
|
||||||
|
|
74
src/Views/ConfirmCommitWithoutFiles.axaml
Normal file
74
src/Views/ConfirmCommitWithoutFiles.axaml
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
<v:ChromelessWindow xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
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:Name="ThisControl"
|
||||||
|
Icon="/App.ico"
|
||||||
|
Title="{DynamicResource Text.Warn}"
|
||||||
|
SizeToContent="WidthAndHeight"
|
||||||
|
CanResize="False"
|
||||||
|
WindowStartupLocation="CenterOwner">
|
||||||
|
<Grid RowDefinitions="Auto,Auto,Auto">
|
||||||
|
<!-- TitleBar -->
|
||||||
|
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" Height="30" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
|
||||||
|
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||||
|
Background="{DynamicResource Brush.TitleBar}"
|
||||||
|
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border0}"
|
||||||
|
PointerPressed="BeginMoveWindow"/>
|
||||||
|
|
||||||
|
<Path Grid.Column="0"
|
||||||
|
Width="14" Height="14"
|
||||||
|
Data="{StaticResource Icons.Error}"
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
IsVisible="{OnPlatform True, macOS=False}"/>
|
||||||
|
|
||||||
|
<v:CaptionButtonsMacOS Grid.Column="0"
|
||||||
|
Margin="0,2,0,0"
|
||||||
|
IsCloseButtonOnly="True"
|
||||||
|
IsVisible="{OnPlatform False, macOS=True}"/>
|
||||||
|
|
||||||
|
<TextBlock Grid.Column="0" Grid.ColumnSpan="3"
|
||||||
|
Classes="bold"
|
||||||
|
Text="{DynamicResource Text.Warn}"
|
||||||
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||||
|
IsHitTestVisible="False"/>
|
||||||
|
|
||||||
|
<v:CaptionButtons Grid.Column="2"
|
||||||
|
IsCloseButtonOnly="True"
|
||||||
|
IsVisible="{OnPlatform True, macOS=False}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Body -->
|
||||||
|
<Border Grid.Row="1" Margin="16">
|
||||||
|
<TextBlock Text="{DynamicResource Text.WorkingCopy.ConfirmCommitWithoutFiles}"/>
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<!-- Buttons -->
|
||||||
|
<StackPanel Grid.Row="2" Margin="0,0,0,16" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
|
<Button Classes="flat"
|
||||||
|
Width="80"
|
||||||
|
Height="30"
|
||||||
|
Margin="4,0"
|
||||||
|
Click="Sure"
|
||||||
|
Content="{DynamicResource Text.Sure}"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"/>
|
||||||
|
|
||||||
|
<Button Classes="flat primary"
|
||||||
|
Width="80"
|
||||||
|
Height="30"
|
||||||
|
Margin="4,0"
|
||||||
|
Click="CloseWindow"
|
||||||
|
Content="{DynamicResource Text.Cancel}"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
VerticalContentAlignment="Center"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</v:ChromelessWindow>
|
33
src/Views/ConfirmCommitWithoutFiles.axaml.cs
Normal file
33
src/Views/ConfirmCommitWithoutFiles.axaml.cs
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
using Avalonia.Input;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
|
|
||||||
|
namespace SourceGit.Views
|
||||||
|
{
|
||||||
|
public partial class ConfirmCommitWithoutFiles : ChromelessWindow
|
||||||
|
{
|
||||||
|
public ConfirmCommitWithoutFiles()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BeginMoveWindow(object _, PointerPressedEventArgs e)
|
||||||
|
{
|
||||||
|
BeginMoveDrag(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Sure(object _1, RoutedEventArgs _2)
|
||||||
|
{
|
||||||
|
if (DataContext is ViewModels.ConfirmCommitWithoutFiles vm)
|
||||||
|
{
|
||||||
|
vm.Continue();
|
||||||
|
}
|
||||||
|
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CloseWindow(object _1, RoutedEventArgs _2)
|
||||||
|
{
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,7 +16,7 @@
|
||||||
SizeToContent="Height"
|
SizeToContent="Height"
|
||||||
CanResize="False"
|
CanResize="False"
|
||||||
WindowStartupLocation="CenterOwner">
|
WindowStartupLocation="CenterOwner">
|
||||||
<Grid RowDefinitions="Auto,Auto,Auto" MinWidth="494">
|
<Grid RowDefinitions="Auto,Auto,Auto">
|
||||||
<!-- TitleBar -->
|
<!-- TitleBar -->
|
||||||
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" Height="30" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
|
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto" Height="30" IsVisible="{Binding !#ThisControl.UseSystemWindowFrame}">
|
||||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<TextBlock FontSize="18"
|
<TextBlock FontSize="18"
|
||||||
Classes="bold"
|
Classes="bold"
|
||||||
Text="{DynamicResource Text.Fetch.Title}"/>
|
Text="{DynamicResource Text.Fetch.Title}"/>
|
||||||
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32,32" ColumnDefinitions="120,*">
|
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32" ColumnDefinitions="120,*">
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||||
Margin="0,0,8,0"
|
Margin="0,0,8,0"
|
||||||
|
@ -37,10 +37,6 @@
|
||||||
IsChecked="{Binding FetchAllRemotes, Mode=TwoWay}"/>
|
IsChecked="{Binding FetchAllRemotes, Mode=TwoWay}"/>
|
||||||
|
|
||||||
<CheckBox Grid.Row="2" Grid.Column="1"
|
<CheckBox Grid.Row="2" Grid.Column="1"
|
||||||
Content="{DynamicResource Text.Fetch.Prune}"
|
|
||||||
IsChecked="{Binding Prune, Mode=TwoWay}"/>
|
|
||||||
|
|
||||||
<CheckBox Grid.Row="3" Grid.Column="1"
|
|
||||||
Content="{DynamicResource Text.Fetch.NoTags}"
|
Content="{DynamicResource Text.Fetch.NoTags}"
|
||||||
IsChecked="{Binding NoTags, Mode=TwoWay}"/>
|
IsChecked="{Binding NoTags, Mode=TwoWay}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
@ -227,7 +227,7 @@
|
||||||
<TextBlock Margin="0,12,0,0" Text="{DynamicResource Text.Configure.CommitMessageTemplate.Content}"/>
|
<TextBlock Margin="0,12,0,0" Text="{DynamicResource Text.Configure.CommitMessageTemplate.Content}"/>
|
||||||
<v:CommitMessageTextBox Margin="0,4,0,0" Height="100" Text="{Binding Content, Mode=TwoWay}"/>
|
<v:CommitMessageTextBox Margin="0,4,0,0" Height="100" Text="{Binding Content, Mode=TwoWay}"/>
|
||||||
<TextBlock Margin="0,2,0,0"
|
<TextBlock Margin="0,2,0,0"
|
||||||
Text="You can use ${files_num}, ${files} and ${files:N} where N is the max number of file paths to output."
|
Text="You can use ${files_num}, ${branch_name}, ${files} and ${files:N} where N is the max number of file paths to output."
|
||||||
Foreground="{DynamicResource Brush.FG2}"
|
Foreground="{DynamicResource Brush.FG2}"
|
||||||
TextWrapping="Wrap"/>
|
TextWrapping="Wrap"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
|
@ -185,7 +185,7 @@
|
||||||
<v:CommitMessageTextBox Grid.Row="2" Text="{Binding CommitMessage, Mode=TwoWay}"/>
|
<v:CommitMessageTextBox Grid.Row="2" Text="{Binding CommitMessage, Mode=TwoWay}"/>
|
||||||
|
|
||||||
<!-- Commit Options -->
|
<!-- Commit Options -->
|
||||||
<Grid Grid.Row="3" Margin="0,6,0,0" ColumnDefinitions="Auto,Auto,Auto,Auto,Auto,*,Auto,Auto,Auto,Auto">
|
<Grid Grid.Row="3" Margin="0,6,0,0" ColumnDefinitions="Auto,Auto,Auto,Auto,*,Auto,Auto,Auto,Auto">
|
||||||
<Button Grid.Column="0"
|
<Button Grid.Column="0"
|
||||||
Classes="icon_button"
|
Classes="icon_button"
|
||||||
Margin="4,0,0,0" Padding="0"
|
Margin="4,0,0,0" Padding="0"
|
||||||
|
@ -217,22 +217,15 @@
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<CheckBox Grid.Column="3"
|
<CheckBox Grid.Column="3"
|
||||||
Height="24"
|
|
||||||
Margin="4,0,0,0"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
IsChecked="{Binding AutoStageBeforeCommit, Mode=TwoWay}"
|
|
||||||
Content="{DynamicResource Text.WorkingCopy.AutoStage}"/>
|
|
||||||
|
|
||||||
<CheckBox Grid.Column="4"
|
|
||||||
Height="24"
|
Height="24"
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
IsChecked="{Binding UseAmend, Mode=TwoWay}"
|
IsChecked="{Binding UseAmend, Mode=TwoWay}"
|
||||||
Content="{DynamicResource Text.WorkingCopy.Amend}"/>
|
Content="{DynamicResource Text.WorkingCopy.Amend}"/>
|
||||||
|
|
||||||
<v:LoadingIcon Grid.Column="6" Width="18" Height="18" IsVisible="{Binding IsCommitting}"/>
|
<v:LoadingIcon Grid.Column="5" Width="18" Height="18" IsVisible="{Binding IsCommitting}"/>
|
||||||
|
|
||||||
<Button Grid.Column="7"
|
<Button Grid.Column="6"
|
||||||
Classes="flat primary"
|
Classes="flat primary"
|
||||||
Content="{DynamicResource Text.WorkingCopy.Commit}"
|
Content="{DynamicResource Text.WorkingCopy.Commit}"
|
||||||
Height="28"
|
Height="28"
|
||||||
|
@ -257,13 +250,13 @@
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<!-- Invisible button just to add another hotkey `Ctrl+Shift+Enter` to commit with auto-stage -->
|
<!-- Invisible button just to add another hotkey `Ctrl+Shift+Enter` to commit with auto-stage -->
|
||||||
<Button Grid.Column="8"
|
<Button Grid.Column="7"
|
||||||
Width="0" Height="0"
|
Width="0" Height="0"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
Command="{Binding CommitWithAutoStage}"
|
Command="{Binding CommitWithAutoStage}"
|
||||||
HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"/>
|
HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"/>
|
||||||
|
|
||||||
<Button Grid.Column="9"
|
<Button Grid.Column="8"
|
||||||
Classes="flat"
|
Classes="flat"
|
||||||
Content="{DynamicResource Text.WorkingCopy.CommitAndPush}"
|
Content="{DynamicResource Text.WorkingCopy.CommitAndPush}"
|
||||||
Height="28"
|
Height="28"
|
||||||
|
|
Loading…
Reference in a new issue