Bug 541115 - git operations should not wait for builds to complete
Summary: git operations should not wait for builds to complete
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted, performance, usability
Depends on:
Blocks:
 
Reported: 2018-11-13 19:24 EST by Sam Davis CLA
Modified: 2019-02-28 08:04 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Davis CLA 2018-11-13 19:24:07 EST
Switching branches/rebasing/etc. should not wait for Maven or PDE to finish building. Once the rebase happens everything would need to be rebuilt anyway. This means that unless I take special action to manually abort the build, I have to wait for everything to build *twice,* or more if I need to do a series of git operations.
Comment 1 Matthias Sohn CLA 2018-11-13 19:49:24 EST
So you want EGit to abort the build when checking out another branch while the build is running ?
Comment 2 Andrey Loskutov CLA 2018-11-14 05:04:21 EST
Switching branches while building can cause trouble for the build and fail it in unpredictable way. So -1 from me. So either we ask "do you want to abort the build" or we wait.
Comment 3 Matthias Sohn CLA 2018-11-14 07:53:35 EST
I didn't mean to run checkout during build concurrently. If we implement this and the user triggers checkout while a build is running we either explicitly abort the build and then execute checkout or we first show a dialog to get the user's consent for aborting the build or we first wait for the build to complete.

I think we should implement both options and provide a preference
 
Team > Git > Confirmations and Warnings > Abort concurrent build if git operation modifies working tree

with possible values yes/no/ask, default should be ask
Comment 4 Sam Davis CLA 2018-11-14 12:46:42 EST
I think aborting the build would make sense. If the build relies on files that the user asked EGit to change, I can't understand in what scenario the user would want EGit to wait for the build to finish. If Eclipse is building and you want that build to finish, presumably it's so that you can either run something or verify that it builds successfully. In either case you wouldn't initiate a Git operation during the build. Note that other things (launches) may be waiting for the build to complete, so I don't think EGit's waiting makes much sense unless it also waits for those things to happen, otherwise it may disrupt them instead of disrupting the build.

But I think in most cases where the user initiates a git operation during a build, it's because they didn't want that build to happen at all, e.g. they are in the middle of a rebase and Eclipse decided to build. I'm very surprised this hasn't come up before, as I find it quite an annoyance.
Comment 5 Sam Davis CLA 2018-11-21 18:57:39 EST
It also seems to me that staging files should never wait for a build to complete, since it has no impact on the build.
Comment 6 Thomas Wolf CLA 2018-11-22 06:14:14 EST
I have been wondering for a long time why our IndexDiffCacheEntry recalculation waits for the workspace lock at all.

Indeed it leads at least in the staging view to an annoying and completely unnecessary delay in the UI update when builds are running. (The staging view updates its UI in response to changes in the index diff calculation. If that gets blocked by a build, the UI update will occur only once the build is over.)

Note that changing this in IndexDiffCacheEntry may negatively impact our test suite; we already have a number of tests that became unstable since the "parallel pull" changed the scheduling rule there. So the tests may need to be changed, too. See bug 541124.
Comment 7 Sam Davis CLA 2018-11-30 18:47:33 EST
Another example: if I want to cherry-pick a bunch of commits onto my branch, after each cherry-pick, Eclipse starts building my workspace and I have to wait for the build to finish before I can cherry-pick the next commit, but I don't even want anything to build until I have finished cherry-picking everything, so I (if I remember) turn off 'build automatically.'