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

Re: 'git status' is not read-only fs friendly

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Feb 10, 2007, 19:08 UTC
Message-ID
<e5bfff550702101108k5dabd8d5o2487cc87bb1eafc7@mail.gmail.com>
In-Reply-To
<Pine.LNX.4.64.0702101351430.1757@xanadu.home>
On 2/10/07, Nicolas Pitre <nico@cam.org> wrote:
Show 22 quoted lines
> On Sat, 10 Feb 2007, Junio C Hamano wrote:
>
> >  (0) Do nothing.
> >
> >  (1) We keep the current "git-status [-v] [-a] [[-i|-o] <paths...>]"
> >      command line and do the necessary index manipulation
> >      in-core without writing it out (see git-commit.sh for
> >      details of what it involves).
> >
> >  (2) We drop the support for any command line parameter from
> >      "git-status", apply my two patches for Marco to
> >      "git-runstatus", and rename "git-runstatus" to
> >      "git-status".
> >
> > If I have to pick between the two, I would probably pick (2).
> > While (1) would essentially mean doing "git-commit" entirely
> > in-core without writing the index out until we really make the
> > commit, which is a good thing in itself in the longer term, it
> > is out of the question this late in the game for 1.5.0.
>
> And don't get me wrong.  I think that for 1.5.0 you should really do (0).
>

I agree on doing (0) for 1.5.0 and the following Linus lines make me wonder if is better doing (0) also after 1.5.0

Show 11 quoted lines
> So the fact is, "git status" _needs_ to refresh the index. Because if it
> doesn't, you'll see every file that doesn't match the index as "dirty",
> and that is not just a "technical issue".
>
> And yes, doing an "internal" refresh, like Junio's patch does, hides the
> issue, but it hides it BY MAKING THE OPTIMIZATION POINTLESS!
>
> I suspect Marco is testing some reasonably small git archive. With
> something like git itself, with less than a thousand files (and most of
> them fairly small, so rehashing them all is quick), the optimization may
> _feel_ like just a small technical detail.

If current 'git runstatus' on a NTFS directory, Linux side, show as dirty _all_ the repo files, then in case of big repos, as Linus pointed out, a possible future 'git runstatus --refresh' will be terribly slow because must filter out as false positives _all_ the repo files. And worst, have to do it *any time* it is run.

So perhaps the two patches of Junio _seems_ to work to me just because repo is small, is qgit4 indeed, but on a Linux tree would be veeery slow, so slow that probably is better to avoid completely and report quickly to user an empty set, being a corner case user will understand ;-)

Marco

P.S: I know I'm looking for flames but, if git-status HAVE to write the index and if 'status', as Nicolas points out, is a word that suggest a read only function, why don't change the name of the command.....'git sync-index' as example.

Previous: Theodore TsoNext: Linus Torvalds
Message 45 of 52 in “'git status' is not read-only fs friendly”
  1. Marco CostalbaFeb 9, 2007
  2. Linus TorvaldsFeb 9, 2007
  3. Marco CostalbaFeb 9, 2007
  4. Junio C HamanoFeb 9, 2007
  5. Junio C HamanoFeb 9, 2007
  6. Morten WelinderFeb 9, 2007
  7. Theodore TsoFeb 9, 2007
  8. Marco CostalbaFeb 9, 2007
  9. Linus TorvaldsFeb 9, 2007
  10. Junio C HamanoFeb 10, 2007
  11. Junio C HamanoFeb 10, 2007
  12. 1/2 run_diff_{files,index}(): update calling convention.Junio C Hamano, Feb 10, 2007
  13. Marco CostalbaFeb 10, 2007
  14. Junio C HamanoFeb 10, 2007
  15. Marco CostalbaFeb 10, 2007
  16. Marco CostalbaFeb 10, 2007
  17. Junio C HamanoFeb 10, 2007
  18. Marco CostalbaFeb 10, 2007
  19. Junio C HamanoFeb 10, 2007
  20. Marco CostalbaFeb 10, 2007
  21. 2/2 git-runstatus --refreshJunio C Hamano, Feb 10, 2007
  22. Johannes SchindelinFeb 10, 2007
  23. Marco CostalbaFeb 10, 2007
  24. Johannes SchindelinFeb 10, 2007
  25. Marco CostalbaFeb 10, 2007
  26. Marco CostalbaFeb 10, 2007
  27. Junio C HamanoFeb 10, 2007
  28. Johannes SchindelinFeb 10, 2007
  29. Junio C HamanoFeb 11, 2007
  30. Johannes SchindelinFeb 11, 2007
  31. Johannes SchindelinFeb 11, 2007
  32. Junio C HamanoFeb 11, 2007
  33. Johannes SchindelinFeb 11, 2007
  34. Johannes SchindelinFeb 10, 2007
  35. Marco CostalbaFeb 10, 2007
  36. Nicolas PitreFeb 10, 2007
  37. Junio C HamanoFeb 10, 2007
  38. Nicolas PitreFeb 10, 2007
  39. Junio C HamanoFeb 10, 2007
  40. Nicolas PitreFeb 10, 2007
  41. Junio C HamanoFeb 10, 2007
  42. Theodore TsoFeb 10, 2007
  43. Nicolas PitreFeb 10, 2007
  44. Theodore TsoFeb 10, 2007
  45. Marco CostalbaFeb 10, 2007
  46. Linus TorvaldsFeb 10, 2007
  47. Nicolas PitreFeb 10, 2007
  48. Junio C HamanoFeb 11, 2007
  49. Shawn O. PearceFeb 11, 2007
  50. Johannes SchindelinFeb 10, 2007
  51. Junio C HamanoFeb 10, 2007
  52. Marco CostalbaFeb 10, 2007

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.