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

Re: [PATCH] better git-submodule status output

From
Avery Pennarun <apenwarr@gmail.com>
Date
Jul 7, 2008, 14:25 UTC
Message-ID
<32541b130807070725p6fa4d0dfne9f04bc857920dc7@mail.gmail.com>
In-Reply-To
<20080707062142.GA5506@jhaampe.org>
On 7/7/08, Sylvain Joyeux <sylvain.joyeux@dfki.de> wrote:
Show 6 quoted lines
> Yes, it fetches objects (admittedly, it updates something on the current
>  partition), but AFAIK does not change the state of the repository. So I thought
>  that it could be considered as a no-op from the repo point of view. The idea
>  behind the 'fetch' thing was to get the latest objects from the repository,
>  therefore being able to know the relationship between the currently committed
>  submodule state

I haven't looked at your patch, so I don't know if you're calling fetch in such a way that it doesn't update any refs. Anyway, fetching is definitely not a no-op as far as the user is concerned. For example, if I'm on my laptop outside my company's LAN and I try to fetch, it might take 30+ seconds for fetch to time out waiting for our server. So it's not okay to fetch unless I specifically ask for a fetch.

The trick here, I think, is that there's only one time the submodule should be linked to a commit you don't actually have. It should only happen if your parent module (supermodule) has been updated, but you haven't recently done a fetch in the submodule. Thus, I'd say the best fix would be to find a way to have "git pull" or "git fetch" in the supermodule also do a fetch in the submodule. I think it's fair to expect "fetchy" operations like fetch and pull to perhaps do some extra fetches, but not fair to expect "status" to do extra work like that.

Also note that "your supermodule links to a commit that you haven't fetched yet" is a perfectly okay state to report to the user. I might use a "?" or something to indicate that.

Have fun,
Avery
Previous: Sylvain JoyeuxNext: Johannes Schindelin
Message 7 of 34 in “better git-submodule status output”
  1. better git-submodule status outputSylvain Joyeux, Jul 1, 2008
  2. Junio C HamanoJul 6, 2008
  3. Johannes SchindelinJul 6, 2008
  4. Sylvain JoyeuxJul 6, 2008
  5. Johannes SchindelinJul 6, 2008
  6. Sylvain JoyeuxJul 7, 2008
  7. Avery PennarunJul 7, 2008
  8. Johannes SchindelinJul 7, 2008
  9. Johannes SchindelinJul 7, 2008
  10. Sylvain JoyeuxJul 7, 2008
  11. Johannes SchindelinJul 7, 2008
  12. Sylvain JoyeuxJul 7, 2008
  13. Junio C HamanoJul 7, 2008
  14. Avery PennarunJul 7, 2008
  15. Junio C HamanoJul 7, 2008
  16. Sylvain JoyeuxJul 8, 2008
  17. Johannes SchindelinJul 8, 2008
  18. Sylvain JoyeuxJul 8, 2008
  19. Johannes SchindelinJul 8, 2008
  20. Sylvain JoyeuxJul 8, 2008
  21. Avery PennarunJul 7, 2008
  22. Johannes SchindelinJul 7, 2008
  23. Avery PennarunJul 7, 2008
  24. Johannes SchindelinJul 7, 2008
  25. Sylvain JoyeuxJul 7, 2008
  26. Sylvain JoyeuxJul 7, 2008
  27. Mark LevedahlJul 6, 2008
  28. Sylvain JoyeuxJul 9, 2008
  29. Andreas EricssonJul 9, 2008
  30. Sylvain JoyeuxJul 9, 2008
  31. Johannes SchindelinJul 9, 2008
  32. Sylvain JoyeuxJul 9, 2008
  33. Johannes SchindelinJul 9, 2008
  34. Junio C HamanoJul 9, 2008

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.