From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric James Michael Ritz Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] vc-git: Do not show `.git/*' files with vc-dir Date: Wed, 30 Jun 2010 16:01:43 -0400 Organization: Cyber Sprocket Labs Message-ID: <4C2BA2A7.3040401@cybersprocket.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1277931457 20040 80.91.229.12 (30 Jun 2010 20:57:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 Jun 2010 20:57:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 30 22:57:35 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OU4La-00063C-UD for ged-emacs-devel@m.gmane.org; Wed, 30 Jun 2010 22:57:31 +0200 Original-Received: from localhost ([127.0.0.1]:54626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OU4La-0005XQ-Fn for ged-emacs-devel@m.gmane.org; Wed, 30 Jun 2010 16:57:30 -0400 Original-Received: from [140.186.70.92] (port=55787 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OU3Tg-0005sn-6q for emacs-devel@gnu.org; Wed, 30 Jun 2010 16:01:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OU3Tf-0002wq-1E for emacs-devel@gnu.org; Wed, 30 Jun 2010 16:01:47 -0400 Original-Received: from host.cybersprocket.com ([72.52.158.193]:44133) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OU3Td-0002w9-2u; Wed, 30 Jun 2010 16:01:45 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=cybersprocket.com; h=Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:X-Enigmail-Version:Content-Type:Content-Transfer-Encoding; b=ZsHVwyJzpCRuOPUhvC48qbt+wwY5HW20SNfmOVrfWn1+im2K57b2PwQJH9rJgF7SY+LygNsxLBgit5Gq6WWkGmjPt3iy9pCtjYKJe4Y2/37ZjrIDM/felhz0tO+L3y3i; Original-Received: from 173.221.45.130.nw.nuvox.net ([173.221.45.130] helo=[10.1.10.120]) by host.cybersprocket.com with esmtp (Exim 4.69) (envelope-from ) id 1OU3TR-0000k1-1V; Wed, 30 Jun 2010 16:01:33 -0400 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 In-Reply-To: X-Enigmail-Version: 1.0.1 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.cybersprocket.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - cybersprocket.com X-detected-operating-system: by eggs.gnu.org: Linux 2.6? (barebone, rare!) X-Mailman-Approved-At: Wed, 30 Jun 2010 16:55:46 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:126553 Archived-At: On 06/30/2010 03:35 PM, Dan Nicolaescu wrote: > Eric James Michael Ritz 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