Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 209839 - Git fails to recognize git submodules as separate clones
Git fails to recognize git submodules as separate clones
Status: VERIFIED FIXED
Product: versioncontrol
Classification: Unclassified
Component: Git
7.2
PC Linux
: P2 with 1 vote (vote)
: 7.2
Assigned To: Ondrej Vrabec
issues@versioncontrol
71patch2-verified
:
Depends on: 208993
Blocks: 207067
  Show dependency treegraph
 
Reported: 2012-03-21 09:53 UTC by Ondrej Vrabec
Modified: 2012-04-18 13:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ondrej Vrabec 2012-03-21 09:53:09 UTC
Because as of git 1.7.8 submodules do not contain .git folder but rather git link to $ROOT/.git/modules/... instead. Because it is a file and not a folder, Git support fails to recognize it as a separate module. Taken from git 1.7.8 relnotes:
> When populating a new submodule directory with "git submodule init",
> the $GIT_DIR metainformation directory for submodules is created inside
> $GIT_DIR/modules/<name>/ directory of the superproject and referenced
> via the gitfile mechanism. This is to make it possible to switch
> between commits in the superproject that has and does not have the
> submodule in the tree without re-cloning.
Comment 1 jessholle 2012-03-21 11:44:42 UTC
Addressing this is critical to the Git module being useful!
Comment 2 devarni 2012-03-30 10:55:38 UTC
Yes, this behaviour was changed with GIT and so Git submodule support is broken with Netbeans. Highly recommended to fix this as soon as possible
Comment 3 Quality Engineering 2012-04-03 11:12:57 UTC
Integrated into 'main-golden', will be available in build *201204030400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e2a69f8f89a3
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #209839 - Git fails to recognize git submodules as separate clones
Comment 4 jessholle 2012-04-03 20:19:47 UTC
This made a huge difference in NetBeans' Git usability.

I now see proper history, in-editor change bars, and status for files managed by Git submodules.

I do notice that things beyond this seems not to function as expected, though.  For instance, I modified a file and Git and NetBeans agreed on that.  I tried to revert the changes via both Revert and Checkout in NetBeans -- neither worked.  The command line worked great, though.

I'm happy using the command-line a fair amount, but I note that the critically important "explore from here" plug-in (http://plugins.netbeans.org/plugin/15619/explore-from-here) does not work in 7.2 right now.  This makes hopping out to use the command line where needed a real pain.
Comment 5 jessholle 2012-04-03 20:30:09 UTC
Actually it's now clear that Explore from Here is only half-broken in 7.2.  It works for folders but not individual files.
Comment 6 Ondrej Vrabec 2012-04-04 07:17:12 UTC
> I tried to revert the changes via both Revert and Checkout in NetBeans -- neither worked.  The command line worked great, though.
Works fine form me, i select a modified file from a submodule, and run Git -> Revert -> Revert Modifications... from its contextual menu and click on Revert. The file is reverted.
> I note that the critically important "explore from here" plug-in (http://plugins.netbeans.org/plugin/15619/explore-from-here) does not work in
7.2 right now.  This makes hopping out to use the command line where needed a
real pain.
I have no idea what you're talking about and what relation this 3rd party plugin has to this issue. I suggest you file a bug to their bug tracker.
Marking this as fixed.
Comment 7 jessholle 2012-04-04 12:52:53 UTC
The only relation of the 3rd party module is that it is the only thing that makes it tolerable to hop out to the command-line where the IDE doesn't do the job.

As for Revert and Checkout, I tried all possible options.  NetBeans didn't show any attempted Git commands in the output, whereas it did for commands to list modifications, etc.  It was like these UI options were no-ops -- apart from showing dialogs, that is.

Things are much improved, but something still is not right.
Comment 8 devarni 2012-04-04 13:00:37 UTC
Will (In reply to comment #3)
> Integrated into 'main-golden', will be available in build *201204030400* on
> http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
> Changeset: http://hg.netbeans.org/main-golden/rev/e2a69f8f89a3
> User: Ondrej Vrabec <ovrabec@netbeans.org>
> Log: #209839 - Git fails to recognize git submodules as separate clones

Will it find also their way into the next PHPStorm EAP?
Comment 9 Ondrej Vrabec 2012-04-04 13:02:13 UTC
This is printed into the output after Git -> Revert -> Revert Modifications on the file
> ==[IDE]== Apr 4, 2012 2:59:35 PM Checkout Files
> git reset HEAD /home/ondra/NetBeansProjects/git/207067/7/JavaApplication80/src/javaapplication80/submodule/file
> git checkout --  /home/ondra/NetBeansProjects/git/207067/7/JavaApplication80/src/javaapplication80/submodule/file
> file
> ==[IDE]== Apr 4, 2012 2:59:35 PM Checkout Files finished.
Are you sure that you:
1) call the action on the modified file and not e.g. on the parent project (the parent module and not the submodule)?
2) have the first option in the dialog selected: Revert Uncommitted Changes both in WT and Index
?
Comment 10 Ondrej Vrabec 2012-04-04 13:04:32 UTC
> Will it find also their way into the next PHPStorm EAP?
Sorry, i don't know what it is. Can you provide a link?
Comment 11 devarni 2012-04-04 13:09:47 UTC
(In reply to comment #10)
> > Will it find also their way into the next PHPStorm EAP?
> Sorry, i don't know what it is. Can you provide a link?

http://confluence.jetbrains.net/display/WI/Web+IDE+EAP
Comment 12 Ondrej Vrabec 2012-04-04 13:13:58 UTC
> Will it find also their way into the next PHPStorm EAP?
JetBrains PHPStorm does not look like an application built upon NetBeans platform so i believe the answer is: No, the fix will not get it into PHPStorm
Comment 13 jessholle 2012-04-04 13:37:50 UTC
I don't know what I was doing yesterday, but it is now clear that Revert and Checkout kind of work.  They revert the changes but the file still considered as changed by both Git and NetBeans.  git diff says:

warning: LF will be replaced by CRLF in src_web/wtcore/jsp/jmx/logEvents.jsp.
The file will have its original line endings in your working directory.

Thus the changes are undone, but somehow NetBeans is producing the wrong end-of-line termination as compared to the Git configuration.
Comment 14 Ondrej Vrabec 2012-04-04 13:42:31 UTC
> warning: LF will be replaced by CRLF in src_web/wtcore/jsp/jmx/logEvents.jsp.
> The file will have its original line endings in your working directory.
What is the value of core.autocrlf in the clone? Both in .git/config of the submodule and the parent clone and also in the installation of the git commandline client (i guess C:\Program Files\Git... on Win).
Comment 15 jessholle 2012-04-04 14:10:37 UTC
autocrlf = true in C:\Program Files (x86)\Git\etc\gitconfig.

I have filed a separate bug, 210705, on this issue.

There is an issue in that Git certainly understands which line endings it is using -- and NetBeans (or JGit) doesn't.
Comment 16 Stepan Zebra 2012-04-05 10:45:31 UTC
(In reply to comment #3)
> Integrated into 'main-golden', will be available in build *201204030400* on
> http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
> Changeset: http://hg.netbeans.org/main-golden/rev/e2a69f8f89a3
> User: Ondrej Vrabec <ovrabec@netbeans.org>
> Log: #209839 - Git fails to recognize git submodules as separate clones

verified, please integrate into 7.1.2
Comment 17 Ondrej Vrabec 2012-04-05 10:55:20 UTC
release71_fixes: http://hg.netbeans.org/releases/rev/26a05a54c949
Comment 18 Quality Engineering 2012-04-06 01:20:45 UTC
Integrated into 'releases', will be available in build *201204052205* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/26a05a54c949
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #209839 - Git fails to recognize git submodules as separate clones
(transplanted from e2a69f8f89a3131ed342d17a932e6e9c8e2c6be9)
Comment 19 Stepan Zebra 2012-04-18 13:40:17 UTC
patch successfully delivered into 7.1.2, however problem with recognition of 1.7.8+ git clones persists and requires JGit library upgrade -> reseting TM to 7.2


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo