mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
7070a07e15
* 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
30 lines
875 B
C#
30 lines
875 B
C#
using System.Diagnostics;
|
|
|
|
namespace SourceGit.Commands
|
|
{
|
|
public class Rebase : Command
|
|
{
|
|
public Rebase(string repo, string basedOn, bool autoStash)
|
|
{
|
|
WorkingDirectory = repo;
|
|
Context = repo;
|
|
Args = "rebase ";
|
|
if (autoStash)
|
|
Args += "--autostash ";
|
|
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}";
|
|
}
|
|
}
|
|
}
|