Skip to content

Fix the false "Multiple commits are selected" message - #753

Merged
hannesa2 merged 3 commits into
masterfrom
fix-stuck-multiple-commits-message
Oct 3, 2026
Merged

hannesa2 merged 3 commits into
masterfrom
fix-stuck-multiple-commits-message

Conversation

@goneng

@goneng goneng commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Stop the history view showing "Multiple commits are selected" while a
single commit is highlighted.

  • Clear the previous load in PBGitRevList as soon as a new one starts.
    A second history update arriving before the first chunk of the new
    load re-graphed the old list and then had the new load appended to it,
    so every commit was in the list twice. Picking a commit by ID then
    selected both copies.
  • Forget the remembered commit when the multiple-selection message is
    shown, so selecting the previously shown commit loads its details
    again instead of leaving the message on screen.

Test plan:

  • With the old code, forcing two history updates back to back on a
    clone of GitX took the list from 3764 to 7528 commits. With the fix
    it stays at 3764.
  • Not yet checked in the real rebase and branch workflow; the trigger
    is GitX's own double update, which I could not produce from outside
    the app.

@goneng
goneng marked this pull request as ready for review October 3, 2026 14:34
@goneng
goneng force-pushed the fix-stuck-multiple-commits-message branch from 3f8609a to c1b7e7a Compare October 3, 2026 14:51
goneng added 3 commits October 3, 2026 19:30
Reset the remembered commit when the multiple-selection message is
shown, so selecting the commit shown before it loads the details again.

- Clear currentOID in changeContentToMultipleSelectionMessage.
- Without it, selecting the previously shown commit only reloaded its
  ref labels and left the message on screen.
Clear the revision list as soon as a new load starts, so a second
update arriving before the first chunk cannot re-graph the previous
load.

- Replace the lazy resetCommits flag in PBGitRevList with an immediate
  reset in loadRevisionsWithCompletionBlock.
- Without it, the old commits were graphed again and the new load was
  appended after them, so selecting a commit selected both copies and
  showed "Multiple commits are selected".
Start the rev list tests from the cleared array a load now creates,
and cover that a new load clears the previous commits at once.

- Drop the removed resetCommits property from the test category.
- Add a test that starting a load empties the earlier commits.
@goneng
goneng force-pushed the fix-stuck-multiple-commits-message branch from c1b7e7a to 303e7f6 Compare October 3, 2026 16:31
@hannesa2
hannesa2 merged commit 1e2ca43 into master Oct 3, 2026
3 checks passed
@hannesa2
hannesa2 deleted the fix-stuck-multiple-commits-message branch October 3, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants