git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Status of all files (was: Re: How can I tell if a file is ignored by git?

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 10, 2010, 19:07 UTC
Message-ID
<7vsk73w2ho.fsf@alter.siamese.dyndns.org>
In-Reply-To
<864ojkx1un.fsf@red.stonehenge.com>
merlyn@stonehenge.com (Randal L. Schwartz) writes:
> A lot of these don't make sense for git and other DVCS.
I agree with you in principle, but not with the details in the example.
Show 8 quoted lines
> For example:
>
> Eric>   'needs-update      The file has not been edited by the user, but there is
> Eric>                      a more recent version on the current branch stored
> Eric>                      in the master file.
>
> This makes sense only with a file-based VCS, not a tree-based VCS like
> git.

This isn't about file vs tree, but more about centralized vs distributed. In DVCS workflows "needs-update" as a concept does not even exist when you are working on a topic branch to perfect one thing and one thing only. You do not want to update only because somebody else did some work that may be totally unrelated to what you wanted to achieve on the current branch.

I presume that many people use git in centralized workflow where they use only 'master' branch and "git pull ; work ; git commit; git push" are the only things they do. In that setting, "needs-update" may make sense. The VC backend implementation has to do "git fetch" to see if the origin has advanced.

Almost the same comment applies to 'needs-merge', but the VC backend not only needs to worry about "file has been edited", but also "commits that touch the file has been made locally".

> Eric>   'removed           Scheduled to be deleted from the repository
> Eric>   on next commit.
>
> Not useful in git.
Isn't "git rm removed" exactly "scheduled to be deleted"?
> Eric>   'missing           The file is not present in the file system, but the VC
> Eric>                      system still tracks it.
>
> Not available in git.  (If it's not a real file, it can't be tracked. :)
Isn't "rm missing" exactly this?
Show 6 quoted lines
> Eric>   'ignored           The file showed up in a dir-status listing with a flag
> Eric>                      indicating the version-control system is ignoring it,
>
> Eric>   'unregistered      The file is not under version control.
>
> These two would be identical in git.

Ignored is a subset of Unregistered, no? Neither exists in the index (i.e. not tracked); ignored ones are covered by .gitignore and you need to force "git add" to start tracking them.

Previous: Eric RaymondNext: Jakub Narebski
Message 6 of 19 in “How can I tell if a file is ignored by git?”
  1. Eric RaymondApr 9, 2010
  2. Jacob HelwigApr 9, 2010
  3. Status of all files (was: Re: How can I tell if a file is ignored by git?Eric Raymond, Apr 9, 2010
  4. Randal L. SchwartzApr 9, 2010
  5. Eric RaymondApr 9, 2010
  6. Junio C HamanoApr 10, 2010
  7. Jakub NarebskiApr 9, 2010
  8. Eric RaymondApr 9, 2010
  9. Matthieu MoyApr 9, 2010
  10. Eric RaymondApr 9, 2010
  11. Junio C HamanoApr 9, 2010
  12. Jakub NarebskiApr 9, 2010
  13. Paolo BonziniApr 10, 2010
  14. Jeff KingApr 11, 2010
  15. Ramkumar RamachandraApr 9, 2010
  16. Ævar Arnfjörð BjarmasonApr 9, 2010
  17. Eric RaymondApr 9, 2010
  18. Daniel GraceApr 9, 2010
  19. Eric RaymondApr 10, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.