all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gary Oberbrunner <garyo@oberbrunner.com>
To: Doug Davis <ddavis@ddavis.io>
Cc: emacs-devel@gnu.org, Dmitry Gutov <dgutov@yandex.ru>
Subject: Re: project.el: git submodules?
Date: Tue, 12 May 2020 15:50:22 -0400	[thread overview]
Message-ID: <CAFChFyhqkxe8L60toRkGRCZ3dsr4MknpGXc3uS_HM3ATmk-e_w@mail.gmail.com> (raw)
In-Reply-To: <87mu6d0wh2.fsf@ddavis.io>

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 <ddavis@ddavis.io> wrote:
>
> Gary Oberbrunner <garyo@oberbrunner.com> 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	other threads:[~2020-05-12 19:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 15:31 project.el: git submodules? Gary Oberbrunner
2020-05-12 15:53 ` Dmitry Gutov
2020-05-12 18:05   ` Michael Welsh Duggan
2020-05-12 18:27     ` Dmitry Gutov
2020-05-12 19:36       ` Stefan Monnier
2020-05-12 19:39         ` Dmitry Gutov
2020-05-12 20:45         ` Michael Welsh Duggan
2020-05-12 20:53           ` Dmitry Gutov
2020-05-12 21:04             ` Stefan Monnier
2020-05-12 21:06               ` Dmitry Gutov
2020-05-12 21:09                 ` Stefan Monnier
2020-05-14  0:32                   ` Dmitry Gutov
2020-05-14  2:55                     ` Stefan Monnier
2020-05-14 15:04                       ` Dmitry Gutov
2020-05-14 17:57                         ` Stefan Monnier
2020-05-14 19:29                           ` Dmitry Gutov
2020-05-14 20:01                             ` Stefan Monnier
2020-05-14 20:13                               ` Dmitry Gutov
2020-05-14 21:17                                 ` Dmitry Gutov
2020-05-14 21:38                                   ` Michael Welsh Duggan
2020-05-15  1:21                                     ` Dmitry Gutov
2020-05-15  5:11                                       ` Dmitry Gutov
2020-05-15  7:40                                         ` Kévin Le Gouguec
2020-05-15 19:17                                           ` Dmitry Gutov
2020-05-12 20:53           ` Michael Welsh Duggan
2020-05-12 20:51       ` Michael Welsh Duggan
2020-05-12 20:58     ` John Yates
2020-05-13  7:19       ` Andreas Schwab
2020-05-12 18:33   ` Gary Oberbrunner
2020-05-12 19:28     ` Dmitry Gutov
2020-05-12 19:34       ` Gary Oberbrunner
2020-05-12 19:41         ` Dmitry Gutov
2020-05-12 19:44     ` Doug Davis
2020-05-12 19:50       ` Gary Oberbrunner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFChFyhqkxe8L60toRkGRCZ3dsr4MknpGXc3uS_HM3ATmk-e_w@mail.gmail.com \
    --to=garyo@oberbrunner.com \
    --cc=ddavis@ddavis.io \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.