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

[PATCH v2 0/3] Supporting partial clones in protocol v2

From
JTJonathan Tan <jonathantanmy@google.com>
Date
May 2, 2018, 00:31 UTC
Message-ID
<cover.1525220786.git.jonathantanmy@google.com>
In-Reply-To
<cover.1525213052.git.jonathantanmy@google.com>
Show 13 quoted lines
> This is a bit difficult to read and there is no reason why we would need
> to read the entire upload_pack_config to determine if we need to filter
> things (we will need to read the config if cmd "fetch" is requested
> though).  Instead it may be better to do the following:
> 
>   if (value) {
>     strbuf_addstr(value, "shallow");
>     if (repo_config_get(r, "uplaodpack.filter"))
>       strbuf_addstr(value, " filter");
>   }
> 
> This way its easier to read and you only are reading the required value
> from the config.

Thanks, Brandon. I went ahead and used repo_config_get_bool(), and indeed it works.

Removing the call to git_config() from there exposed another issue in that configs were not read if upload-pack was used with protocol v2, so I inserted a patch in the middle addressing that. While writing that patch, I noticed that uploadpack.packobjectshook couldn't take filenames with spaces, which I think is due to prepare_shell_cmd() in run-command.c not quoting properly. Adding single quotes around "%s" worked, but made other tests fail. Instead of continuing down that rabbit hole, I just made the uploadpack.packobjectshook not have any spaces, just like in t5544.

Jonathan Tan (3):
  upload-pack: fix error message typo
  upload-pack: read config when serving protocol v2
  {fetch,upload}-pack: support filter in protocol v2
 Documentation/technical/protocol-v2.txt |   9 ++
 fetch-pack.c                            |  23 ++++-
 t/t5701-git-serve.sh                    |  14 +++
 t/t5702-protocol-v2.sh                  | 112 ++++++++++++++++++++++++
 upload-pack.c                           |  19 +++-
 5 files changed, 171 insertions(+), 6 deletions(-)
-- 
2.17.0.441.gb46fe60e1d-goog
Previous: Brandon WilliamsNext: Jonathan Tan
Message 6 of 20 in “Supporting partial clones in protocol v2”
  1. 0/2 Supporting partial clones in protocol v2Jonathan Tan, May 1, 2018
  2. 1/2 upload-pack: fix error message typoJonathan Tan, May 1, 2018
  3. Jonathan TanMay 1, 2018
  4. 2/2 {fetch,upload}-pack: support filter in protocol v2Jonathan Tan, May 1, 2018
  5. Brandon WilliamsMay 1, 2018
  6. 0/3 Supporting partial clones in protocol v2Jonathan Tan, May 2, 2018
  7. 1/3 upload-pack: fix error message typoJonathan Tan, May 2, 2018
  8. Stefan BellerMay 3, 2018
  9. Jonathan TanMay 3, 2018
  10. Junio C HamanoMay 4, 2018
  11. Jonathan TanMay 4, 2018
  12. 2/3 upload-pack: read config when serving protocol v2Jonathan Tan, May 2, 2018
  13. Stefan BellerMay 3, 2018
  14. Jonathan TanMay 3, 2018
  15. 3/3 {fetch,upload}-pack: support filter in protocol v2Jonathan Tan, May 2, 2018
  16. Stefan BellerMay 3, 2018
  17. 0/3 Supporting partial clones in protocol v2Jonathan Tan, May 3, 2018
  18. 1/3 upload-pack: fix error message typoJonathan Tan, May 3, 2018
  19. 2/3 upload-pack: read config when serving protocol v2Jonathan Tan, May 3, 2018
  20. 3/3 {fetch,upload}-pack: support filter in protocol v2Jonathan Tan, May 3, 2018

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.