All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Raymond <esr@thyrsus.com>
To: Jacob Helwig <jacob.helwig@gmail.com>
Cc: Eric Raymond <esr@snark.thyrsus.com>, git@vger.kernel.org
Subject: Status of all files (was: Re: How can I tell if a file is ignored by git?
Date: Fri, 9 Apr 2010 07:32:48 -0400	[thread overview]
Message-ID: <20100409113248.GB27353@thyrsus.com> (raw)
In-Reply-To: <j2z8c9a061004082110se894f925i80c1389cd4e247f@mail.gmail.com>

Jacob Helwig <jacob.helwig@gmail.com>:
> On Thu, Apr 8, 2010 at 21:04, Eric Raymond <esr@snark.thyrsus.com> wrote:
> > I'm planning some work on Emacs VC mode.
> >
> > I need a command I can run on a path to tell if it's ignored by git.
> 
> What about a variant of:
>     git ls-files -i -o --exclude-standard

That will do nicely, thank you.

There could be something better.  Emacs VC mode, and other similar
front ends, would be greatly aided by a command that lists all files,
each with a status code it can understand.  Our canonical list
(omitting two that apply only to locking systems) is:

  'up-to-date        The working file is unmodified with respect to the
                     latest version on the current branch, and not locked.

  'edited            The working file has been edited by the user.

  'needs-update      The file has not been edited by the user, but there is
                     a more recent version on the current branch stored
                     in the master file.

  'needs-merge       The file has been edited by the user, and there is also
                     a more recent version on the current branch stored in
                     the master file.  This state can only occur if locking
                     is not used for the file.

  'added             Scheduled to go into the repository on the next commit.

  'removed           Scheduled to be deleted from the repository on next commit.

  'conflict          The file contains conflicts as the result of a merge.

  'missing           The file is not present in the file system, but the VC
                     system still tracks it.

  'ignored           The file showed up in a dir-status listing with a flag
                     indicating the version-control system is ignoring it,

  'unregistered      The file is not under version control.

The -t mode of ls-files appears to be almost what is wanted, but not quite.
(Among other things, it does not list ignored files.)  I request comment
on some related questions:

1. How do these statuses map to git terminology?  My tentative map, in terms 
of git file-list -t codes, is

up-to-date   = H?
edited       = C
needs-update = no equivalent
needs-merge  = no equivalent
added        = no equivalent
removed      = K
conflict     = no equivalent
missing      = R
ignored      = no equivalent
unregistered = no equivalent

I am unclear on what your "unmerged" (M) status means.

2. I've played with various option combinations, but I can't seem to find one
that lists these codes for all files.  Is there one?

3. Is the use case for -t such that it would make sense to modify it so
it does a complete listing?

4. If the answer to question 3 is 'yes', is there some Emacs user here
who already knows git internals and would be willing to do this in
order to help VC be faster and more effective?  I would handle the VC
end, of course.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

  reply	other threads:[~2010-04-09 11:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09  4:04 How can I tell if a file is ignored by git? Eric Raymond
2010-04-09  4:10 ` Jacob Helwig
2010-04-09 11:32   ` Eric Raymond [this message]
2010-04-09 12:11     ` Status of all files (was: " Randal L. Schwartz
2010-04-09 13:20       ` Eric Raymond
2010-04-10 19:07       ` Junio C Hamano
2010-04-09 12:56     ` Jakub Narebski
2010-04-09 14:02       ` Eric Raymond
2010-04-09 14:23         ` Matthieu Moy
2010-04-09 16:24           ` Eric Raymond
     [not found]             ` <z2h62a3a9cb1004091615q52bd5f5aqc24079de7f0038ba@mail.gmail.com>
2010-04-09 23:18               ` Daniel Grace
2010-04-10  3:35               ` Eric Raymond
2010-04-09 16:52           ` Junio C Hamano
2010-04-09 14:50         ` Jakub Narebski
2010-04-10 22:12         ` Status of all files Paolo Bonzini
2010-04-11 10:25           ` Jeff King
2010-04-09  4:50 ` How can I tell if a file is ignored by git? Ramkumar Ramachandra
2010-04-09  5:01   ` Ævar Arnfjörð Bjarmason
2010-04-09 10:50     ` Eric Raymond

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=20100409113248.GB27353@thyrsus.com \
    --to=esr@thyrsus.com \
    --cc=esr@snark.thyrsus.com \
    --cc=git@vger.kernel.org \
    --cc=jacob.helwig@gmail.com \
    /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 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.