emacs-devel
[Top][All Lists]
Advanced

[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: Eric James Michael Ritz
Subject: Re: [PATCH] vc-git: Do not show `.git/*' files with vc-dir
Date: Wed, 30 Jun 2010 16:01:43 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4

On 06/30/2010 03:35 PM, Dan Nicolaescu wrote:
> Eric James Michael Ritz <address@hidden> writes:
>
>>[...]
>>
>> 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...

Ah, I didn’t know that about `file`.  Thanks.

While I am interested in solving this for Git specifically, since that
is all I use at work, is it possible that a more general solution
would be appropriate?  I am not very familiar with Bazaar or Mercurial
or such, but I assume they use directories like ‘.git’ and ‘.svn’ for
storing repository information.  If it is possible to also make those
files appear in vc-dir by using terminal commands where $EDITOR is set
to emacsclient, then could it be more beneficial to teach vc-dir as a
whole to ignore files from the important, ‘system-level’ directories
for the various version control back-ends?

--
Eric James Michael Ritz
Cyber Sprocket Labs
(843) 225-3830



reply via email to

[Prev in Thread] Current Thread [Next in Thread]