emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: project.el: git submodules?


From: Gary Oberbrunner
Subject: Re: project.el: git submodules?
Date: Tue, 12 May 2020 15:50:22 -0400

eglot is exactly how I got to this :-)

In my case I can fix my submodule, but if there are other cases I
guess writing a `project-find-functions` function makes sense.
And, thanks to this exchange I just learned about git worktrees! Only
been using git for a dozen years, clearly still a newb.

-- Gary

On Tue, May 12, 2020 at 3:44 PM Doug Davis <address@hidden> wrote:
>
> Gary Oberbrunner <address@hidden> writes:
>
> > In my case at least, you're right and my submodule is seriously
> > confused. It has a .git/ dir which disagrees with the ../.git/modules
> > one. That's what was causing my problem. I've been doing a lot of work
> > in that submodule (multiple upstream repos, merges, pushes, etc.) and
> > perhaps something I did made it create that.
> >
> > Apparently the correct way to do this is "git rev-parse
> > --show-superproject-working-tree". See
> > https://stackoverflow.com/questions/7359204 for more info. (And in
> > fact that does work in my case even with my messed-up .git dir in the
> > submodule.)
>
> For potentially complex setups it might be worth defining a personal
> project discovery scheme, write a function compatible with it, and add
> that function to `project-find-functions'.
>
> Personal example: the first time I spun up `eglot' in a project that was
> composed of submodules I ran into the issue that project.el didn't find
> the top level repository as the project where the language server should
> be initialized (this was quite some time ago, I guess before submodule
> support was added to project.el).
>
> Since I was already a projectile user, the solution (which I found
> thanks to a comment on an eglot GitHub issue) was to add a new function
> to `project-find-functions' which just queried projectile for what it
> determined to be the project root. This was possible at the time because
> projectile will search up the directory tree for a .projectile file to
> define a project root, and I was already using that discovery mechanism
> for that particular repository.
>
> I was lazy and used projectile as a middle-step, but I think it would be
> pretty straight forward to write a function to search for .emacs-project
> files or something.
>
>      Doug



-- 
Gary



reply via email to

[Prev in Thread] Current Thread [Next in Thread]