git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Julliard <julliard@winehq.org>
To: "Duncan Mak" <duncan@a-chinaman.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] fix vc git
Date: Fri, 22 Dec 2006 14:56:15 +0100	[thread overview]
Message-ID: <87ac1guj9c.fsf@wine.dyndns.org> (raw)
In-Reply-To: <8e745ecf0612220451v367479dq13af2d829a9547c2@mail.gmail.com> (Duncan Mak's message of "Fri\, 22 Dec 2006 07\:51\:45 -0500")

"Duncan Mak" <duncan@a-chinaman.com> writes:

> Yeah, but the issue is that, as you know, to create a new file in
> emacs, you give find-file  a non-existent file and emacs will open up
> a buffer for you and let you save it when you're done.

OK, but in that case vc-git-registered needs to return failure, you
cannot call git-ls-files as it may find the file in the wrong
directory. I'd suggest something like this:


>From abf4311add221102957145255d5418a7ec06fe1d Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Fri, 22 Dec 2006 14:51:23 +0100
Subject: [PATCH] vc-git: Ignore errors caused by a non-existent directory in vc-git-registered.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 contrib/emacs/vc-git.el |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/emacs/vc-git.el b/contrib/emacs/vc-git.el
index 8b63619..3eb4bd1 100644
--- a/contrib/emacs/vc-git.el
+++ b/contrib/emacs/vc-git.el
@@ -58,8 +58,9 @@
   (with-temp-buffer
     (let* ((dir (file-name-directory file))
            (name (file-relative-name file dir)))
-      (when dir (cd dir))
-      (and (ignore-errors (eq 0 (call-process "git" nil '(t nil) nil "ls-files" "-c" "-z" "--" name)))
+      (and (ignore-errors
+             (when dir (cd dir))
+             (eq 0 (call-process "git" nil '(t nil) nil "ls-files" "-c" "-z" "--" name)))
            (let ((str (buffer-string)))
              (and (> (length str) (length name))
                   (string= (substring str 0 (1+ (length name))) (concat name "\0"))))))))
-- 
1.4.4.2.g28ce

-- 
Alexandre Julliard
julliard@winehq.org

  reply	other threads:[~2006-12-22 13:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21 11:25 [PATCH] fix vc git Duncan Mak
2006-12-21 11:32 ` Jakub Narebski
2006-12-21 11:59   ` Duncan Mak
2006-12-22  0:52     ` Junio C Hamano
2006-12-22  4:11       ` Duncan Mak
2006-12-22  4:54         ` Junio C Hamano
2006-12-22 12:39         ` Alexandre Julliard
2006-12-22 12:51           ` Duncan Mak
2006-12-22 13:56             ` Alexandre Julliard [this message]
2006-12-22 15:17               ` Duncan Mak

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=87ac1guj9c.fsf@wine.dyndns.org \
    --to=julliard@winehq.org \
    --cc=duncan@a-chinaman.com \
    --cc=git@vger.kernel.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.
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 NNTP newsgroup(s).