unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Justin Bogner <mail@justinbogner.com>
To: emacs-devel@gnu.org
Subject: Re: [patch] vc-find-root with invert
Date: Mon, 21 Jul 2008 15:33:54 -0600	[thread overview]
Message-ID: <488500C2.8060001@justinbogner.com> (raw)
In-Reply-To: <jwvk5ff84yi.fsf-monnier+emacs@gnu.org>

Stefan Monnier wrote:
>>> Reading the docstring, my guess would be: vc-find-root walks the dir
>>> tree up _until_ it finds WITNESS (as an evidence for the VC tree's root
>>> dir). Unless we have CVS or SVN or similar, where every subdir has
>>> WITNESS, so the root would be the last up-tree directory having WITNESS.
>
> That still doesn't tell me what it does.  I mean I can read the code and
> understand what is the effect of calling the code like this, but I have
> no idea what effect it has for the user.  AFAICT it's a misfeature.
>
>> This is exactly correct, though in the current trunk there is a bug
>> such that the function does not behave like this. The patch causes it
>> to work as documented.
>
> I think we should remove this misfeature rather than fix it.
>
>
>         Stefan
>

There are two types of version control directory, ones with a "root"
directory in each directory under version control, and on with a
"root" directory in the root of the version control. Since this
function's purpose is to find the actual root of the tree, the latter
case is simple, where it needs only find the "root" directory.

However, for the other case, we need traverse upwards until we don't
find the directory, returning the last one that does. As it stands, if
we don't find the directory we look, we return wherever we started
searching, which is incorrect.

As far as getting rid of invert, we could do that, and the function
would then return something more reasonable than it does now, but it
wouldn't actually find the root unless you happened to try the root
first. Even so, this would make it work slightly better in some cases
(at least it would be `nil' when it should be). It would also consider
subdirectories that weren't in CVS to be part of CVS, which is probably
wrong, but possibly not common (I don't know about this).

I'm not convinced that `invert' is a misfeature, as it is certainly a
good intention. However, if you are convinced that it's not useful,
then I can come up with a patch that removes it, since I would prefer
not having it to having a broken version as it is now.




  reply	other threads:[~2008-07-21 21:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-04 17:24 [patch] vc-find-root with invert Justin Bogner
2008-07-04 18:02 ` Stefan Monnier
2008-07-04 18:06   ` Justin Bogner
2008-07-04 19:52     ` Stefan Monnier
2008-07-05  7:21       ` tomas
2008-07-21 16:27         ` Justin Bogner
2008-07-21 18:32           ` Stefan Monnier
2008-07-21 21:33             ` Justin Bogner [this message]
2008-07-21 22:00               ` David Kastrup
2008-07-21 22:23                 ` Justin Bogner
2008-07-21 23:02                   ` David Kastrup
2008-07-23  4:35                     ` Justin Bogner
2008-07-23 19:35                       ` Stefan Monnier
2008-07-22  2:56               ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2008-07-04 17:47 Justin Bogner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=488500C2.8060001@justinbogner.com \
    --to=mail@justinbogner.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).