Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 315575

Summary: When adding a 'push' repository, connection is attempted on each char typed
Product: [Technology] EGit Reporter: Alex Blewitt <alex.blewitt>
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: ashw.kumar, jsujjavanich, Lars.Vogel, malaperle, mathias.kinzler, matthias.sohn, mendrel, mn
Version: 0.8.0   
Target Milestone: 0.9.0-M1   
Hardware: All   
OS: All   
Whiteboard:

Description Alex Blewitt CLA 2010-06-03 08:58:31 EDT
Steps to reproduce:

== Creating the repo on the server ==
1. run git init --bare /tmp/test.git
2. run git daemon--export-all --enable=receive-pack 

== Creating the project
1. Create a new project in a clean workspace called Test
2. Team -> Share project
3. Highlight line
4. Create new repository
5. Finish
6. Right-click on 'test' and do 'commit' so that there's some data (will pick .project by default)

== Adding to repositories view ==

1. Open Git repositories view
2. Click on ()+ git button
3. Add Test.git repository

== Pushing to git://localhost repository ==

1. Right-click on Test repository
2. Select push
3. Type into the URL git://localhost/t
4. Note that an error is displayed 'Cannot get remote repository refs: git://locahost/t is not found'
5. Note also that the git-daemon reports '/t' does not appear to be a git repository
6. Type in 'm'
7. See above, but for /tm
8. Connection tried for every char typed (including deletes) until full repository is inserted

== In a previous environment == 

Note that once you've pushed it once, the git://localhost/tmp/test.git is in the previously-used-values environment. If you pick this, it fills the entire dialog in one go, and thus only hit once.

However, I think we should skip the actual connection until we hit on 'next', like we do when we're attempting to clone a repository in the first place.
Comment 1 Missing name CLA 2010-06-23 16:00:48 EDT
I second this report.

It doesn't make sense to re-test the connection after each character typed in the repo name/uri
Comment 2 Alex Blewitt CLA 2010-06-24 05:02:27 EDT
OK, so here's what's happening:

* RepositorySelectionPage.canFlipToNextPage() calls
* RepositorySelectionPage.getNextPage(), which calls
* RefSpecPage.setSelection(), which calls
* RefSpecPage.validate(), which calls
* RefSpecPage.revalidateImpl(), which calls
* ListRemoteOperation.run(), which calls
* Transport.open()

This is being called on every keypress. I think the easiest way to do that is remove the check from 'canFlipToNextPage'.
Comment 3 Alex Blewitt CLA 2010-06-24 05:07:36 EDT
On second thoughts, the problem is the way that we set the selection on the RefSpecPage in PushWizard.getNextPage(). We shouldn't be setting the selection at all since it's not ready yet; we should do that on the transition (i.e. when the RefSpecPage is shown, not before)
Comment 4 Matthias Sohn CLA 2010-06-24 07:43:12 EDT
(In reply to comment #1)
> I second this report.
> 
> It doesn't make sense to re-test the connection after each character typed in
> the repo name/uri

+1, the current behavior is crazy and should be fixed
Comment 5 Matthias Sohn CLA 2010-06-28 19:21:15 EDT
*** Bug 318232 has been marked as a duplicate of this bug. ***
Comment 6 Mathias Kinzler CLA 2010-07-02 11:40:20 EDT
Code review at
http://egit.eclipse.org/r/#change,1037
Comment 7 Mathias Kinzler CLA 2010-07-12 08:31:51 EDT
Fixed with d3da85b78a499ba2607417cb2b6968489729aaf5
Comment 8 Mathias Kinzler CLA 2010-09-06 03:21:38 EDT
*** Bug 324415 has been marked as a duplicate of this bug. ***
Comment 9 Mathias Kinzler CLA 2010-10-01 02:28:39 EDT
*** Bug 325073 has been marked as a duplicate of this bug. ***