gitflow4idea icon indicating copy to clipboard operation
gitflow4idea copied to clipboard

Working tree contains unstaged changes

Open denisbondar opened this issue 6 years ago • 1 comments

  • I'm submitting a ...

    • [x] bug report
    • [ ] feature request
    • [ ] puppy => You're not submitting a puppy. I already have one and he's adorable
  • What is the current behavior? At the moment of closing the task with enabled options "commit changes" and "finish featue" (or hotfix, bugfix etc.) I got the error "Error: Please have a look at the Version Control console for more details".

After this I just finish feature manually.

  • Is this a bug? Sorry about that. If so give me explicit details how to reproduce:
  1. Open task in PHPStorm: Tools - Tasks & Contexts - Open Task...
  2. In Open Task windows select in VCS Operations - only create changelist, and in GitFlow operations - Create Feature (or Create Hotfix, etc.). Press OK.
  3. Do some changes
  4. Close task in PHPStorm: Tools - Tasks & Contexts - Close Active Task...
  5. In Close Task window select: Commit Changes and Finish Feature. Press OK.
  6. I see error in PHPStorm: Error: Please have a look at the Version Control console for more details
  7. In Version Control Console I see:
16:11:20.140: [project] git /usr/bin/git -c core.quotepath=false -c log.showSignature=false flow feature finish task-3876
Fatal: Working tree contains unstaged changes. Aborting.
16:11:20.316: [project] git -c core.quotepath=false -c log.showSignature=false add --ignore-errors -A -f -- <list of changed files>
16:11:20.329: [project] git -c core.quotepath=false -c log.showSignature=false rm --ignore-unmatch --cached -- <list of deleted files>
16:11:20.346: [project] git -c core.quotepath=false -c log.showSignature=false commit -F /tmp/git-commit-msg-.txt --
  • What is the expected behavior?

The feature/hotfix branch is commit and merged to master/development and deleted.

  • Please tell me about your environment:

    • Gitflow4idea version: 0.6.7

    • Gitflow version: 1.11.0 (AVH Edition)

    • IntelliJ Help -> about > click copy icon and paste here. Should look like this:

    PhpStorm 2018.3.5
    Build #PS-183.5912.26, built on March 7, 2019
    Licensed to Denis Bondar
    Subscription is active until August 2, 2019
    JRE: 1.8.0_152-release-1343-b28 amd64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    Linux 4.15.0-46-generic
    

denisbondar avatar Mar 14 '19 14:03 denisbondar

@denisbondar Thanks for the detailed report.

I tracked down the bug to this line in IntellIj's CloseTaskDialog: https://github.com/JetBrains/intellij-community/blob/0e91550e746c94ab6afe5c0d36450b93b587dd2d/plugins/tasks/tasks-core/src/com/intellij/tasks/actions/CloseTaskDialog.java#L103

Seems like the commit function of all the TaskDialog integrations is executed sequentially, so what happens is that the git commit and the gitflow finish actions are executed almost instantaneously, which means that the actual commit doesn't finish by the time the gitflow finish action starts.

I'm not entirely sure how to solve this, since the dialog integration doesn't provide a way to synchronously rely on other integrations. I've pinged the Jetbrains people to see if they have direction.

OpherV avatar Apr 06 '19 13:04 OpherV