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

Re: [PATCH] submodule update - don't run git-fetch if sha1 available

From
TSTorgil Svensson <torgil.svensson@gmail.com>
Date
Aug 12, 2007, 00:03 UTC
Message-ID
<e7bda7770708111703u40f89c1fx17bfac4b9aed9d2e@mail.gmail.com>
In-Reply-To
<7vfy2pn9eb.fsf@assigned-by-dhcp.cox.net>
On 8/11/07, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> This is wrong.  Existence of the commit object alone does not
> mean the necessary tree and blob objects to check out that
> commit, let alone all the history that leads to the commit,
> exist in the repository (think of a commit walker fetch that was
> interrupted in the middle).  You need to make sure that the
> commit exists *AND* is reachable from one of the refs.
That made sense. Good point. Consider this case:

$ git clone <superproject> $ git submodule init $ git submodule update $ cd <submodule> $ git checkout master $ cd .. $ git status Modified <submodule> $ git submodule update

Do we know in this state that the ref can be reached from a reference? Say you've managed to do this:

$ cd <submodule> $ git checkout master $ work.. commit .. work ..commit $ cd .. $ git add <submodule> $ git commit $ cd <submodule> $ git reset --hard HEAD~2

Is it okay to fail the supermodule update in this state? Obviously we've thrown away things for a purpose.

//Torgil
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “submodule update - don't run git-fetch if sha1 available”
  1. submodule update - don't run git-fetch if sha1 availableTorgil Svensson, Aug 11, 2007
  2. Torgil SvenssonAug 11, 2007
  3. Junio C HamanoAug 11, 2007
  4. Torgil SvenssonAug 12, 2007
  5. Junio C HamanoAug 12, 2007
  6. Torgil SvenssonAug 19, 2007
  7. Junio C HamanoAug 19, 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.