Author Topic: SE Appears confused by nested git repositories  (Read 1826 times)

b

  • Senior Community Member
  • Posts: 185
  • Hero Points: 9
SE Appears confused by nested git repositories
« on: February 06, 2017, 11:29:40 pm »
SE 21.0.1 (Hotfix 3) 64-bit
Ubuntu 14.04.5 LTS

Working with Yocto based trees appears to cause SE's SCM confusion.  Specifically, Yocto as has a root "poky" tree, which is one git repo, and then within the poky/ directory may be several other recipe directory trees, each possibly being their own SCM (git or otherwise).  The build is created via bitbake, which amongst other things checks out the kernel, patches, configures, and builds it.  When it checks it out, it does just that, clones the kernel tree (from git.kernel.org/), applies/commits patches to that cloned copy of the git tree and then is available for building.

E.g., poky/build/tmp/work-shared/<platform>/kernel-source

The entire build/ directory is transient.  Thus, I've needed to create my SE workspace and project above (or in) the poky/ directory so that the SE files aren't blown away.

When working with the kernel in this environment, you edit the file in this transient space, commit the change and then extract out the patch to be placed in a recipe directory.

The problem I've encountered is trying to use the git browser via SE while working in these files.  It appears that SE assumes with selecting a file, that the repository must exist in the directory of the workspace/project, not the location of the file (which may be nested as described).

I'm seeing the following error in my output (which would be correct relevant to the SE project & workspace files, but not for the file being edited):

Code: [Select]
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

So even though I have the file open, I get very inconsistent errors (either complaining about not finding the repo, or opening a repo for a workspace that isn't even open -- or even in the directory path of the SE files to / root!). 

The project working directory is configure to the top of the kernel source tree.

For my scenerio, I have SE files:
~/skunk/krogroth.new/krogoth.new-kernel.vp[jw]
The project's working directory is configured as:
~/skunk/krogoth.new/poky/build/tmp/work-shared/quanta-sled/kernel-source/
I'm working on file (which is in the project file):
~/skunk/krogoth.new/poky/build/tmp/work-shared/quanta-sled/kernel-source/arch/arm/mach-aspeed/ast-uart-sdma.c

There is no git (or any) repo in the path for ~/skunk/krogoth.new up to /.

I have confirmed via shell, that ~/skunk/krogoth.new/poky/build/tmp/work-shared/quanta-sled/kernel-source/ is the root of a git repo for the kernel source.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1852
  • Hero Points: 75
Re: SE Appears confused by nested git repositories
« Reply #1 on: February 07, 2017, 07:54:31 pm »
Just to be clear you're using the new "Browse Repository" feature?

This is a public repository?

b

  • Senior Community Member
  • Posts: 185
  • Hero Points: 9
Re: SE Appears confused by nested git repositories
« Reply #2 on: February 07, 2017, 08:48:41 pm »
Yes and yes.

Example of a typical Yocto project (mine is a variant, but I provide this one as an example as it is completely publicly accessible):
Code: [Select]
git clone -b fido https://git.yoctoproject.org/git/poky
cd poky
git clone -b fido https://github.com/openembedded/meta-openembedded.git
git clone https://github.com/facebook/openbmc.git meta-openbmc
export TEMPLATECONF=meta-openbmc/meta-facebook/meta-wedge/conf
source oe-init-build-env
bitbake wedge-image

After the sourcing of the oe-init-build-env, a new directory build/ is created and you are placed in it.  Execution of bitbake will then pull all open source, configure and build everything (and on a 56 core/2.3GHz Xeon processors/64GB memory takes about 25 minutes -- slower/smaller configurations can take hours).

But, to illustrate just the kernel environment, only execute the following bitbake command instead of the one above:
Code: [Select]
bitbake -c devshell linux-aspeed
This will only download and build what is necessary to work with just the kernel.  It will then clone kernel source, patch it (based on the facebook recipes in this example) then open a new session with you in the root of the kernel source.   The kernel source is accessible (outside this "root shell"), but this is the easiest way to get something quickly set up to a Yocto environment and demonstrate their (Yocto's) design of projects with the nesting of repositories and the environment that one needs to work in.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1852
  • Hero Points: 75
Re: SE Appears confused by nested git repositories
« Reply #3 on: February 08, 2017, 03:01:23 pm »
Can I replicate the problem with the Repository Browser just by doing the clones?

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1852
  • Hero Points: 75
Re: SE Appears confused by nested git repositories
« Reply #4 on: February 08, 2017, 05:15:53 pm »
How did you launch this?  Did you do Tools>Version Control>Browse repository, or Tools>Version Control>Compare Workspace with git?

b

  • Senior Community Member
  • Posts: 185
  • Hero Points: 9
Re: SE Appears confused by nested git repositories
« Reply #5 on: February 08, 2017, 08:41:44 pm »
The former.  Via Tools>Version Control>Browse repository...

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1852
  • Hero Points: 75
Re: SE Appears confused by nested git repositories
« Reply #6 on: February 08, 2017, 08:43:35 pm »
I didn't have this problem.  Did you just add the workspace path when it prompted you to?

b

  • Senior Community Member
  • Posts: 185
  • Hero Points: 9
Re: SE Appears confused by nested git repositories
« Reply #7 on: February 08, 2017, 10:04:48 pm »
1) It doesn't prompt me
2) it brings up a repository browser for a repository that isn't referenced in this workspace or project (let alone for the file that is presently in focus)

E.g., I have file /home/bjkurlex/skunk/krogoth.new/poky/build/tmp/work-shared/quanta-sled/kernel-source/arch/arm/plat-aspeed/devs.c (time to catch my breath) open an in focus, but either via tools, or via right clicking the source and getting at the repository that it brings up a repository as shown below (not even in the path from / to the file in question).

Also attached is the workspace/project that is opened at the time. 

I've also got a snapshot showing what the current workspace/project that is opened, but you can see that the repo it pulls is from an unrelated workspace in my history.   It appears to be pulling a repo from another workspace of mine.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1852
  • Hero Points: 75
Re: SE Appears confused by nested git repositories
« Reply #8 on: February 08, 2017, 10:09:39 pm »
The list of repositories is global.  Do you just need to click the '+' button to add the one for the current workspace?  I probably need to do some work in this area, but will this get you what you want in the meantime?

b

  • Senior Community Member
  • Posts: 185
  • Hero Points: 9
Re: SE Appears confused by nested git repositories
« Reply #9 on: February 08, 2017, 10:29:28 pm »
I must be missing something here.  Where are the repositories added (where is the '+' you are referencing)?   Up until now, I had just did a "Setup" and selected git as the version control provider, and then when I did work on the file, it (I thought) used the repository where the file was located.

I have not found yet where you add a repository and my first looking through the online manual doesn't reference.

The file is a part of the project (as you can confirm in my previously posted project file).

b

  • Senior Community Member
  • Posts: 185
  • Hero Points: 9
Re: SE Appears confused by nested git repositories
« Reply #10 on: February 08, 2017, 10:32:35 pm »
oops, didn't save image before the message post.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1852
  • Hero Points: 75
Re: SE Appears confused by nested git repositories
« Reply #11 on: February 09, 2017, 02:38:08 pm »
I'm sorry, I meant to come back online last night and answer this and got distracted.

Bring up the browser itself, and there is a plus button between the path/repository list and the graph tree.  Put the local path you want to do here.  When you first open it, and there are no repositories in the list, it does the workspace path (or the project path).  For others, you need to add them.  In this case you'll need to add the sub-repositories too.

I think this can probably be improved so it's a bit more intuitive.  I'm open to suggestions - do you have the project working directory set?

b

  • Senior Community Member
  • Posts: 185
  • Hero Points: 9
Re: SE Appears confused by nested git repositories
« Reply #12 on: February 09, 2017, 06:49:43 pm »
Yes, in my first post in this thread I stated that I have the project working directory set to the root of the kernel repository.

Yes, those buttons aren't intuitive to what I expected.   

When I am in one workspace/project, I assume (and suggest) that I will get the repository of the file I'm working on as this is what I expect at the command line.  I don't want to have to reorder the preference list every time I switch workspaces (or projects), which I do very frequently.  Defaulting to the first one every time and having to go the extra steps to move to the one containing the file I'm working on is a pain.

Another suggestion is to create a separate menu item / SE command that is Browse repository for <file.x> in addition to the current Browse repository... (which I think would be clearer if you made Browse repositories... as that apparently is what this function really means).   

Although the ability to browse other repositories independent of the file currently under edit is nice feature, being able to directly get to the repository containing the file I'm editing (or directory tree if this is a new file not yet added) is what I would prefer.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1852
  • Hero Points: 75
Re: SE Appears confused by nested git repositories
« Reply #13 on: February 09, 2017, 06:57:05 pm »
Let me think about what I can do about this.

b

  • Senior Community Member
  • Posts: 185
  • Hero Points: 9
Re: SE Appears confused by nested git repositories
« Reply #14 on: February 09, 2017, 06:59:54 pm »
Thanks!