From 89bc8a7e06db5f54766a46466151cdee846f78ee Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 23 Oct 2025 14:49:48 +0800 Subject: [PATCH] feature: add original pick-order for commits in `Interactive Rebase` window (#1676) Signed-off-by: leo --- src/ViewModels/InteractiveRebase.cs | 10 ++++++++-- src/Views/InteractiveRebase.axaml | 20 ++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/ViewModels/InteractiveRebase.cs b/src/ViewModels/InteractiveRebase.cs index 719b8354..5e88ce51 100644 --- a/src/ViewModels/InteractiveRebase.cs +++ b/src/ViewModels/InteractiveRebase.cs @@ -15,6 +15,11 @@ namespace SourceGit.ViewModels public class InteractiveRebaseItem : ObservableObject { + public int OriginalOrder + { + get; + } + public Models.Commit Commit { get; @@ -59,8 +64,9 @@ namespace SourceGit.ViewModels } } - public InteractiveRebaseItem(Models.Commit c, string message, bool canSquashOrFixup) + public InteractiveRebaseItem(int order, Models.Commit c, string message, bool canSquashOrFixup) { + OriginalOrder = order; Commit = c; FullMessage = message; CanSquashOrFixup = canSquashOrFixup; @@ -142,7 +148,7 @@ namespace SourceGit.ViewModels for (var i = 0; i < commits.Count; i++) { var c = commits[i]; - list.Add(new InteractiveRebaseItem(c.Commit, c.Message, i < commits.Count - 1)); + list.Add(new InteractiveRebaseItem(commits.Count - i, c.Commit, c.Message, i < commits.Count - 1)); } var selected = list.Count > 0 ? list[0] : null; diff --git a/src/Views/InteractiveRebase.axaml b/src/Views/InteractiveRebase.axaml index 1c9ed42e..86561d81 100644 --- a/src/Views/InteractiveRebase.axaml +++ b/src/Views/InteractiveRebase.axaml @@ -84,6 +84,7 @@ + @@ -111,8 +112,15 @@ VerticalAlignment="Center"/> + + + - - +