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

Re: [PATCH] fetch-pack: fix unadvertised requests validation

From
Jeff King <peff@peff.net>
Date
Feb 27, 2016, 22:08 UTC
Message-ID
<20160227220816.GA17475@sigill.intra.peff.net>
In-Reply-To
<CABaesJ+yNJ6_z=sFc+bDEPqDDsw9fkB5bYgxJaAkAMVqHNWwrQ@mail.gmail.com>
On Sat, Feb 27, 2016 at 05:28:55PM -0300, Gabriel Souza Franco wrote:
Show 22 quoted lines
> On Sat, Feb 27, 2016 at 4:19 PM, Jeff King <peff@peff.net> wrote:
> > On Sat, Feb 27, 2016 at 02:07:12PM -0500, Jeff King wrote:
> >
> >> We expect whoever creates the "sought" list to fill in the name and sha1
> >> as appropriate. If that is not happening in some code path, then yeah,
> >> filter_refs() will not work as intended. But I think the solution there
> >> would be to fix the caller to set up the "struct ref" more completely.
> >>
> >> Gabriel, did this come from a bug you noticed in practice, or was it
> >> just an intended cleanup?
> 
> I was experimenting with uploadpack.hiderefs and uploadpack.allowTipSHA1InWant
> and couldn't get
> 
>         git fetch-pack $remote <sha1>
> 
> to work, and I traced the failure until that check. Reading more, I now see
> that currently it requires
> 
>        git fetch-pack $remote "<sha1> <sha1>"
> 
> to do what I want.

Ah, that makes sense. I do think the "<sha1> <sha1>" syntax is a bit weird, and I think mostly because the pure-object fetch came much later in git's life; at this point hardly anybody uses a manual fetch-pack.

It would probably make sense to "<sha1>" to set up the ref correctly.
Show 7 quoted lines
> > I double-checked that the code for git-fetch does so. It's in
> > get_fetch_map()
> [...]
> 
> git fetch-pack doesn't use these code paths. I'll send a new patch
> shortly to allow
> bare sha1's in fetch-pack.
Right. Sounds like a good plan.
-Peff
Previous: Jeff KingNext: Junio C Hamano
Message 27 of 28 in “fetch-pack: fix unadvertised requests validation”
  1. fetch-pack: fix unadvertised requests validationGabriel Souza Franco, Feb 27, 2016
  2. Junio C HamanoFeb 27, 2016
  3. Junio C HamanoFeb 27, 2016
  4. Junio C HamanoFeb 27, 2016
  5. Jeff KingFeb 27, 2016
  6. Jeff KingFeb 27, 2016
  7. Gabriel Souza FrancoFeb 27, 2016
  8. fetch-pack: fix object_id of exact sha1Gabriel Souza Franco, Feb 27, 2016
  9. Jeff KingFeb 27, 2016
  10. Gabriel Souza FrancoFeb 27, 2016
  11. Junio C HamanoFeb 28, 2016
  12. fetch-pack: fix object_id of exact sha1Gabriel Souza Franco, Feb 28, 2016
  13. Johannes SchindelinFeb 29, 2016
  14. Jeff KingFeb 29, 2016
  15. Gabriel Souza FrancoMar 1, 2016
  16. fetch-pack: fix object_id of exact sha1Gabriel Souza Franco, Mar 1, 2016
  17. Jeff KingMar 1, 2016
  18. Gabriel Souza FrancoMar 3, 2016
  19. Jeff KingMar 4, 2016
  20. fetch-pack: fix object_id of exact sha1Gabriel Souza Franco, Mar 5, 2016
  21. Jeff KingMar 5, 2016
  22. Junio C HamanoMar 5, 2016
  23. fetch-pack: update the documentation for "<refs>..." argumentsGabriel Souza Franco, Mar 5, 2016
  24. Junio C HamanoMar 5, 2016
  25. Jeff KingMar 1, 2016
  26. Jeff KingFeb 29, 2016
  27. Jeff KingFeb 27, 2016
  28. Junio C HamanoFeb 28, 2016

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.