From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#68579: [PATCH] Support a local repo as URL in treesit-language-source-alist Date: Fri, 19 Jan 2024 18:26:00 +0200 Message-ID: <83jzo5uw6f.fsf@gnu.org> References: <0ffc2f474cf84ed3c63aa82091c967807e5ca0e6.camel@yandex.ru> <83frytwwly.fsf@gnu.org> <7010aa960be524d13f4dd96a1c7ea9102b580adf.camel@yandex.ru> <83ededwno1.fsf@gnu.org> <79692782ee323c59388fac26d39dc70aeb525284.camel@yandex.ru> <83r0iduzvc.fsf@gnu.org> <4b9f254dcba00812e8f6002d82cd7ebb0a29c45e.camel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4796"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 68579@debbugs.gnu.org To: Konstantin Kharlamov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 19 17:27:20 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rQriC-0000zx-7G for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Jan 2024 17:27:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQrhu-0006IL-9z; Fri, 19 Jan 2024 11:27:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQrhs-0006IA-Pv for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2024 11:27:00 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQrhs-0007uM-HD for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2024 11:27:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rQrhu-00087x-Ie for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2024 11:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Jan 2024 16:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68579 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68579-submit@debbugs.gnu.org id=B68579.170568157531175 (code B ref 68579); Fri, 19 Jan 2024 16:27:02 +0000 Original-Received: (at 68579) by debbugs.gnu.org; 19 Jan 2024 16:26:15 +0000 Original-Received: from localhost ([127.0.0.1]:60023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQrh9-00086l-6Y for submit@debbugs.gnu.org; Fri, 19 Jan 2024 11:26:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQrh6-00086U-Pq for 68579@debbugs.gnu.org; Fri, 19 Jan 2024 11:26:13 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQrgy-0007oU-CN; Fri, 19 Jan 2024 11:26:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=DhTUyCLPmVK77yBPLmxKYDvLICyyph9KbamL/1P3yM0=; b=bhg+SMERrNFQcgFyDxh5 QUEHW4oONXUSDctv2W7r/fcuEMttfrXyl+vmgyYNbjhdNJybz+Q8SEkQeDl6+blmlOglDmZ+MXldO YZ0sPoj2OIKtGB5H/PVD8xXkLyM06LtYFpDCh67zeoOik3fBkzdTskqSd6u0wVbl3R/uyzjQEWuai NbUEbqvImKlR1UARZkvJwa/Kf6X9uZdz85VvTGyolqCiZ18oPwZyZAXnB6rg/S/ltIXuPl32jSIUA 6bNDR41rwxsjyioliLUVsmj7SX4HVB4TJUFXX99g/uvbGZd/H/dVl3ZH6z5SeF/km6AywC/x7pbq0 U8Cn3FLExvMlOw==; In-Reply-To: <4b9f254dcba00812e8f6002d82cd7ebb0a29c45e.camel@yandex.ru> (message from Konstantin Kharlamov on Fri, 19 Jan 2024 19:06:59 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278537 Archived-At: > From: Konstantin Kharlamov > Cc: casouri@gmail.com, 68579@debbugs.gnu.org > Date: Fri, 19 Jan 2024 19:06:59 +0300 > > On Fri, 2024-01-19 at 17:06 +0200, Eli Zaretskii wrote: > > > From: Konstantin Kharlamov > > > Cc: casouri@gmail.com, 68579@debbugs.gnu.org > > > Date: Fri, 19 Jan 2024 17:33:03 +0300 > > > > > > > > > > -      (when (file-exists-p workdir) > > > > > > > +      (when (and (not url-is-path) (file-exists-p > > > > > > > workdir)) > > > > > > >          (delete-directory workdir t))))) > > > > > > > > > > > > Why?  Does workdir have different semantics in these two use > > > > > > cases? > > > > > > Isn't it the directory where we cloned the repository? > > > > > > > > > > When an absolute path is passed as URL, that means the user > > > > > have > > > > > cloned > > > > > the repo, not us. > > > > > > > > But you still clone from it into workdir, no?  treesit--git- > > > > clone- > > > > repo > > > > invokes "git clone" in both cases, according to my reading of the > > > > patch. > > > > > > No, the `treesit--git-clone-repo` is located on the "else" branch > > > of > > > the `(if url-is-path`. That is, we do not call it when it's a local > > > path > > > > Then this assumes some kind of workflow, doesn't it?  The user must > > first clone the repository, either via treesit.el or manually, and > > then they can use this new feature, right?  So I guess we should > > document this workflow somewhere? > > Well, I can add some docs if you want, but the workflow per se seems > obvious to me: you have a function that accepts a local path to repo > and builds from it. What I had in mind is some short description in the doc string of the interactive command that invokes all this stuff.