]> git.eshelyaron.com Git - emacs.git/commitdiff
Create a blobless clone in treesit-admin--verify-major-mode-queries
authorYuan Fu <casouri@gmail.com>
Tue, 24 Dec 2024 01:12:39 +0000 (17:12 -0800)
committerEshel Yaron <me@eshelyaron.com>
Fri, 27 Dec 2024 15:29:38 +0000 (16:29 +0100)
* admin/treesit-admin.el (treesit-admin--verify-major-mode-queries):
Create a blobless clone.
* lisp/treesit.el (treesit--install-language-grammar-blobless):
New variable.
(treesit--git-clone-repo): Support blobless clone.

(cherry picked from commit 93755ea1a6113e115ac3349b67e58e2f3fd03894)

admin/treesit-admin.el
lisp/treesit.el

index 3c0798a29f2b1b3b64a8df3e8f44147b78698659..440056aff212bf29486060d21ca9d8c702bf61cd 100644 (file)
@@ -96,6 +96,7 @@ queries that has problems with latest grammar."
   (let ((treesit-extra-load-path (list grammar-dir))
         (treesit-language-source-alist treesit-admin--builtin-language-sources)
         (treesit--install-language-grammar-full-clone t)
+        (treesit--install-language-grammar-blobless t)
         (version-alist nil)
         (invalid-feature-list nil)
         (valid-modes nil)
index 1b49c3cb8bfc5df36621b92daa3f9e3bbdd62228..0a4de2d2364511d96bd9cc012bbb1443c0a253a5 100644 (file)
@@ -3917,6 +3917,9 @@ See `treesit-language-source-alist' for details."
 (defvar treesit--install-language-grammar-full-clone nil
   "If non-nil, do a full clone when cloning git repos.")
 
+(defvar treesit--install-language-grammar-blobless nil
+  "If non-nil, create a blobless clone when cloning git repos.")
+
 ;;;###autoload
 (defun treesit-install-language-grammar (lang &optional out-dir)
   "Build and install the tree-sitter language grammar library for LANG.
@@ -4039,6 +4042,8 @@ Use shallow clone by default.  Do a full clone when
   (let ((args (list "git" nil t nil "clone" url "--quiet")))
     (when (not treesit--install-language-grammar-full-clone)
       (setq args (append args (list "--depth" "1"))))
+    (when treesit--install-language-grammar-blobless
+      (setq args (append args (list "--filter=blob:none"))))
     (when revision
       (setq args (append args (list "-b" revision))))
     (setq args (append args (list workdir)))