sourcegit: Editing a commit with an interactive rebase is not properly handled

Steps to reproduce:

  • Perform an interactive rebase
  • Choose Edit for a commit
  • Click on Start

What that does:

  • Good: It does perform an interactive rebase and stops at that commit so that the user can edit it
  • Good: There is a banner at the top saying that there is an ongoing rebase
  • Bad: The buttons in the banner are Resolve and Abort as if there was a conflict
    • There is no conflict to resolve, so the buttons should be Continue and Abort
    • I may be remembering this incorrectly but I think that this used to be handled properly until some weeks ago
  • Bad: In the Local Changes page, the Amend checkbox has disappeared, and the Commit and Commit & Push buttons are replaced by a Continue button and a menu with the option Commit (edit)
    • Editing is supposed to be like working on a branch, except that you cannot rebase because there is already a rebase going on. Some example of its uses: amending the edited commit, creating a new commit after the edited one, splitting the edited commit (and maybe also some before it) by resetting to an older commit then creating better commits with those changes. Then once you’re done, you tell the rebase to continue so that it applies the later commits on top of the changes
    • For that reason, the page should be as usual, allowing the user to stage/commit/amend
    • That being said, removing the Commit & Push button does make sense because pushing during a rebase is an error (although you could keep it and let the user deal with the error message), and renaming the Commit button to Commit (edit) is not a bad idea

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 19

Commits related to this issue

Most upvoted comments

If your whitespace is in start of subject or endof description, it will be trimmed. Otherwise, all the content will be writed into a temp file, then SourceGit will call git commit --file="TMP_MSG_FILE" <other params> to finish commit

Most of the error messages are reading from Process.ErrorDataReceived event handler, which will triggerer when there is a new line receviced from stderr, and if it is an empty string (blank line), SourceGit will just ignore it.

The Trim() in 59f11e9acaf5edbf6dad64565dd550e031f4aa67 and 6eb226eb4492d2fe6a05fb3162da0f782d3f5fc1 is only used for reading and displaying commit message (not writing).

If I may add the following issue while doing an interactive rebase: (btw thanks for implementing that!)

I want to reword some commit messages and when opening the edit field via the small pen icon then the whole previous commit message is squashed into the subject line. The screenshot shows what is seen immediately after opening the edit field:

Interactive_Rebase

A bit of experimenting shows, that this is due to SourceGit not handling LF (\n) only ending lines in these cases. E.g. when I’m writing a new commit message (with subject and body separated by blank line) in some external editor and ensure CR LF (\r\n) line breaks, then SourceGit automatically detects this and fills each field accordingly. When using only LF then not.

(Quiete strange too is that the old commit message was also written in SourceGit and while being messed up in the edit field is correctly previewed at the bottom.)

(I’m using SourceGit on Win 10.)

Fixed. You can download the latest CI build from Github Action.

I’ve pushed some modifications to develop.

image

  • Show the current head commit for cherry-pick
  • Show the stopped at commit for rebase
  • Add a SKIP button for cherry-pick and rebase
  • When there are no conflicts and no editing commits, why do you think the merge/rebase/cherry-pick/revert action will stop to wait user clicking the --continue button?
  • When the merge/rebase/cherry-pick/revert action stops and is waiting for user resolving conflicts or editing current commit, if we do NOT redirect user to the Local Changes, how do we let users know which file has conflicts? Or is the Local Changes page not the right page user editing commits?
  • For interactive rebase, if you choose multiple commits with edit, and when the rebasing goes to one of them, it will stop and wait for user editing the current one. If we do NOT take users to the LOCAL CHANGES, how do we let users known which commit is current processing? BTW, in this condition, the continue button is enabled because there’s no conflicts.