DESCRIPTION

Do not autofill clone wizard for arbitrary clipboard input

The clone wizard would auto-fill also if the clipboard contained
arbitrary, non-git related HTTP(S) URLs. This is a regression that was
introduced in commit 39f3c68.

Remove the tests for HTTP protocols. They are allowed anyway by the
general test that the clipboard content ends in .git.

Also consider only clipboard content up to the first whitespace (after
having removed a potential "git clone" prefix). Formerly, we stopped at
the first blank, not general whitespace, and would thus autofill even
with multi-line clipboard content like

  foobar
  baz
  .git

(No blank in there, just line endings.)

Finally, add missing braces and remove a spurious trim() call.

Change-Id: I04e5912b3a28dc911a54dea8255dd64eca58896e
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Alayna Houston
date: 2016-01-30 18:02:26.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2016-01-30 18:02:32.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/8094/

-------------------------------------
author: Brenden Conley
date: 2016-01-30 18:27:55.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/8094/ : SUCCESS

-------------------------------------
author: Douglas Trujillo
date: 2016-02-17 23:10:51.000000000

Patch Set 3:

(1 comment)

Line:13, /COMMIT_MSG -> Gerrit does not advertise http URLs ending with .git, see e.g.
https://git.eclipse.org/r/#/admin/projects/egit/egit

We could check if a repository was already cloned from the same host. Then for the first repository cloned from a given host auto-fill wouldn't be triggered but for all subsequent repositories cloned from the same host auto-fill would be used. This way we could reduce chances for false-positives and still provide auto-fill for the very common case that a given git server typically hosts many repositories and users often clone multiple repos from the same server.

-------------------------------------
author: Alayna Houston
date: 2016-02-18 19:23:29.000000000

Patch Set 3:

(1 comment)

Line:13, /COMMIT_MSG -> OK, valid use case. I wonder if going through all repositories' configs and reading their remotes (and submodules) is feasible -- yes, the config is cached, but (a) it might not yet be, and (b) bug 484795 has shown that even getting the last-modified time may be expensive. So that approach might lead to a noticeable delay until the dialog comes up.

-------------------------------------
author: Douglas Trujillo
date: 2016-02-21 22:06:15.000000000

Patch Set 3:

> (1 comment)

bug 484795 was mainly caused by the fact that ~/.gitconfig was located on a remote disk causing much larger latency for file system accesses

-------------------------------------
author: Alayna Houston
date: 2016-02-21 22:14:02.000000000

Patch Set 3:

> bug 484795 was mainly caused by the fact that ~/.gitconfig was
 > located on a remote disk causing much larger latency for file
 > system accesses

I know. But at least the last-modified time stamp of ~/.gitconfig is accessed every time in FileRepository.getConfig().

-------------------------------------
author: Douglas Trujillo
date: 2016-02-22 07:44:38.000000000

Patch Set 3:

> > bug 484795 was mainly caused by the fact that ~/.gitconfig was
 > > located on a remote disk causing much larger latency for file
 > > system accesses
 > 
 > I know. But at least the last-modified time stamp of ~/.gitconfig
 > is accessed every time in FileRepository.getConfig().

maybe we could instead use the URIs (RepositorySelectionPage.UsedUris) stored in <workspace>/.metadata/.plugins/org.eclipse.egit.ui/dialog-settings.xml to find already known git servers or add another explicit cache of known git servers

-------------------------------------
author: Alayna Houston
date: 2016-02-25 22:46:10.000000000

Patch Set 3:

> maybe we could instead use the URIs (RepositorySelectionPage.UsedUris)
 > stored in <workspace>/.metadata/.plugins/org.eclipse.egit.ui/dialog-settings.xml
 > to find already known git servers or add another explicit cache of
 > known git servers

RepositorySelectionPage.UsedUris only stores the last 10 URIs... so yes, maybe storing a second dialog setting recording only host names and having a somewhat higher limit might be an idea.

-------------------------------------
author: Douglas Trujillo
date: 2016-02-26 00:12:00.000000000

Patch Set 3:

> > maybe we could instead use the URIs (RepositorySelectionPage.UsedUris)
 > > stored in <workspace>/.metadata/.plugins/org.eclipse.egit.ui/dialog-settings.xml
 > > to find already known git servers or add another explicit cache
 > of
 > > known git servers
 > 
 > RepositorySelectionPage.UsedUris only stores the last 10 URIs... so
 > yes, maybe storing a second dialog setting recording only host
 > names and having a somewhat higher limit might be an idea.

I forgot about the limit of 10 entries, yes storing a list of known git server host names could be a solution

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-02-27 15:46:42.000000000

Change has been successfully merged into the git repository by Alayna Houston

-------------------------------------
