branch: externals/vc-jj
commit 18deb90fc583ca5d36cee3d03f22914a513436c6
Author: Kristoffer Balintona <[email protected]>
Commit: Kristoffer Balintona <[email protected]>

    fix: Finding .git repo when inside .jj repo
    
    When a .git repo is located in a subdirectory
    within a .jj repo, previously project.el would
    detect the current repo to be the further .jj
    one instead of the closer .git one.
    
    This commit fixes that bug while also simplifying
    how vc-jj tells project.el whether we are within
    a .jj repo.
---
 NEWS.org      | 1 +
 project-jj.el | 9 +--------
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 36f0326f30..ef9360907a 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -17,6 +17,7 @@
 *** Fixed
 
 - Fixed =vc-jj-diff= not transforming filenames into jj fileset syntax. This 
means commands like =vc-diff= and =log-view-diff= do not fail.
+- Fixed a bug related to vc-jj's integration with project.el in cases where a 
.git repo is within a subdirectory of a .jj repo.  Previously, when inside the 
.git repo, project.el would erroneously detect the .jj repo to be current one 
(instead of the .git repo, which is closer).  Now, project.el correctly detects 
the closer .git repo.
 
 ** [[https://codeberg.org/emacs-jj-vc/vc-jj.el/compare/v0.3...v0.4][0.4]] - 
2025-09-03
 
diff --git a/project-jj.el b/project-jj.el
index 5480c10bf0..d9514798e1 100644
--- a/project-jj.el
+++ b/project-jj.el
@@ -44,16 +44,9 @@
         (mapcar #'expand-file-name files)
       files)))
 
-;;;###autoload
-(defun project-try-jj (dir)
-  "Return the jujutsu project containing DIR or nil."
-  (when-let* ((root (locate-dominating-file dir ".jj")))
-    (cons 'jj root)))
-
 ;;;###autoload
 (with-eval-after-load 'project
-  (add-hook 'project-find-functions #'project-try-jj))
-
+  (add-to-list 'project-vc-backend-markers-alist '(JJ . ".jj")))
 
 (provide 'project-jj)
 ;;; project-jj.el ends here

Reply via email to