[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] vc-git: Do not show `.git/*' files with vc-dir
From: |
Dan Nicolaescu |
Subject: |
Re: [PATCH] vc-git: Do not show `.git/*' files with vc-dir |
Date: |
Wed, 30 Jun 2010 21:20:48 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Deniz Dogan <address@hidden> writes:
> 2010/6/30 Dan Nicolaescu <address@hidden>:
>> Eric James Michael Ritz <address@hidden> writes:
>>
>>> On 06/30/2010 08:58 AM, Deniz Dogan wrote:
>>>> 2010/6/30 Deniz Dogan <address@hidden>:
>>>>> 2010/6/30 Eric James Michael Ritz <address@hidden>:
>>>>>> + (cond ((string-match ".git" file)
>>>>>
>>>>> Wouldn't "\\`\\.git\\'" be more appropriate? ".git" would match
>>>>> anything which contains "git" preceded by at least one character.
>>>>>
>>>>
>>>> Or actually, (string= ".git" file), I suppose. :)
>>>
>>> Whoops, you’re right. Thanks for the catch :) Fixed patch below:
>>>
>>> diff --git a/lisp/vc-git.el b/lisp/vc-git.el
>>> index 24062a0..62e0c55 100644
>>> --- a/lisp/vc-git.el
>>> +++ b/lisp/vc-git.el
>>> @@ -171,16 +171,21 @@ If nil, use the value of `vc-diff-switches'. If t,
>>> use no switches."
>>>
>>> (defun vc-git-state (file)
>>> "Git-specific version of `vc-state'."
>>> - ;; FIXME: This can't set 'ignored yet
>>> - (if (not (vc-git-registered file))
>>> - 'unregistered
>>> - (vc-git--call nil "add" "--refresh" "--" (file-relative-name file))
>>> - (let ((diff (vc-git--run-command-string
>>> - file "diff-index" "-z" "HEAD" "--")))
>>> - (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\}
>>> [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0"
>>> - diff))
>>> - (vc-git--state-code (match-string 1 diff))
>>> - (if (vc-git--empty-db-p) 'added 'up-to-date)))))
>>> + ;; We never want to perform VC operations on files in the `.git'
>>> + ;; directory.
>>> + (cond ((string= ".git" file)
>>
>> file is an absolute file name, so this condition cannot be true.
>>
>> I still need to think what the best way of solving this is...
>>
>>
>
> So it is not as simple as wrapping "file" in file-name-nondirectory?
That would never match either.