Skip to main content
AgeCommit message (Collapse)AuthorFilesLines
2018-08-06Rename RepositoriesViewLabelProvider to RepositoryTreeNodeLabelProviderThomas Wolf8-24/+21
It's not a label provider for the git repositories view; it is a label provider for RepositoryTreeNodes. (Which happen to be _also_ shown in the git repositories view, but they're also shown and labeled through this class elsewhere.) Change-Id: I5221ba06aaf475b3b577b8ccb2846b62a64331c8 Signed-off-by: Thomas Wolf <>
2018-08-06Use an asynchronous lightweight decorator in the repositories viewThomas Wolf32-863/+943
In the previous implementation, the label provider produced styled labels that included the decorations. But label providers run in the UI thread, and expensive decorations like a branch state (N commits ahead, M behind) could thus lead to UI blocks. Newly, leverage Eclipse's built-in support. Use a lightweight decorator for RepositoryTreeNode and register it in plugin.xml. Separate out getting labels into a WorkbenchAdapter and adapt the GitAdapterFactory accordingly. (We already created a WorkbenchAdapter there, but first we always created a new one, and second, it always created a RepositoriesViewLabelProvider just to get the label text. That's terribly inefficient and the logic is completely backwards.) Also use ImageDescriptors instead of Images where possible. Factor out the handling of LabelProviderChangedEvent from GitLightweightDecorator into GitDecorator and re-use it in the new decorator for RepositoryTreeNodes. Make the RepositoriesViewLabelProvider a decorating label provider based on a WorkbenchLabelProvider, which uses the singleton RepositoryTreeNodeWorkbenchAdapter to get labels and images. Change the other uses of RepositoriesViewLabelProvider in dialogs to work with the new setup. Adapt git repositories view tests. These often use the label provider to determine expected node labels, and then try to find a node with a matching label. Decorations are now asynchronous, and thus the label returned from the label provider may or may not contain the decoration. Even with waiting for decoration jobs we may end up with the label being determined in the test and the one in the UI being different. The latter may or may not contain the decoration, which makes finding expected nodes a bit difficult. For now, use the TestUtil navigation methods, which just check for containment. This works well, but because some decorations include the repo directory path which in turn includes the test method name, some test methods and even some test repo names had to be changed to avoid false "duplicate nodes" failures. User-visible UI changes from all that: next to none. Three differences I noticed in the default theme on OS X: 1. Decorations all use the default decoration style (light brown), with the exception of the directory paths shown on repository nodes and on working tree nodes. Those are handled specially and use the qualifier style. 2. Decorations in the "File->Import...->Projects from Git->Existing git repositories" page now actually work. 3. Image decorations briefly flicker on a refresh because of the way asynchronous lightweight decorators work. The flickering is due to the repository view being wholly refreshed frequently. On such a refresh, the viewer tries to get a new decorated label, but the decoration isn't available yet. Once it is available, an event is fired, and the viewer updates the label again. For text labels, the new RepositoriesViewLabelProvider contains a work-around, but for images, that method won't work. The only image decorations (so far) are the check markers for the currently checked-out ref. Otherwise, I notice much faster Eclipse startup with the repositories view open and containing some repositories. Bug: 536814 Change-Id: Ifa8279dd6755c57696b8b64e96bc41a1f948aa59 Signed-off-by: Thomas Wolf <>
2018-08-02Merge branch 'stable-5.0'Matthias Sohn0-0/+0
* stable-5.0: Prepare 5.0.3-SNAPSHOT builds EGit v5.0.2.201807311906-r Change-Id: I1e44341bff11692639d6afc1f19fe0a2b3e05da2 Signed-off-by: Matthias Sohn <>
2018-08-02Prepare 5.0.3-SNAPSHOT buildsMatthias Sohn38-265/+265
Change-Id: I2da458c6eabca038ac7bfb1b4b1ccc36527359e2 Signed-off-by: Matthias Sohn <>
2018-08-02EGit v5.0.2.201807311906-rv5.0.2.201807311906-rMatthias Sohn38-39/+39
Change-Id: I80865c9494eff472c267f5c40fc99383af9be75f Signed-off-by: Matthias Sohn <>
2018-08-01History table: let the user define which columns are shownThomas Wolf9-54/+314
Columns in tables cannot be shown/hidden individually. But we can set the width to zero to hide a column. Of course the user can hide and restore columns directly by dragging the column separators, too. Add a "Columns" sub-menu in the view menu where the user can check the columns to be shown/hidden. These modifications are transient; they are not saved or restored when the view is closed or opened, and they do not survive across and IDE restart. This is similar to the "pinned" state of a history view. To permanently change which columns are shown by default, there's a new preference page. Bug: 339796 Change-Id: Ib8daff29b6610eed1397969a203947e5e72b629a Signed-off-by: Thomas Wolf <>
2018-07-29History table: adapt column widths when view size changesThomas Wolf1-11/+40
Use a TableColumnLayout; give columns minimum widths, and give the commit ID column a fixed size. Re-layout the table when the width changes, and if the table then doesn't fit the view, re-distribute all column widths afresh. This results in the table always using at least the available width, and getting a horizontal scroll bar only if the user makes columns so wide that they cannot fit the view. (Or makes the view that small.) Bug: 537181 Change-Id: Ic105acd0ffc7877e8834888b841e3f0aa96993cb Signed-off-by: Thomas Wolf <>
2018-07-24Hide $GIT_DIR and friends from JGitThomas Wolf1-0/+73
Register an Eclipse-specific SystemReader that hides the git repository location environment variables. Otherwise JGit may try to use them when creating repositories (init, clone), which gives very surprising results if a user creates several repositories and these environment variables are defined for the Eclipse process. Bug: 537331 Change-Id: I20639f5a4fbd65f14ce39283e19a35ccf127c905 Signed-off-by: Thomas Wolf <>
2018-07-22Fix wrapping label in DateFormatPreferencePageThomas Wolf1-1/+2
Using SWT.FILL and SWT.TOP as _width and height_ makes no sense. The real problem with wrapping labels in a GridLayout is that one needs some width to wrap against. With SWT.DEFAULT, the layout lets the label itself determine its width, which of course will always be the unwrapped width absent any other constraints. If one wants to have wrapping, one needs to provide a reasonable widthHint. Change-Id: Ie07d2fd93f110048ddcfb535d0706347915852d0 Signed-off-by: Thomas Wolf <>
2018-07-21Bug 536863 - No feedback on "Import changed projects"Michael Keppler3-1/+24
Show a message dialog if no projects are to be imported. Change-Id: Ia9648fa9262e72f27220c7f26a09ed29ba5fa795 Signed-off-by: Michael Keppler <>
2018-07-21fix typo in message string keyMichael Keppler3-3/+3
Change-Id: Ief3607641510561e3181b21cd0820923a15447a5 Signed-off-by: Michael Keppler <>
2018-07-21Add 2 missing icons in reflogMichael Keppler1-0/+4
cherry-pick and rename branch entries in the reflog do not have an icon (maybe there are more, I only noticed these 2). Change-Id: I80d80d5a9dc2e8b4b5ce05ae98b434c592474561 Signed-off-by: Michael Keppler <>
2018-07-21[releng] Recompute target platforms from TPD filesThomas Wolf3-9/+27
The latest changes to the Photon orbit TPD only included a regenerated file; the others were not updated. Change-Id: I0d4cfef87b26a80988444a58b1577486dd4e330f Signed-off-by: Thomas Wolf <>
2018-07-18Ensure IProjects are not refreshed via IFile handlesThomas Wolf1-7/+18
As it turns out a WorkingTreeModifiedEvent may contain directories without trailing slashes. EGit refreshes files as IFiles. In some cases, it would thus try to refresh a folder via an IFile. When such a folder is a nested project, Eclipse may detect the aliased project and will then raise an IAE if the refresh occurs via an IFile because projects have only one path segment, but files need at least two. Avoid this when we calculate which resources to refresh given the set of paths modified by a git operation: check up-front whether the path corresponds to a known project, and if so, refresh it via IProject. Bug: 536880 Change-Id: I26cadec224852f4dc53187cc1103a511db78f370 Signed-off-by: Thomas Wolf <>
2018-07-17Avoid that loading the history blocks updating the commit tableThomas Wolf2-32/+27
Somehow setting the input on the commit graph table got blocked on the monitor of the SWTCommitList. The only other place where that monitor can be held is in the GenerateHistoryJob itself. However, CommitGraphTable.setInput() is always called not only with that SWTCommitList but also its contents copied into an array. Thus we can use this array copy instead of the list itself to get the contents. On the array, no synchronization is needed. That also means that inside the GenerateHistoryJob no synchronization on that list is needed anymore, since only that job accesses it. Bug: 485743 Change-Id: I77007b159d8b3de0a346b7cea69599fd61d80585 Signed-off-by: Thomas Wolf <>
2018-07-17Disable "Compare with previous" for deletionsThomas Wolf2-6/+10
"Compare with Previous" in the history view and in the commit viewer outline makes no sense for deletions. The operation makes only sense if both a new and an old version exist. Bug: 536799 Change-Id: Id08200fe9900942cd83a9da0e1badfd075a5590b Signed-off-by: Thomas Wolf <>
2018-07-16Fix "Compare with Previous" in history view and commit editor outlineThomas Wolf3-20/+18
Enable or include the command only if there _is_ a previous revision to compare to (i.e., only if the diff is not an addition). Also fix the comparison itself to work for renames, too. Bug: 536799 Change-Id: Ia2c0a706d1bac2f67fad4dbe686cd3e0d9d013d8 Signed-off-by: Thomas Wolf <>
2018-07-15Git history page: move expensive operations in the backgroundThomas Wolf13-337/+598
There were still two potentially expensive operations occurring in the UI thread: * Computing the file diffs can take quite a while for large commits. * Preparing to load the history can take quite a while if there are many refs. Because of the highly asynchronous loading already going on for other things (commit messages, unified file diffs, actually loading the history) and the somewhat hacky way the various viewers were re-set when something changed, it was not possible to do this in several commits and still have everything working correctly. The old code stored the repository to use before the new history was loaded, which sometimes could lead to cases where EGit would end up looking for an object in the wrong repository when the repository had changed. Concerning file diffs: we exploit the fact that since commit 9df32ed a FileDiff carries its repository, and we wrap all items needed to compute the file diffs in a FileDiffInput object (tree walk, repo, interesting paths, and so on). The diff calculation is done newly in a background job, and only the actual update of the viewer happens in the UI thread. Because the diff computation is now asynchronous, revealing and selecting interesting elements had to be moved to this UI update triggered by the background job. Incidentally this part of the code became much simpler. One problem here is that computing diffs is not cancelable in JGit. The background jobs must be serialized because they may re-use the same TreeWalk instance. This may lead to longer delays than desired until the file diff viewer updates, but at least he UI will not be blocked. To remedy this fully, DiffEntry.scan() and RenameDetector.compute() in JGit should be made cancelable. See bug 536323 and bug 536324. Concerning the history preparation: marking the start points for the RevWalk can be a rather expensive operation if there are many refs. Use a customized RevWalk for the history that does this on the very first call to next(). That way it gets executed in the GenerateHistoryJob instead of in the UI thread. For the commit message viewer, a similar problem with trying to look up a commit in the wrong repository became apparent. This was resolved by not storing the repo in the viewer itself but relying on the fact that an SWTCommit also carries its repository along. Finally, asynchronously loading the history meant that there was some time during which some parts of the git history page had already been prepared for a new repository now being loaded, but the table would still show the old entries. During that time a user could select one of these old commits and try to invoke commands on it, which then also could result in looking up a commit in the wrong repository. This is resolved now by clearing the table when the repository changes. Bug: 440588 Bug: 485743 Change-Id: I5c3cf9a7a0ae536000a9bf4542407fea0b741e22 Signed-off-by: Thomas Wolf <>
2018-07-07mark more jobs as system or userMichael Keppler4-4/+8
When browsing some job creations, I noticed that some of the egit internal jobs are not marked as system or user. Change-Id: I8d557bcf5ccfc54e5d27e0f3c1f4455dc62a751a Signed-off-by: Michael Keppler <>
2018-07-07Better default editor opening for file revisionsThomas Wolf4-26/+104
EGit tried already to open the configured editor based on content types or file name associations. On failure, it would fall back to the default internal text editor. Unfortunately, opening a default editor failed always for editors that do require some physical file. Thus opening an external editor always failed, and EGit showed the file as text. Even if the file was binary. Newly, make FileRevisionEditorInput implement IPathEditorInput. Eclipse uses this to invoke external editors, so when getPath() is called, we can write the blob to a temporary file, so that the external editor has something to read from. This is the same technique as used in InternalClassFileEditorInput in JDT. Incidentally this also makes showing a git revision of an HTML page in the internal web browser work. The file is created inside a temporary directory; this enables us to use a simple file name (revision & original file name), which looks nicer in programs that show the file name than a (partially) auto-generated name as we'd get from createTempFile(). The file is set as read-only: a user cannot modify a git revision. We attempt to delete the temporary file and directory when the JVM terminates to avoid filling the system tmp directory. Bug: 463906 Change-Id: I355524f46a8ef66745f287adf718dfb8ea197b4a Signed-off-by: Thomas Wolf <>
2018-07-05Fix error marker updates in staging viewThomas Wolf1-17/+43
Use (absolute) paths instead of resources to determine which elements to update in the staging viewer. Using resources may give inconsistent results if * a file occurs several times in the Eclipse resource tree, or * a on-disk directory doesn't exist as a resource in Eclipse at all. The latter can occur if tree representation is used and an Eclipse project lives in some sub-directory (for instance, "bundles") in the git working tree. In that case the staging view will have a folder "bundles", but there's no resource for it, and thus our top-down tree traversal will skip it and all its descendants. Bug: 536471 Change-Id: I46fc84737471e2994af056ecb238b3bbfb55e413 Signed-off-by: Thomas Wolf <>
2018-07-05Staging view: update author/committer on config changesThomas Wolf4-25/+331
When the config changes, update the committer (and possibly also a signed-off line in the commit message) to the possibly new and values. If the author is the same as the committer, also update the author of the commit. Correct the logic in CommitMessageComponent for updating the sign-off settings. Previously, editing the committer field would switch off the "sign off" flag if the committer was invalid (quite common if you type a new value), and thus the user had to re-enable it manually and correct an old or wrong signed-off-by line explicitly. Bug: 533019 Change-Id: I13252da7beec6cd1ecd1ad2831b4d85c94d46636 Signed-off-by: Thomas Wolf <>
2018-07-02Do not refresh projects that use a PessimisticResourceRuleFactoryThomas Wolf2-13/+15
With some setups where the Eclipse workspace is inside the git working tree EGit may end up trying to refresh a project that needs the workspace root as scheduling rule for a refresh. EGit generally uses multi-rules containing affected projects, though, and thus it may run into an IAE in that case. EGit-managed projects use an optimistic rule factory that uses the project itself as scheduling rule. So do normal unshared projects. So this can only occur if there are projects inside the git working tree that are not shared with EGit but with some other provider that does not use an optimistic rule factory. This is a rare occurrence, and such projects had better be git-ignored, too. Not refreshing such projects is a thus viable approach. Bug: 536472 Change-Id: I17c06fd69e232a7b864a98c4e95598fa7ab6b7b0 Signed-off-by: Thomas Wolf <>
2018-06-30Merge "[releng] remove unused SWTBot TPD files"Thomas Wolf2-14/+0
2018-06-30Sort decoration variables alphabeticallyMichael Keppler1-4/+5
Change-Id: I6e07a299d4dcf683b92e74a397d1b3b713145265 Signed-off-by: Michael Keppler <> Bug:536360
2018-06-30Have sentences in message dialogsMichael Keppler1-19/+19
All the changed texts are used as message argument in MessageDialog.openConfirm/openWarning/openInformation/openError calls. Change-Id: I9ab86c6190a8c79cf620425dc8bb354fc17a7724 Signed-off-by: Michael Keppler <>
2018-06-30Merge "Fix history preference page field editor layout"Thomas Wolf2-7/+13
2018-06-30[releng] remove unused SWTBot TPD filesMichael Keppler2-14/+0
All current TPDs use swtbot-snapshot.tpd, so the old versions of swtbot*.tpd can be removed. Change-Id: Ic446bfad40046a4bf3219f347d78525f24bb22ae Signed-off-by: Michael Keppler <>
2018-06-30Fix history preference page field editor layoutMichael Keppler2-7/+13
BooleanFieldEditors manipulate the GridLayout of their composite parent to have only one column. Therefore avoid BooleanFieldEditors as last field editor, if some of the other field editors need more than one column. Also improve the option label for shortening long branch and tag names. See screenshots in bugzilla. Change-Id: I1cc6656da65467081ea33327fdb8d683cb37b3a6 Signed-off-by: Michael Keppler <> Bug:536357
2018-06-30Fix typo in test method nameMichael Keppler1-2/+2
Change-Id: Ifa2b84a2cda71c95cebccaef40bcbd525bf073c9 Signed-off-by: Michael Keppler <>
2018-06-30Disable commit buttons immediately on committingMichael Keppler1-4/+11
Since all the file related checks can take quite some time, we need to disable the buttons immediately, not only when triggering the commit operation on the repository. Most notable visible difference is that the complete staging view is disabled when the user gets the "no files staged" error message dialog. Change-Id: Iae825abfb9235832a3fae49e9f967d983461dec5 Signed-off-by: Michael Keppler <> Bug:533005
2018-06-30Remove semicolon at end of variable descriptionsMichael Keppler1-4/+4
Change-Id: I7dbd6b0f65294ca012839daccd808541a1b977c5 Signed-off-by: Michael Keppler <> Bug:536358
2018-06-30Normalize tag name when typingMichael Keppler3-9/+5
Use the BranchNameNormalizer also in the CreateTagDialog. Additionally remove the tooltip, and remove the stars from the mandatory input field labels, since we don't have those anywhere else. Change-Id: I96bf9c1db8b00f31a8b1263a264a68e3999fb904 Signed-off-by: Michael Keppler <> Bug:535577
2018-06-30DatePreferencePage does not wrap explanation labelMichael Keppler1-2/+2
Make the long explanation label wrap when the preference page is shrinked. The layout data is set as explained in Change-Id: I0795ca8e6d01a73499f1bffc1cb4053508912403 Signed-off-by: Michael Keppler <> Bug:536356
2018-06-30Move clean menu item before garbage collect menu itemMichael Keppler1-7/+10
This menu item is probably used rather seldom and should not be on the top of the menu. Also enable the clean menu on the working directory tree node. Change-Id: I95506e8577dec90d6c815c2fb8334c0894f71ebe Signed-off-by: Michael Keppler <> Bug:536236
2018-06-28[releng] Update Oomph API baselineThomas Wolf1-10/+10
Retire 4.9.2 baseline, add 5.0 baseline. Change-Id: I41478db9c57ddd822c816e5e625a24a4e71ef4ee Signed-off-by: Thomas Wolf <>
2018-06-25Fix sort order in Staging viewThomas Wolf2-6/+12
Change alphabetic sorting such that elements with shorter directory names in the path sort before elements with longer directory names. * Replace slashes by '\001' to ensure the above. * If "file name first" is active, sort by file name _and_ path to ensure relative order of files with the same name in different directories. * Also sort StagingFolderEntries the same way to ensure that the order is the same when "compact tree" representation is active. Also apply the same technique in FileDiff.PATH_COMPARATOR to ensure that we use a consistent ordering also in the history page and in the commit viewer and its outline page. Bug: 536240 Change-Id: I6a8daf7faed8a89a5b97f083e108cd614ba15096 Signed-off-by: Thomas Wolf <>
2018-06-24Set RepositoryPropertyPage zero pixel marginMichael Keppler4-7/+16
The abstract property page implementation requires a zero pixel margin for the top level composite being returned by the concrete subclass. Change-Id: I0b6f5f9764114b6a95af1900ce4cf4d855fd8291 Signed-off-by: Michael Keppler <> Bug:536097
2018-06-24StagingView wrongly sorted by state initiallyMichael Keppler1-1/+1
While refactoring the sort toggle, its meaning was negated, but for one occurence the negation was not added in the code. Change-Id: I4380ba3ba64a3af21d9f02d5f8a8a325a5b91dda Signed-off-by: Michael Keppler <> Bug:535749
2018-06-24Merge "Merge branch 'stable-5.0'"Thomas Wolf0-0/+0
2018-06-23Merge branch 'stable-5.0'Matthias Sohn0-0/+0
* stable-5.0: Prepare 5.0.2-SNAPSHOT builds EGit v5.0.1.201806211838-r Change-Id: I1cebdc3f661c0570ecb7c07ee2902045ccc87622 Signed-off-by: Matthias Sohn <>
2018-06-23Improve share wizard window titleMichael Keppler1-1/+1
Since that wizard is used as direct child of the general Share wizard it makes sense to use the same window title in all the wizard. Change-Id: I6e583fdafb491022a2595759a805ccc4c3502438 Signed-off-by: Michael Keppler <> Bug:535678
2018-06-23Sort gerrit remote refs naturallyMichael Keppler2-2/+3
Found two more instances of sorting just as String, and not in natural order. Change-Id: I96efda5b137c2be23fd5b46d9298d414a6b82dfe Signed-off-by: Michael Keppler <> Bug:536204
2018-06-23Activate compare mode by defaultMichael Keppler1-1/+1
Change-Id: I38b817faec9cd1d946b0c1226db215087e903d1a Signed-off-by: Michael Keppler <> Bug:535742
2018-06-23Reveal newly created entry in configuration editorMichael Keppler1-0/+19
I've chosen to not set the selection to the new entry, but only to reveal it. If some of the egit core developers thinks different, I'm open to change this. Signed-off-by: Michael Keppler <> Bug:535160 Change-Id: I383a35a3b4a80bfcd32a730298942a54c947c80e
2018-06-22History search: use CSS for text field background colorThomas Wolf3-14/+56
Use a CSS class on the text field to set the light red background color when there are no matches. Remove the CSS class to reset the background. This makes the background color changes work as expected with themes that define their own background. Note that changing the background of a text field is supported by SWT currently only on gtk and on Windows. Bug: 532940 Change-Id: Ieb1c6b70a5df9b23c18b501b89379fa9cdeb66fb Signed-off-by: Thomas Wolf <>
2018-06-22Prepare 5.0.2-SNAPSHOT buildsMatthias Sohn38-265/+265
Change-Id: Ia23aad588d3a82c4f3c977123180a05916cec0b0 Signed-off-by: Matthias Sohn <>
2018-06-21EGit v5.0.1.201806211838-rv5.0.1.201806211838-rMatthias Sohn38-39/+39
Change-Id: I72343949948b8461813a4c5168bafb0ae8304e53 Signed-off-by: Matthias Sohn <>
2018-06-18Fix CommitUI.getSelectedFiles()Thomas Wolf1-24/+46
This method is used to restrict the files that can be potentially committed to those covered by the user's resource selection. If a container is selected, all modified files under that container are to be included in a commit. Previous code started off with the modified files as known in git, then tried to figure out which resource such a file was in Eclipse, and then checked if that resource was contained by any of the selected resources. It failed to reliably identify matches when a file appeared as several resources in the Eclipse resource tree. The new code swaps the logic around. It starts with the resource selection and finds the repository-relative paths for all, and then filters the modified files as known in git. Bug: 535796 Change-Id: I0b77876ed3913cac987a07444c9de1e6a43e69ee Signed-off-by: Thomas Wolf <>
2018-06-18Merge remote-tracking branch 'origin/stable-5.0'Thomas Wolf1-9/+11
* origin/stable-5.0: Don't warn about LFS if LFS bundle is not present. Change-Id: Ie56c256ac828a783f1541095913016b919d6a8ed Signed-off-by: Thomas Wolf <>

Back to the top