refactor: commandline parsing

* `--rebase-todo-editor` launches this app as a git `sequence.editor`
* `--rebase-message-editor` launches this app as a git `core.editor` which runs on background by reading rebasing jobs
* `--core-editor` launches this app as a git `core.editor`
* `--askpass` launches this app as a SSH askpass program
This commit is contained in:
leo 2024-07-09 10:16:15 +08:00
parent cbe4c36525
commit 6930b51c64
No known key found for this signature in database
14 changed files with 320 additions and 155 deletions

View file

@ -168,18 +168,18 @@ namespace SourceGit.ViewModels
_repo.SetWatcherEnabled(false);
var saveFile = Path.Combine(_repo.GitDir, "sourcegit_rebase_jobs.json");
var jobs = new List<Models.InteractiveRebaseJob>();
var collection = new Models.InteractiveRebaseJobCollection();
for (int i = Items.Count - 1; i >= 0; i--)
{
var item = Items[i];
jobs.Add(new Models.InteractiveRebaseJob()
collection.Jobs.Add(new Models.InteractiveRebaseJob()
{
SHA = item.Commit.SHA,
Action = item.Action,
Message = item.FullMessage,
});
}
File.WriteAllText(saveFile, JsonSerializer.Serialize(jobs, JsonCodeGen.Default.ListInteractiveRebaseJob));
File.WriteAllText(saveFile, JsonSerializer.Serialize(collection, JsonCodeGen.Default.InteractiveRebaseJobCollection));
return Task.Run(() =>
{