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

Re: Git error message "Server does not allow request for unadvertised object"

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
May 25, 2020, 12:27 UTC
Message-ID
<3EE73235-F418-465D-9313-912F7B5AC8F9@gmail.com>
In-Reply-To
<op.0ks2w7r1pvqxoc@rowan.vivaldi>
Hello Yngve,
Show 21 quoted lines
> Le 18 mai 2020 à 05:20, Yngve N. Pettersen <yngve@vivaldi.com> a écrit :
> 
> Hello all,
> 
> A while back I reported an issue to the Windows Git project <https://github.com/git-for-windows/git/issues/2218> that I observed in Git for Windows 2.21.
> 
> The error message "Server does not allow request for unadvertised object" is reported when a commit updating a submodule pointer points to a commit that does not exist in the repository for that submodule, even if later commits in the branch points to a commit that do exist in the submodule repo.
> 
> This circumstance can easily occur if a developer (e.g)
> 
> * interactively rebases a branch "foo" in the submodule (e.g to integrate commits from another branch before a larger rebase)
> * commits the resulting submodule pointer "A" in the branch to the parent repo
> * then do further rebasing in the submodule, e.g to move up on top of the "bar" branch
> * commits that pointer "B" to the parent repo
> * forgets to squash the history in the parent repo
> * pushes the updated submodule "foo" branch to the online repo. (NOTE: "B" is pushed, not "A")
> * pushes the parent module branch to its online repo
> 
> When the parent repo is pulled by another developer, or an autobuild system, the fetch operation fails with the message "Server does not allow request for unadvertised object". A second fetch will complete successfully.
> 
> IMO this kind of check should only happen if a commit with pointer to a missing submodule is actively checked out. At most the above message should be a warning, not a fatal error.
I think that's a good idea. 
Another thing that I find confusing with this message is that it can be taken to mean that the server does not support fetching "unadvertised objects", i.e. `uploadpack.allow{Tip,Reachable,Any}SHA1InWant` is false, when in fact the object is simply inexistent...
Philippe.
Previous: Yngve N. PettersenNext: Yngve N. Pettersen
Message 2 of 4 in “Git error message "Server does not allow request for unadvertised object"”
  1. Yngve N. PettersenMay 18, 2020
  2. Philippe BlainMay 25, 2020
  3. Yngve N. PettersenSep 6, 2020
  4. Yngve N. PettersenSep 1, 2021

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.