all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric James Michael Ritz <Eric@cybersprocket.com>
To: emacs-devel@gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, Miles Bader <miles@gnu.org>
Subject: Re: [vc-git] Showing ‘.git/*’ files in vc-dir
Date: Thu, 01 Jul 2010 09:40:01 -0400	[thread overview]
Message-ID: <4C2C9AB1.3080800@cybersprocket.com> (raw)
In-Reply-To: <yxqiq4zhfb7.fsf@fencepost.gnu.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 07/01/2010 02:44 AM, Dan Nicolaescu wrote:
> Miles Bader <miles@gnu.org> writes:
>
>> Dan Nicolaescu <dann@gnu.org> writes:
>>>>> Not sure what the best solution is: make vc-git-state return
>>>>> nil, or make vc-dir ignore files in .git, or something else ...
>>>>
>>>> Maybe find-file shouldn't add unregistered files to vc-dir buffers.
>>>
>>> Sure it should, one wants to be able to register those files.
>>
>> One can visit the file and "register" it that way, right (C-x v v)?
>
> This is going on the wrong track.
>
> The problem is not unrelated to adding 'unregistered files.
>
> The issue is that vc-git-state says 'unregistered for files that it
> should not say 'unregistered.
>
> (vc-git-state "SOME_FILE_THAT_DOES_NOT_EXIST") says 'unregistered
>
> (vc-git-state ".git/HEAD") says 'unregistered
>
>
> This patch seems to fix it:
>
> === modified file 'lisp/vc/vc-git.el'
> --- lisp/vc/vc-git.el   2010-06-11 19:09:57 +0000
> +++ lisp/vc/vc-git.el   2010-07-01 06:37:30 +0000
> @@ -180,7 +180,9 @@ If nil, use the value of `vc-diff-switch
>    ;; was modified upstream.  But we can't check that without a network
>    ;; operation.
>    (if (not (vc-git-registered file))
> -      'unregistered
> +      (let ((st (vc-git--run-command-string
> +            file "ls-files" "-t" "-o" "--")))
> +            (if (and (stringp st) (not (string= st ""))) 'unregistered nil))
>      (vc-git--call nil "add" "--refresh" "--" (file-relative-name file))
>      (let ((diff (vc-git--run-command-string
>                   file "diff-index" "-z" "HEAD" "--")))
>
>
> It would be nice if someone more familiar with the git low level
> commands would take a look at this function and try to make it a bit better.
> As the comment there says, it should be able to return 'ignored.
> It would be nice if it could be able to return 'conflict too.

In the `-t` needed in the call to git-ls-files?  It we are just
interested in whether or not the file is there, the `-o` by itself
will work fine.

We should also be able to use `git ls-files --ignored
- --exclude-standard -- $file` to see if we need to return 'ignored for
a file.

- --
Eric James Michael Ritz
Cyber Sprocket Labs
(843) 225-3830
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMLJquAAoJEEHUZXw5hMWsBzcH/R5m5qNqcWTJQubmt/x4OC3N
2EBtIkaDSPEPehDD4tLfA/Ppbd0gNyGDQqyk4TSUOGIQR67HIrQf7MVl4x9Sf5md
4YFjt9xM9xPSW48NWNn2A9xlcejCFwAL7fcq5T3sA2oLmofeYMu36mriAniGHTbq
DQ0xxsdr0FHjKltgah2bwvMUqIXUQfBnYBg9WlzYOsWnzUzTWFi4LaYgtWKzyaRz
YifXT8RS4SiRuEWXM16KF/qDuQQ/l3+uL1safnRjKr378Pp3k+t8k0CeX5+EGfvX
cmbNIuJ5Vyo0+r8UJM0SFg+qmBZf7YSzwiQuNi/D3n1G05dIvM/RvrJFm7MRFr4=
=/09u
-----END PGP SIGNATURE-----




  reply	other threads:[~2010-07-01 13:40 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 18:29 [vc-git] Showing ‘.git/*’ files in vc-dir Eric James Michael Ritz
2010-06-29 19:54 ` Dan Nicolaescu
2010-06-29 20:07   ` Eric James Michael Ritz
2010-06-29 20:54     ` Dan Nicolaescu
2010-06-29 21:16       ` Eric James Michael Ritz
2010-07-01  1:27       ` Stefan Monnier
2010-07-01  3:06         ` Dan Nicolaescu
2010-07-01  5:47           ` Miles Bader
2010-07-01  6:44             ` Dan Nicolaescu
2010-07-01 13:40               ` Eric James Michael Ritz [this message]
2010-07-04 17:26               ` Eric James Michael Ritz
2010-07-04 19:30                 ` Dan Nicolaescu
2010-07-04 19:45                   ` Eric James Michael Ritz
2010-07-04 17:27               ` Stefan Monnier
2010-07-04 19:26                 ` Dan Nicolaescu
2010-07-01  7:36           ` Jan Djärv
2010-07-01  8:32             ` Dan Nicolaescu
2010-07-01  8:39               ` Glenn Morris
2010-07-01  9:29                 ` Jan Djärv
2010-07-01 15:34                 ` Dan Nicolaescu
2010-07-01  9:23               ` Jan Djärv
2010-07-01 15:26                 ` Dan Nicolaescu
2010-07-01 16:25                   ` Jan Djärv
2010-07-23 15:30                     ` Stefan Monnier
2010-07-01  8:35             ` Glenn Morris
2010-07-01  9:16               ` Miles Bader
2010-07-01  9:22                 ` Deniz Dogan
2010-07-01 15:23                 ` Dan Nicolaescu
2010-07-01 21:14                 ` Glenn Morris
2010-07-01 22:24                   ` René Kyllingstad
2010-07-02  3:14                     ` Miles Bader

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=4C2C9AB1.3080800@cybersprocket.com \
    --to=eric@cybersprocket.com \
    --cc=emacs-devel@gnu.org \
    --cc=miles@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.