Provide drag-and-drop functionality for index and working tree virtual commits (Log as main window)

George Bessonov 1 year ago 0

See also:



Allow to drag-and-drop index or working tree virtual commits so

  • if dropped on any other commit
    • if working tree is dragged and other commit is index, working tree gets staged
    • if index is dragged and other commit is working tree, index gets unstaged
    • for all of the other cases dragged commit gets squashed into other commit
  • if dropped between commits
    • 1. commit window appears
    • 2. when commit/commit & push pressed, appropriate commit gets created from dragged one
    • 3. if working tree/index is present after commit creation, it gets stashed
    • 4. new commit gets reordered via interactive rebase (this way commit doesn't get lost if reordering produces any conflicts)
    • 5. after interactive rebase is over
      • 5.1 apply and drop stash (stage it if the index was stashed) if step 3 was executed
      • 5.2 if rebase was aborted, reset temporary commit (--mixed if it was created from working tree, --soft otherwise)
      • 5.3 if rebase succeeded and commit&push option was selected, push