mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 13:14:59 +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
51
src/Converters/InteractiveRebaseActionConverters.cs
Normal file
51
src/Converters/InteractiveRebaseActionConverters.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Converters
|
||||
{
|
||||
public static class InteractiveRebaseActionConverters
|
||||
{
|
||||
public static readonly FuncValueConverter<Models.InteractiveRebaseAction, IBrush> ToIconBrush =
|
||||
new FuncValueConverter<Models.InteractiveRebaseAction, IBrush>(v =>
|
||||
{
|
||||
switch (v)
|
||||
{
|
||||
case Models.InteractiveRebaseAction.Pick:
|
||||
return Brushes.Green;
|
||||
case Models.InteractiveRebaseAction.Edit:
|
||||
return Brushes.Orange;
|
||||
case Models.InteractiveRebaseAction.Reword:
|
||||
return Brushes.Orange;
|
||||
case Models.InteractiveRebaseAction.Squash:
|
||||
return Brushes.LightGray;
|
||||
case Models.InteractiveRebaseAction.Fixup:
|
||||
return Brushes.LightGray;
|
||||
default:
|
||||
return Brushes.Red;
|
||||
}
|
||||
});
|
||||
|
||||
public static readonly FuncValueConverter<Models.InteractiveRebaseAction, string> ToName =
|
||||
new FuncValueConverter<Models.InteractiveRebaseAction, string>(v =>
|
||||
{
|
||||
switch (v)
|
||||
{
|
||||
case Models.InteractiveRebaseAction.Pick:
|
||||
return "Pick";
|
||||
case Models.InteractiveRebaseAction.Edit:
|
||||
return "Edit";
|
||||
case Models.InteractiveRebaseAction.Reword:
|
||||
return "Reword";
|
||||
case Models.InteractiveRebaseAction.Squash:
|
||||
return "Squash";
|
||||
case Models.InteractiveRebaseAction.Fixup:
|
||||
return "Fixup";
|
||||
default:
|
||||
return "Drop";
|
||||
}
|
||||
});
|
||||
|
||||
public static readonly FuncValueConverter<Models.InteractiveRebaseAction, bool> CanEditMessage =
|
||||
new FuncValueConverter<Models.InteractiveRebaseAction, bool>(v => v == Models.InteractiveRebaseAction.Reword || v == Models.InteractiveRebaseAction.Squash);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue