mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
feature: simple interactive rebase support (#188)
* Only allow to start interactive rebase from merged commit in current branch * The order of commits in the interactive rebase window is as same as it's in histories page. * Unlike anthor git frontend app `Fork`, you should edit the final message on the last commit rather than the previous commit that will be meld into while squashing commits
This commit is contained in:
parent
6c9f7e6da3
commit
7070a07e15
17 changed files with 816 additions and 7 deletions
|
@ -43,9 +43,7 @@ namespace SourceGit.Commands
|
|||
|
||||
// Force using en_US.UTF-8 locale to avoid GCM crash
|
||||
if (OperatingSystem.IsLinux())
|
||||
{
|
||||
start.Environment.Add("LANG", "en_US.UTF-8");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(WorkingDirectory))
|
||||
start.WorkingDirectory = WorkingDirectory;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace SourceGit.Commands
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SourceGit.Commands
|
||||
{
|
||||
public class Rebase : Command
|
||||
{
|
||||
|
@ -12,4 +14,17 @@
|
|||
Args += basedOn;
|
||||
}
|
||||
}
|
||||
|
||||
public class InteractiveRebase : Command
|
||||
{
|
||||
public InteractiveRebase(string repo, string basedOn)
|
||||
{
|
||||
var exec = Process.GetCurrentProcess().MainModule.FileName;
|
||||
var editor = $"\\\"{exec}\\\" --rebase-editor";
|
||||
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = $"-c core.editor=\"{editor}\" -c sequence.editor=\"{editor}\" -c rebase.abbreviateCommands=true rebase -i --autosquash {basedOn}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue