From: ludo@gnu.org (Ludovic Courtès)
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 13866@debbugs.gnu.org
Subject: bug#13866: [VC] ‘vc-git-root’ is too lax
Date: Mon, 04 Mar 2013 17:00:14 +0100 [thread overview]
Message-ID: <87y5e3duk1.fsf@gnu.org> (raw)
In-Reply-To: <jwvk3pncj38.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 04 Mar 2013 09:58:33 -0500")
Stefan Monnier <monnier@iro.umontreal.ca> skribis:
>> A better definition would be something like this:
>> (defun vc-git-root (file)
>> (lexical-let ((root (vc-find-root file ".git")))
>> (and (file-in-directory-p root "objects")
>> root)))
>
> Beside the fact that ~/.git is not the config directory, the above code
> has some problems:
>
> vc-git.el uses lexical-binding, so using lexical-let in it is a bad idea.
> file-in-directory-p sounds completely wrong here. You want to use
> (file-directory-p (expand-file-name "objects" root)) instead.
>
> And of course you could have used simply (vc-find-root file ".git/objects").
Indeed, point taken!
Ludo’.
prev parent reply other threads:[~2013-03-04 16:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-04 9:50 bug#13866: [VC] ‘vc-git-root’ is too lax Ludovic Courtès
2013-03-04 10:56 ` Andreas Schwab
2013-03-04 13:16 ` Ludovic Courtès
2013-03-04 14:58 ` Stefan Monnier
2013-03-04 15:11 ` Christopher Schmidt
2013-03-04 16:00 ` Ludovic Courtès [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y5e3duk1.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=13866@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.