Skip to content

Commit c18d8af

Browse files
committed
Use a WithWaitingStatus for rewording a non-head commit
Rewording a commit at the beginning of a long branch can take very long; without this change, the commit message panel would stay visible with a blinking cursor during that time, which is very confusing. This has the slight downside that it will say "Rebasing" in the lower right corner until the operation is done; but we already have this problem when doing custom patch operations, or dropping changes from a commit, so it's not new, and we can think about how to fix all these another time.
1 parent eda65cb commit c18d8af

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

pkg/gui/controllers/local_commits_controller.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,13 @@ func (self *LocalCommitsController) handleReword(summary string, description str
415415
self.c.Tr.CommittingStatus, nil)
416416
}
417417

418-
err := self.c.Git().Rebase.RewordCommit(self.c.Model().Commits, self.c.Contexts().LocalCommits.GetSelectedLineIdx(), summary, description)
419-
if err != nil {
420-
return err
421-
}
422-
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC})
418+
return self.c.WithWaitingStatus(self.c.Tr.RewordingStatus, func(gocui.Task) error {
419+
err := self.c.Git().Rebase.RewordCommit(self.c.Model().Commits, self.c.Contexts().LocalCommits.GetSelectedLineIdx(), summary, description)
420+
if err != nil {
421+
return err
422+
}
423+
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC})
424+
})
423425
}
424426

425427
func (self *LocalCommitsController) doRewordEditor() error {

pkg/i18n/english.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ type TranslationSet struct {
384384
RedoingStatus string
385385
CheckingOutStatus string
386386
CommittingStatus string
387+
RewordingStatus string
387388
RevertingStatus string
388389
CreatingFixupCommitStatus string
389390
CommitFiles string
@@ -1425,6 +1426,7 @@ func EnglishTranslationSet() *TranslationSet {
14251426
RedoingStatus: "Redoing",
14261427
CheckingOutStatus: "Checking out",
14271428
CommittingStatus: "Committing",
1429+
RewordingStatus: "Rewording",
14281430
RevertingStatus: "Reverting",
14291431
CreatingFixupCommitStatus: "Creating fixup commit",
14301432
CommitFiles: "Commit files",

0 commit comments

Comments
 (0)