]> git.eshelyaron.com Git - emacs.git/commit
Support a local repo as URL in 'treesit-language-source-alist'
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Fri, 19 Jan 2024 07:33:47 +0000 (10:33 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 31 Jan 2024 20:09:33 +0000 (21:09 +0100)
commitbafbaa4012bb5365ebca44970eba106346e791ab
tree5e661327ee31f07b94f624ea7234afc89d925e4b
parentc81e97dd0453e621c16488bc1739bbea6b09878d
Support a local repo as URL in 'treesit-language-source-alist'

Sometimes people may need to bisect to find specific revision
in a grammar library's repo.  In this case they'd want to point
the URL to the local repo to avoid cloning it on every rebuild.
So add support for a directory instead of URL in
'treesit-language-source-alist'.
* lisp/treesit.el (treesit--install-language-grammar-1): Test
if URL is a local directory.  Then if it is, avoid cloning the
repo and removing the path on success.
(treesit--git-clone-repo): Factor out the code for cloning to
a separate function.
(treesit--git-checkout-branch): A helper to checkout the
revision for cases where we didn't clone the repo but want it
to point the revision.  (Bug#68579)

(cherry picked from commit 54c6588952b469df8d7983b6735461f542cd806e)
etc/NEWS
lisp/treesit.el