From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Gary Oberbrunner Newsgroups: gmane.emacs.devel Subject: Re: project.el: git submodules? Date: Tue, 12 May 2020 15:50:22 -0400 Message-ID: References: <87mu6d0wh2.fsf@ddavis.io> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="24137"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Dmitry Gutov To: Doug Davis Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 12 21:51:37 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYawC-00068y-3A for ged-emacs-devel@m.gmane-mx.org; Tue, 12 May 2020 21:51:36 +0200 Original-Received: from localhost ([::1]:59332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYawB-00078v-2x for ged-emacs-devel@m.gmane-mx.org; Tue, 12 May 2020 15:51:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYavG-0005vw-UI for emacs-devel@gnu.org; Tue, 12 May 2020 15:50:39 -0400 Original-Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]:44887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYavF-0003iL-90 for emacs-devel@gnu.org; Tue, 12 May 2020 15:50:38 -0400 Original-Received: by mail-ej1-x643.google.com with SMTP id x20so8508763ejb.11 for ; Tue, 12 May 2020 12:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oberbrunner.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P/XFozfOItuSEHJEfzEH4mCT0sqFZJs3HpSSawVRZs8=; b=gAJhLLgc80A7T3d8skZA4Ht4WWsLE76bNectDjlRTpPPvanfuQvfLIhMN7suZ050FY Oof2vlH1k61Q+VB0NlMLJoMUMDbfSWOS+dhAsyWZv2X97MYD7q8zYllQZvn2Ckm+R6LL rNQjG0ScM8wCVfZKorL6Y26Jw9VN9ghzGNisXLPvV/AbFgrC522phQH4ceAFGKqhL0mJ LrrpCyP5ftyRnI9BZbp41kqZcdNuRWi3mPU++Vy/RACJwZLGxqAwgTKKyJYft6+T5+lM itqnQH1hXOdHulsHtV/cnVODTM60VXCv1WLVJ1f28Rg3VoNXRYVnysWL/FvNPikaOiS7 hgjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P/XFozfOItuSEHJEfzEH4mCT0sqFZJs3HpSSawVRZs8=; b=Hk/UJIySQMWcNDTjSYCqKMD5qBsQ9nv6btnK0yw77PJSixIxTJNNzg18n2XoR23BeZ FvThUVgwAg+sT9XPByFZMtxirEcSDzghpB249d4JUzQ92BJsOOthYbj8aDRgVoZCkIMJ tsAS/2jRMsIyHyUmFha/ZWDWWBn5U3XG+V+s7PfFw26IbG+Yi4habZbYBVGNrMiz+miB 1uEY0p49lo9qBuGrkwd8Q3uPU8hItm4aJ5iU/QOP/IZxtWCywAhLSi1ylDx7x6ckRdDQ r/a1W8VuN+oelfRcVhxufBbd8ww9TSZe6IPIYqjH5Sk/MpeT8jSXIabtC1PrN3BtKAWz 26ug== X-Gm-Message-State: AGi0PualXIr2/IWbTeqnBIqR81xDlY0tnossqi46a3k6UuKHb48WTUdk 3daPZmFrsmFxWEToqUutfezgbMb/a+JvMZWw0+Zhhw== X-Google-Smtp-Source: APiQypKV4MJFEY2unnL+isb7+eZn11GBSMCvJaTeUi80F3Zjhw4Vx6wutL+i++hXJSlw91Lf6nCNVEZqc6dAGQUw9wU= X-Received: by 2002:a17:906:1199:: with SMTP id n25mr19960320eja.30.1589313035382; Tue, 12 May 2020 12:50:35 -0700 (PDT) In-Reply-To: <87mu6d0wh2.fsf@ddavis.io> Received-SPF: pass client-ip=2a00:1450:4864:20::643; envelope-from=garyo@oberbrunner.com; helo=mail-ej1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:250035 Archived-At: 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 wrote: > > Gary Oberbrunner 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