Bug 230535 - Because of git I cannot create a test case
Summary: Because of git I cannot create a test case
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.2.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ondrej Vrabec
: 230608 (view as bug list)
Depends on: 230572
  Show dependency tree
Reported: 2013-05-30 13:48 UTC by peathal
Modified: 2013-06-02 13:57 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

The exception. (3.47 KB, text/plain)
2013-05-31 09:37 UTC, Jan Lahoda

Note You need to log in before you can comment on or make changes to this bug.
Description peathal 2013-05-30 13:48:24 UTC
No really sure if this is a java or git module bug.

I track my project under git. When I add the following to git (to fetch all pull requests):

[remote "pr"]
   fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
   url = git+ssh://git@github.com/graphhopper/graphhopper.git

then NetBeans reports something with invalid wildcards (disappears very fast so I can't tell you the details ;)) when I try to create a new test for a class:

hit CTRL+SHIFT+U and then simply ENTER

And the dialog keeps open but no test is created. To fix this I can uncomment the above lines in .git/config and reopen my project.
Comment 1 Jan Lahoda 2013-05-31 09:37:40 UTC
Created attachment 135169 [details]
The exception.
Comment 2 Ondrej Vrabec 2013-05-31 10:48:29 UTC
> fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
i have never seen such a use of refs specs. Is it allowed in git? Please point me to some documentation of this specific usage.
Anyway, i will hardly fix this, it's coming from JGit, you should file a bug there and explain why their expected formats are insufficient: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JGit
Looking at their parsing method, they expect:
Parse a ref specification for use during transport operations.
 * <p>
 * Specifications are typically one of the following forms:
 * <ul>
 * <li><code>refs/head/master</code></li>
 * <li><code>refs/head/master:refs/remotes/origin/master</code></li>
 * <li><code>refs/head/*:refs/remotes/origin/*</code></li>
 * <li><code>+refs/head/master</code></li>
 * <li><code>+refs/head/master:refs/remotes/origin/master</code></li>
 * <li><code>+refs/head/*:refs/remotes/origin/*</code></li>
 * <li><code>:refs/head/master</code></li>
 * </ul>

I can suppress the exception so it does not block creating the file, but that will probably end up in broken and unavailable git support for your project.
Comment 3 peathal 2013-05-31 10:53:41 UTC
I'm not sure if this is a valid format but here you see it: https://gist.github.com/piscisaureus/3342247 and also others are using it :)
Comment 4 Ondrej Vrabec 2013-05-31 11:06:42 UTC
i took a quick check and it's probably fixed in JGit already: http://git.eclipse.org/c/jgit/jgit.git/commit/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java?id=a51899c2036984fa7a04290ca1364a02af34f95a
But we have to wait until JGit 3.0 is released.
Comment 5 peathal 2013-05-31 11:17:41 UTC
ok, thanks!
Comment 6 Ondrej Vrabec 2013-05-31 11:33:06 UTC
for now i'll try to workaround the exception so the exception does not block you. We won't upgrade JGit sooner than in the next release (after 7.4)
Comment 7 peathal 2013-05-31 11:53:33 UTC
No workaround or hurry is necessary. I mean for me this is not critical. I can uncomment these lines and all is fine.
Comment 8 Ondrej Vrabec 2013-05-31 12:09:23 UTC
fix: http://hg.netbeans.org/core-main/rev/3e7f2efc32e7
Comment 9 Quality Engineering 2013-06-02 01:08:18 UTC
Integrated into 'main-golden', will be available in build *201306012301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3e7f2efc32e7
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #230535 - Because of git I cannot create a test case
the exception is only logged and user is notified only when it's really needed (running fetch, pull, push)
Comment 10 Ondrej Vrabec 2013-06-02 13:54:34 UTC
*** Bug 230608 has been marked as a duplicate of this bug. ***
Comment 11 Omertron 2013-06-02 13:57:17 UTC
In case anyone else wanders through here with a similar issue.

Mine was caused on Windows with the GitHub client. Uninstalling (Including ALL the user directories) and re-installing that cleared the issue for me