unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#61577: 30.0.50; project-try-vc missing vc-got
@ 2023-02-17 16:56 Omar Polo
  2023-02-17 17:34 ` Omar Polo
  2023-02-17 23:11 ` Dmitry Gutov
  0 siblings, 2 replies; 6+ messages in thread
From: Omar Polo @ 2023-02-17 16:56 UTC (permalink / raw)
  To: 61577

Hello,

project-try-vc (IIRC) used to loop over all the vc-backends to find the
root of a project.  Now, it’s just an hardcoded list in a local
variable.  This breaks the project-* functions on Got checkouts.

I can imagine the reason of the change (avoid loading all the vc-*.el
files I guess) but it would be nice for this variable to be at least
user-configurable, otherwise we will always end up with missing entries.

(Yeah, one could add their own hooks in project-find-functions for
that, but seems replicating stuff that project.el tries to do anyway.)

Attaching a diff that temporarly works around the problem by adding the
Got -> .got mapping.


Thanks,

Omar Polo

diff /home/op/build/emacs
commit - dabd7feb950ef2dba0ce23ec74c5b141cff96a55
path + /home/op/build/emacs
blob - 2343adf4698471cf5262ce7a4340a4b0c5b5fa7e
file + lisp/progmodes/project.el
--- lisp/progmodes/project.el
+++ lisp/progmodes/project.el
@@ -506,7 +506,8 @@ project backend implementation of `project-external-ro
                                       (Bzr . ".bzr")
                                       (SVN . ,vc-svn-admin-directory)
                                       (DARCS . "_darcs")
-                                      (Fossil . ".fslckout")))
+                                      (Fossil . ".fslckout")
+                                      (Got . ".got")))
              (backend-markers
               (delete
                nil



In GNU Emacs 30.0.50 (build 1, x86_64-unknown-openbsd7.2, X toolkit,
 cairo version 1.17.8, Xaw scroll bars) of 2023-02-16 built on venera
Windowing system distributor 'The X.Org Foundation', version 11.0.12101006
System Description: OpenBSD venera 7.2 GENERIC.MP#1052 amd64

Configured using:
 'configure --prefix /home/op/opt/emacs --with-x-toolkit=lucid'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2
LIBOTF LIBXML2 M17N_FLT MODULES NOTIFY KQUEUE PDUMPER PNG RSVG THREADS
TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM LUCID ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Eshell

Minor modes in effect:
  shell-dirtrack-mode: t
  eshell-prompt-mode: t
  eshell-pred-mode: t
  eshell-hist-mode: t
  eshell-cmpl-mode: t
  eshell-proc-mode: t
  eshell-arg-mode: t
  server-mode: t
  shackle-mode: t
  global-form-feed-mode: t
  electric-pair-mode: t
  savehist-mode: t
  save-place-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-quote-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  abbrev-mode: t

Load-path shadows:
~/build/emacs-libpq/pq hides /home/op/.emacs.d/elpa/pq-0.1/pq
/home/op/.emacs.d/elpa/eglot-20221020.1010/eglot hides /home/op/opt/emacs/share/emacs/30.0.50/lisp/progmodes/eglot

Features:
(shadow sort mail-extr emacsbug bug-reference noutline outline
reposition em-unix yaml-mode debug backtrace pcmpl-unix pcmpl-gnu
warnings em-term term disp-table shell ehelp em-script em-prompt em-pred
em-ls em-hist em-glob em-extpipe em-cmpl em-dirs em-basic em-banner
em-alias esh-mode esh-var pcomplete eshell esh-cmd generator esh-ext
esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util cus-edit
cus-start cus-load wid-edit diff-mode ispell term/xterm xterm files-x
find-dired vc-got log-view compile vc-dir ewoc log-edit message sendmail
yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log vc-annotate vc vc-dispatcher
mule-util display-line-numbers icons xref vc-svn cl-print ielm pp comint
ansi-osc ansi-color ring dired-aux dired-x dired dired-loaddefs puni
pulse color imenu misearch multi-isearch jka-compr find-func shortdoc
text-property-search cl-extra rx orderless project help-fns radix-tree
server shackle trace checkdoc lisp-mnt thingatpt help-mode form-feed
elec-pair savehist saveplace whitespace orderless-autoloads
fennel-mode-autoloads geiser-guile-autoloads geiser-autoloads finder-inf
gemini-mode-autoloads go-mode-autoloads haskell-mode-autoloads
lua-mode-autoloads markdown-mode-autoloads puni-autoloads easy-mmode
info sly-autoloads eglot-autoloads pq-autoloads web-mode-autoloads
yaml-mode-autoloads cider-autoloads sesman-autoloads spinner-autoloads
queue-autoloads parseedn-autoloads parseclj-autoloads
clojure-mode-autoloads vc-got-autoloads vc-fossil-autoloads package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache
json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs
cl-lib minimal-theme rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
faces cus-face macroexp files window text-properties overlay sha1 md5
base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind kqueue lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 386600 40031)
 (symbols 48 21832 1)
 (strings 32 116838 2419)
 (string-bytes 1 3104440)
 (vectors 16 41495)
 (vector-slots 8 615081 20384)
 (floats 8 287 891)
 (intervals 56 5909 2186)
 (buffers 976 34))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#61577: 30.0.50; project-try-vc missing vc-got
  2023-02-17 16:56 bug#61577: 30.0.50; project-try-vc missing vc-got Omar Polo
@ 2023-02-17 17:34 ` Omar Polo
  2023-02-17 23:27   ` Dmitry Gutov
  2023-02-17 23:11 ` Dmitry Gutov
  1 sibling, 1 reply; 6+ messages in thread
From: Omar Polo @ 2023-02-17 17:34 UTC (permalink / raw)
  To: 61577

actually, isn't at least CVS missing too?

diff /home/op/build/emacs
commit - dabd7feb950ef2dba0ce23ec74c5b141cff96a55
path + /home/op/build/emacs
blob - 2343adf4698471cf5262ce7a4340a4b0c5b5fa7e
file + lisp/progmodes/project.el
--- lisp/progmodes/project.el
+++ lisp/progmodes/project.el
@@ -501,12 +501,14 @@ project backend implementation of `project-external-ro
   ;; `project-vc-merge-submodules' or `project-vc-extra-root-markers'
   ;; changes.
   (or (vc-file-getprop dir 'project-vc)
-      (let* ((backend-markers-alist `((Git . ".git")
+      (let* ((backend-markers-alist `((CVS . "CVS")
+                                      (Git . ".git")
                                       (Hg . ".hg")
                                       (Bzr . ".bzr")
                                       (SVN . ,vc-svn-admin-directory)
                                       (DARCS . "_darcs")
-                                      (Fossil . ".fslckout")))
+                                      (Fossil . ".fslckout")
+                                      (Got . ".got")))
              (backend-markers
               (delete
                nil





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#61577: 30.0.50; project-try-vc missing vc-got
  2023-02-17 16:56 bug#61577: 30.0.50; project-try-vc missing vc-got Omar Polo
  2023-02-17 17:34 ` Omar Polo
@ 2023-02-17 23:11 ` Dmitry Gutov
  2023-02-18 10:48   ` Omar Polo
  1 sibling, 1 reply; 6+ messages in thread
From: Dmitry Gutov @ 2023-02-17 23:11 UTC (permalink / raw)
  To: Omar Polo, 61577-done

Version: 29.1

Hi!

On 17/02/2023 18:56, Omar Polo wrote:

> project-try-vc (IIRC) used to loop over all the vc-backends to find the
> root of a project.  Now, it’s just an hardcoded list in a local
> variable.  This breaks the project-* functions on Got checkouts.
> 
> I can imagine the reason of the change (avoid loading all the vc-*.el
> files I guess) but it would be nice for this variable to be at least
> user-configurable, otherwise we will always end up with missing entries.

The reasons were actually related to performance during the search.

> (Yeah, one could add their own hooks in project-find-functions for
> that, but seems replicating stuff that project.el tries to do anyway.)
> 
> Attaching a diff that temporarly works around the problem by adding the
> Got -> .got mapping.

Thanks for the report, I've pushed your addition and also moved the list 
to a defvar. Not defcustom, though, to avoid encouraging people from 
changing it unnecessarily (instead of project-vc-extra-root-markers).

Originally, I figured all major backends should be covered, but it won't 
hurt to add one more, especially since vc-got is in ELPA.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#61577: 30.0.50; project-try-vc missing vc-got
  2023-02-17 17:34 ` Omar Polo
@ 2023-02-17 23:27   ` Dmitry Gutov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Gutov @ 2023-02-17 23:27 UTC (permalink / raw)
  To: Omar Polo, 61577

On 17/02/2023 19:34, Omar Polo wrote:
> actually, isn't at least CVS missing too?

CVS, RCS, SCCS and SRC never were supported before because they don't 
define the method vc-*-root.

The reason for that is they're not tree-based: every subdirectory of a 
CVS project contains a CVS subdir.

Now that we stopped delegating the root-finding logic to VC, we could 
probably do something about CVS as well, but just your change won't cut 
it, I think, because with it the search will always return the current 
directory, rather than the actual root.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#61577: 30.0.50; project-try-vc missing vc-got
  2023-02-17 23:11 ` Dmitry Gutov
@ 2023-02-18 10:48   ` Omar Polo
  2023-02-18 13:17     ` Dmitry Gutov
  0 siblings, 1 reply; 6+ messages in thread
From: Omar Polo @ 2023-02-18 10:48 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 61577-done

On 2023/02/18 01:11:10 +0200, Dmitry Gutov <dgutov@yandex.ru> wrote:
> Version: 29.1
> 
> Hi!
> 
> On 17/02/2023 18:56, Omar Polo wrote:
> 
> > project-try-vc (IIRC) used to loop over all the vc-backends to find the
> > root of a project.  Now, it’s just an hardcoded list in a local
> > variable.  This breaks the project-* functions on Got checkouts.
> > 
> > I can imagine the reason of the change (avoid loading all the vc-*.el
> > files I guess) but it would be nice for this variable to be at least
> > user-configurable, otherwise we will always end up with missing entries.
> 
> The reasons were actually related to performance during the search.

I thought so, thanks for confirming :)

> > (Yeah, one could add their own hooks in project-find-functions for
> > that, but seems replicating stuff that project.el tries to do anyway.)
> > 
> > Attaching a diff that temporarly works around the problem by adding the
> > Got -> .got mapping.
> 
> Thanks for the report, I've pushed your addition and also moved the list 
> to a defvar. Not defcustom, though, to avoid encouraging people from 
> changing it unnecessarily (instead of project-vc-extra-root-markers).
> 
> Originally, I figured all major backends should be covered, but it won't 
> hurt to add one more, especially since vc-got is in ELPA.

I guess that now the (require 'vc-svn) could go away too.

Thanks!

P.S.: thanks also for the explanation about CVS/RCS/SCCS/SRC.  To be
fair I never used the project-* functions in a CVS checkout before
yesterday, and it makes sense not to include them by default.  Well,
maaaybe a vc-cvs-root that walks up until the root of the checkout
could be provided, but I'm not too knowledgable about CVS and my usage
of it is scarce enough that I didn't feel the reason to have it.
Hardly used anything other than C-x v = in CVS checkouts.

diff /home/op/build/emacs
commit - 0be5f7ab6368175953c0a5bcbbd485fd9edda2b0
path + /home/op/build/emacs
blob - 1228c73fee86bbae3727fddd8a9687496849b040
file + lisp/progmodes/project.el
--- lisp/progmodes/project.el
+++ lisp/progmodes/project.el
@@ -512,8 +512,6 @@ See `project-vc-extra-root-markers' for the marker val
 See `project-vc-extra-root-markers' for the marker value format.")
 
 (defun project-try-vc (dir)
-  (defvar vc-svn-admin-directory)
-  (require 'vc-svn)
   ;; FIXME: Learn to invalidate when the value of
   ;; `project-vc-merge-submodules' or `project-vc-extra-root-markers'
   ;; changes.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#61577: 30.0.50; project-try-vc missing vc-got
  2023-02-18 10:48   ` Omar Polo
@ 2023-02-18 13:17     ` Dmitry Gutov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Gutov @ 2023-02-18 13:17 UTC (permalink / raw)
  To: Omar Polo; +Cc: 61577-done

On 18/02/2023 12:48, Omar Polo wrote:

>> Originally, I figured all major backends should be covered, but it won't
>> hurt to add one more, especially since vc-got is in ELPA.
> 
> I guess that now the (require 'vc-svn) could go away too.

Ah yeah, thanks for the suggestion.

> Thanks!
> 
> P.S.: thanks also for the explanation about CVS/RCS/SCCS/SRC.  To be
> fair I never used the project-* functions in a CVS checkout before
> yesterday, and it makes sense not to include them by default.  Well,
> maaaybe a vc-cvs-root that walks up until the root of the checkout
> could be provided, but I'm not too knowledgable about CVS and my usage
> of it is scarce enough that I didn't feel the reason to have it.
> Hardly used anything other than C-x v = in CVS checkouts.

Given that CVS is both unable to provide a faster file listing, and 
(IIUC) its file ignore settings are spread between the directories, a 
user might as well add a new element to project-find-functions, to get 
the basic features. And closer integration will require more work.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-18 13:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17 16:56 bug#61577: 30.0.50; project-try-vc missing vc-got Omar Polo
2023-02-17 17:34 ` Omar Polo
2023-02-17 23:27   ` Dmitry Gutov
2023-02-17 23:11 ` Dmitry Gutov
2023-02-18 10:48   ` Omar Polo
2023-02-18 13:17     ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).