Skip to main content
AgeCommit message (Collapse)AuthorFilesLines
2019-08-27History view: shorten view toolbarThomas Wolf1-16/+38
Combine the four filter buttons into one single button with a drop-down menu. Selecting the button itself cycles though the filters. Use the new FilterAction also in the view menu; to be able to do so implement ToolBarMenuAction.getMenu(Menu) and rename the class to DropDownMenuAction. Also, as long as one only updates the image of an action it isn't necessary to update the whole toolbar. The framework listens for such changes and updates the corresponding ToolItem or Menu entry already. Change-Id: If7fb1e3199cd1721a4455bac10925fc2922c5ba8 Signed-off-by: Thomas Wolf <>
2019-08-21Shorten confirmation messages for "reset hard" and "discard changes"Thomas Wolf2-2/+2
Eliminate the "Are you sure?"-like extra questions. They're not necessary; the dialogs tell the user what's going to happen and present a "Reset"/"Discard Changes" button and a "Cancel" button. The explicit questions were a left-over from older code where the dialogs had just "Yes"/"No" or "OK"/"Cancel" buttons. Incidentally constructing the message texts becomes simpler because the warning text about running launches doesn't have to be inserted somewhere in the middle but can simply be tacked onto the end. Bug: 550292 Bug: 550293 Change-Id: I9365737ef08fe43f29142ca1ae6851464282a334 Signed-off-by: Thomas Wolf <>
2019-08-21Fix silent failure on conflicting checkout after branch creation.Max Hohenegger4-28/+83
* Minor changes in BranchOperationUI to re-use checkout result handling. * Add UI test because the issue is tedious to reproduce, and depends on proper synchronization with the Job and the Display thread. Bug 549612 Change-Id: I616b975f5eff881c6cc3455649ec7dd7a9bd293f Signed-off-by: Max Hohenegger <>
2019-08-13Stabilize StageUnstageActionTestMichael Keppler1-0/+1
We had WidgetNotFoundExceptions in the last 2 executions of our main build job. Re-calculate the tree widget after unsharing a project to eventually get rid of the exception. Local testing did not expose the exception on my Windows system. org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: The widget {null} was disposed. at org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.<init>( at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.<init>( at org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.<init>( at org.eclipse.swtbot.swt.finder.widgets.SWTBotTree.notifySelect( at org.eclipse.swtbot.swt.finder.widgets.SWTBotTree.notifySelect( at at Change-Id: Iefbeb57f1adb62426db457c3f0a918529fe648a7 Signed-off-by: Michael Keppler <>
2019-08-09Fix equals & hashCode of StashedCommitNodeThomas Wolf2-0/+130
Nodes in the repositories view for stashed commits must only be equal if the commit _AND_ the index are equal. Otherwise the TreeViewer in the repositories view gets confused and does not update the tree correctly. Bug: 464949 Change-Id: Iab7dc3e5471f71f4034735bb661e29ed8f3b6998 Signed-off-by: Thomas Wolf <>
2019-07-22Log an error if the reflog cannot be readThomas Wolf1-1/+27
EGit reads the reflog in three places: in the SwitchToMenu, when trying to get a short branch name, and in the reflog view. The latter uses JGit's ReflogCommand and has its own fatal error handling. In the other two places, a failure to read the reflog may cause severe UI functionality loss. Therefore catch RuntimeExceptions, too, and just log them. In SwitchToMenu, also just log IOExceptions when the ref log cannot be read. That way, there's a fair chance that the menu will still show some branches. Bug: 549235 Change-Id: I914536a65cec9d7e5c04199e989926d46e607427 Signed-off-by: Thomas Wolf <>
2019-07-07Fix showing selected refs or commits in history viewThomas Wolf1-25/+86
When the history view shows only the current branch ("Show all branches and tags" _off_), selecting some other branch in the git repositories view might not show the selected branch. It would be shown only if that branch happened to be merged into the currently checked out branch. The same could be observed when using "Show In History" on a commit in the results of a "Git Search": the commit would only be selected if it was contained in the branch currently checked out. Change this by always considering such a selected branch or commit as an additional start point for the RevWalk. This enables the user to make the history view show exactly two branches (plus all those merged into these two), and also correctly selects commits not on the current branch. Bug: 360868 Change-Id: Ib2e071f40c57b06a0ce0a51defac3fe30f481e03 Signed-off-by: Thomas Wolf <>
2019-07-03Repositories view: check for submodules when reacting on selectionThomas Wolf1-3/+56
When the repositories was set to follow the selection and a file in a submodule folder was selected, the submodule repository was added as a top-level repository in the view. Fix this by also considering repositories under submodule nodes when determining which node to show. Add a new test, and fix SubmoduleFolderTest to properly commit the addition of the submodule in setUp(). Bug: 520735 Change-Id: I54c1d2c5d2b8fac95dc7a4fed658e59285639f4c Signed-off-by: Thomas Wolf <>
2019-06-27Added option to create light weight tagsMarco Stornelli1-39/+156
When the tag has no message in CreateTagDialog create a lightweight tag instead of an annotated tag. Adds tests for both the UI and for the new "annotated" flag in TagOperation. (Since the lower-level TagOperation allows creating an annotated tag without message, an extra flag is needed.) Bug 438902 Change-Id: I99b53c08f94744f78aabe1c1e57b91d0da587bc7 Signed-off-by: Marco Stornelli <> Signed-off-by: Thomas Wolf <>
2019-06-24Enable the "Switch To..." menu for submodule foldersThomas Wolf1-0/+23
Commits 1f69fad3 and e4dc3eaf from the multi-repository branch switch had the effect that the "Switch To..." menu didn't work anymore for submodule folders in the package or project explorer. Add a new operation SelectionUtils.getAllRepositories() and use it in SwitchToMenu. Changing the existing SelectionUtils.getRepositories() to also return repositories for folders was deemed too risky since that would have changed the behavior of the multi-repository pull, which has always worked only for folders. Enabling that to also handle submodule folders might be an idea for a future commit, but might need more tests. Add a new test. The test only verifies that the menu has content by trying to invoke "New Branch..." and then closing the resulting "Create Branch" dialog. Interestingly this test succeeds even without the fix, which matches the experience described in the bug report: the problem could only be observed in official packages, but not in my development setup. Change verified manually by actually building EGit and installing it into standard Eclipse packages. Bug: 548158 Change-Id: Ic67578b46a89687a6bcfe73ef3d2d3d71d2a39e0 Signed-off-by: Thomas Wolf <>
2019-06-20Reword commit dialog - Use verbs instead of OKLars Vogel1-1/+3
Ok button text changed to Reword. Bug: 548144 Change-Id: I823ea451498925cf8a70cc6c114f06c904cbde01 Signed-off-by: Manuel Niquet <> Signed-off-by: Lars Vogel <> Signed-off-by: Michael Keppler <>
2019-06-10Remove pre-Mars adapter workaroundMichael Keppler5-10/+10
Since our minimum target is Mars, we no longer need the previous workaround for avoiding compiler warnings around adapters. This is not a git revert, but an inline refactoring of the previously introduced method. Also inline AdapterUtils.adapt() in such a way that Adapters.adapt() is called instead. Bug:460685 Change-Id: Idbbe4853f68a9b6d1ffff1f434bdbfb9bc705a80 Signed-off-by: Michael Keppler <> Signed-off-by: Matthias Sohn <>
2019-05-25Use Arrays.asList instead of copying array in a for loopCarsten Hammer2-8/+6
Additionally remove some type declarations that are not needed. Change-Id: I2340a7c4393474015fc6bf5a4d55f245d9b330d2 Signed-off-by: Carsten Hammer <>
2019-05-17Fix resetting conflicting files on branch switchThomas Wolf1-2/+18
The new code from commit 8a66893 inadvertently reset to the index version instead of to HEAD and thus didn't reset staged changes. Fix this and add a new test. Change-Id: Icf6ffe38949cc8fd42cb35196c090a66c5527901 Signed-off-by: Thomas Wolf <>
2019-05-15Use try-finally to dispose clipboardMichael Keppler2-21/+29
Clipboard uses system resources. Use try-finally there similarly as we would with any Closable. Change-Id: Ida5bd1ded9d69f904b89a739c888b21fbeaf8526 Signed-off-by: Michael Keppler <>
2019-05-15Fix formatting after lambda changeThomas Wolf1-1/+1
Commit f7252ca introduced a number of places where the formatting did not match the Eclipse formatter settings. Reformat the changed lines. Omit redundant lambda parameter types, just use "a" and "b" for comparator parameter names, and in a few cases do other minor clean-up on the affected lines. Change-Id: Iaf459a8f2366a8176f1ca3e257e5e1900b7f8c66 Signed-off-by: Thomas Wolf <>
2019-05-15Use jdk 5 for-each loopCarsten Hammer3-6/+4
Replace simple uses of Iterator with a corresponding for-loop. Also add missing braces on loops as necessary. Change-Id: I2190569ff0076ca8004d83ec8bda6e6cd57887aa Signed-off-by: Carsten Hammer <>
2019-05-15Use try-with-resourcesCarsten Hammer5-34/+25
Convert try finally block to try-with-resources Change-Id: I29a482e2bbfe5e9029b41c1fe7a5bf45308905c2 Signed-off-by: Carsten Hammer <>
2019-05-15Convert to lambda or member referenceCarsten Hammer1-6/+1
Convert anonymous inner classes to lambda expressions or member references. Change-Id: I80ef719e9282eac73f178e4d45cc2ed57280cb25 Signed-off-by: Carsten Hammer <>
2019-05-12Handle delete-modify conflicts in staging viewThomas Wolf1-0/+48
Delete-modify conflicts could not be resolved in the staging view by removing the file. If a conflicting file has been removed from the working tree, make staging it in the staging view remove it from the index. Note that if the preference for "Automatically stage files being deleted" is switched *on*, then deleting the conflicting file in the working tree would remove it from the index already. But with that preference *off* the user had no real way to resolve such conflicts. (Sometimes, this could be worked around by first staging the conflict, then unstaging, then deleting the file, and then staging the deletion.) The solution in this change works, but still leaves some non-working commands in the context menu. There's no delete command in the context menu, and the "replace with" commands (ours/theirs/HEAD/index) don't do anything for the side that deleted the file. Fixing that is left for a future enhancement. Bug: 546869 Change-Id: I9594587f9445acf0a9972b01933bc5d453168f65 Signed-off-by: Thomas Wolf <>
2019-05-01Get display instance from workbenchMichael Keppler11-29/+31
org.eclipse.ui.IWorkbench.getDisplay() recommends to always use that method instead of Display.getDefault(). Change-Id: I0d7512aa9b40ad26e0b71356aa90bebd5b7611f7 Signed-off-by: Michael Keppler <>
2019-05-01Shorten SHA1 in editor titleMichael Keppler1-1/+2
When opening a commit from history, it used the full SHA1 in the editor title, leading to very wide tabs. Use a short version instead. The shortening of the SHA1 was done in the editor input calculation instead of the getContentIdentifier() method to avoid side effects at other callers of getContentIdentifier(), which use that for equals() comparisons of revisions. Bug:544983 Change-Id: Ic15c12d0cd4827090d124de10765b76c62e1096e Signed-off-by: Michael Keppler <>
2019-04-26Replace usage of String.indexOf with String.contains where possibleCarsten Hammer1-2/+1
Change-Id: I6976afb1bc4524a860eec3bfe11c963858419e76 Signed-off-by: Carsten Hammer <>
2019-04-26Remove unnecessary type specificationsCarsten Hammer4-11/+11
Since Java 7 the diamond operator can be used instead of explicit typeparameters. Change-Id: I602e7b1bf45ca1c6612305e655fc4618742d0d4f Signed-off-by: Carsten Hammer <>
2019-04-26Only warn about losing changes if there are changes at allThomas Wolf1-11/+43
Only show the confirmation dialog for DiscardChangesOperation if there are actually uncommitted changes on the selected files. Bug: 546194 Change-Id: Id63601bcc9e307a8a3f6bd0456dfdd2923b76b80 Signed-off-by: Thomas Wolf <>
2019-04-14Always use 7 characters for short SHA1Michael Keppler1-1/+2
Use one common implementation to create short object ids. One visible change is that commit revision editors (opened from history etc.) now show 7 instead of 6 characters after the file name. Bug:544984 Change-Id: I3207b70b9fdba746ad5781d35a64fc54bb4782f2 Signed-off-by: Michael Keppler <>
2019-03-25Integrate the smart import wizard fragment into the EGit UI bundleThomas Wolf1-0/+174
Move the class into the main bundle now that the EGit baseline is a version that supports smart import. Add the wizard extension in plugin.xml. Move the test class into the EGit UI tests and rewrite it to use a local test repo instead of trying to clone JGit over HTTPS. Remove the smartimport fragment and the ui.importer.tests project. Add the update clause to the p2.inf of EGit UI to ensure that p2 removes the fragment when EGit UI is updated. Also remove the smartimport fragment from the repository, and remove the maven modules. Change-Id: I6b9c3138da25d77995ef0acd9168ddccc3663568 Signed-off-by: Thomas Wolf <>
2019-03-24Try to stabilize testsThomas Wolf2-14/+20
Ignore one test; close a repository in another. Change-Id: I6a25f1296c5e7aefb3afd5ec6b90691b258a5128 Signed-off-by: Thomas Wolf <>
2019-03-18Reset only conflicting paths in a checkout conflictThomas Wolf2-3/+41
The two checkout conflict dialogs show only the conflicting files, but their "Reset" button then performed a reset --hard, also discarding changes on other files not shown in the dialog. This was highly unexpected. Change that reset button to only discard changes on the files shown in the dialog, i.e., the ones that caused a conflict in the first place. Use "Discard Changes" instead of "Reset" for the button text. Add a new test that verifies that non-conflicting changes are preserved. Bug: 545471 Change-Id: I4bc7045cc98b04fe6254cffe1fc44a64bb6e2d88 Signed-off-by: Thomas Wolf <>
2019-03-17Remove unnecessary @SuppressWarningsMichael Keppler1-2/+2
Checked that they are not necessary in 4.6, 4.10 and 4.11-staging. Change-Id: I8e98ccb6591e211a135087a51f13d3414573d7cd Signed-off-by: Michael Keppler <>
2019-03-16Replace usages of deprecated Repository methodsThomas Wolf1-5/+5
getTags() and peel() are deprecated; replace by equivalent other methods. Change-Id: I1edc2ff88f0f79ea3749a53bf89ffac46d4b4c62 Signed-off-by: Thomas Wolf <>
2019-02-19Fix typos in NLS keysMichael Keppler2-2/+2
During review of another change I noticed a triple character in an NLS key and did a search for all of them. Change-Id: If22bb13d61d405301607749bd5054c7df1f92263 Signed-off-by: Michael Keppler <>
2019-02-05Close resourcesMichael Keppler1-4/+4
Found running on the egit repository. Many of the other suggestions by the tool are not that good and just don't fit to our situation. Change-Id: Ib934a0bcfeda7285824c41fc5ede29dbc847ca9a Signed-off-by: Michael Keppler <>
2019-02-05Replace deprecated SWTBotCommandMichael Keppler1-4/+16
Since the SWTBotCommand usage was merely a thin wrapper around calling a command, we can replicate the deprecated code by executing the command directly. Change-Id: I3e2bf981c5312e37702f5aaea1a44058b3d3a4f0 Signed-off-by: Michael Keppler <>
2019-01-03Replace FileInputStream and FileOutputStream with static Files methodsMatthias Sohn3-11/+10
FileInputStream and FileOutputStream rely on finalize() method to ensure resources are closed. This implies they are added to the finalizer queue which causes additional work for the JVM GC process. This is an open bug on the OpenJDK [1] and the recommended workaround is to use the Files.newInputStream and Files.newOutputStream static methods instead. [1] Change-Id: I59e72d0a12d70396a5cf558029c13e2a1b0d5741 Signed-off-by: Matthias Sohn <> Signed-off-by: Michael Keppler <>
2019-01-01Fix path related failing tests on WindowsMichael Keppler1-1/+2
* DynamicVariablesTest: IPath.toString() uses a fixed separator "/", therefore the calculated variable value cannot be compared with the Windows file separator. * CommitFileRevisionTest: file revisions in commits are resolved using "/", therefore a relative Windows path cannot be located in the git storage. Change-Id: I9be225654fec285ddd1a4059fffac6058547b668 Signed-off-by: Michael Keppler <>
2018-11-25Fix Mockito deprecation warningsMichael Keppler2-2/+2
The JUnit runner hierarchy has changed, and the new super class shall be used instead of the previous runner. Change-Id: Ia6fbf8bb875c6fdc7860ecd21e2a39da5af2bd51 Signed-off-by: Michael Keppler <>
2018-11-25Change LoginDialog default button labelThomas Wolf1-1/+1
The login dialog's default button always had the label "Save". This feels unnatural when the dialog is used for logging in; it may be fine when the dialog is used to change an existing password. Change the label to "Log in" in changeCredentials == false. To ensure this flag is always set properly when we create the buttons, remove the setter for that field and pass the value as a parameter in the constructor. Bug: 541312 Change-Id: I6df0b8f592ba3f91dbb89a83e8a0be30d5738501 Signed-off-by: Thomas Wolf <>
2018-11-21Remove deprecated Repository.getAllRefs() callsMichael Keppler2-4/+8
Inline the code of the deprecated method at all places where it was called in egit. Also fix some typos around the deprecated calls. Change-Id: I388fca20b66356fbf61096e8557cf535c7ecd3b0 Signed-off-by: Michael Keppler <>
2018-11-21Refactoring: Moved refName validation method to core for better re-useMax Hohenegger1-1/+2
Also: - use IStatus result to avoid null and improve readability - use stream API for efficiency - use Message.format instead of NLS.bind Change-Id: I9118b18b6c0fce5ce1e381d8088061181b384eba Signed-off-by: Max Hohenegger <>
2018-11-21Fix usage of deprecated charset constantsMichael Keppler2-0/+2
* in test code, silence the warning, since the deprecated preference still needs to be handled by the tests * in product code, replace the deprecated charset by the java runtime defined constant for UTF8 Change-Id: I11452e7cc5bd79f6205d69e7622e83171295ff9c Signed-off-by: Michael Keppler <>
2018-10-21Use verbs instead of OKMichael Keppler9-43/+66
I went through typical UI and watched for dialogs still using OK. This is surely not exhaustive, but should at least cover many of the remaining typical operations. Wizard dialogs remain with the very generic "Finish", which we may want to think about, too. Bug: 538108 Change-Id: I2fec65a53a12c43d498546257c4e565cc2550341 Signed-off-by: Michael Keppler <> Signed-off-by: Max Hohenegger <>
2018-10-04Simplify BranchProjectTracker by removing the persisting code from itLuís Copetti1-7/+27
Some classes were added to simplify the overall code for BranchProjectTracker so that it can focus only on auto-creating/importing projects on checkout rather than having it also know how to save and restore that information. Change-Id: I5f927d9a3abc1eb492e25160891f98687f34aa30 Signed-off-by: Luís Copetti <>
2018-09-26Add support for multi repository selection for switching branchesLuís Copetti1-0/+109
When multiple repositories are selected the Switch To... option will display only the branches that are present in all of the repositories. By clicking in any of them, the user will concurrently switch branches for all the repositories. If the list of branches is to be empty, a disabled menu item will be added to show that no matching branches were found. Change-Id: I0f850baeb94cb8cb4169d8684bb37756b5c0c372 Signed-off-by: Luís Copetti <>
2018-09-18Use a separate job family for FileDiffContentProviderThomas Wolf1-3/+3
Using the HISTORY_DIFF family was wrong; it's reserved for generating the unified diff. That family is canceled in GitHistoryPage when new diff are to be generated, which may inadvertently also cancel the file diff generation. Give the job in the asynchronous FileDiffContentProvider its own job family. It needs a family so that UI tests can join on it. Bug: 539099 Change-Id: I6f168cbd2544d2e08617536271a71ed6ebd027fb Signed-off-by: Thomas Wolf <>
2018-09-12[test] Fix typo in HistoryViewTestThomas Wolf1-1/+1
Change-Id: I53281cf0c9ff0a228a1ac0b6bf72b9c86cf8a329 Signed-off-by: Thomas Wolf <>
2018-09-10[releng] Fix unstable HistoryViewTest.testOpenOfDeletedFile()Thomas Wolf1-2/+12
The file diff viewer newly computes its content asynchronously. Give that background job a job family, and join on it in the test to ensure that the expected content is actually there. Change-Id: I80335bb7540ca8395a1bf10262d9de21bbd944ac Signed-off-by: Thomas Wolf <>
2018-09-08Allow horizontal space in file:// URIishs in GitUrlCheckerThomas Wolf1-0/+21
Bug: 538322 Change-Id: I8184e9867474934df4a703c1a1b8e7ac7d5aeb85 Signed-off-by: Thomas Wolf <>
2018-08-13refactor: simplify collection.toArray()Michael Keppler2-2/+2
On recent VMs, collection.toArray(new T[0]) is faster than collection.toArray(new T[collection.size()]). Since it is also more readable, it should now be the preferred way of collection to array conversion. Change-Id: If0c3202aa3ebb2d4e4ea68da8fe431cd8f363826 Signed-off-by: Michael Keppler <>
2018-08-07[releng] Fix test failuresThomas Wolf1-14/+5
StagingViewTest also uses the git repositories view and therefore must use the same mechanisms as the other git repositories view tests to avoid leaking references to repository tree nodes across tests. Also fix an NPE during tests in FileDiffContentProvider: make sure the UI update doesn't run if the content provider has been disposed already. Change-Id: Ib08ce78e4f76207adfa0920b3cfa94d55186a706 Signed-off-by: Thomas Wolf <>

Back to the top