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

Re: [PATCH 1/3] fetch-pack: move code to report unmatched refs to a function

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 22, 2017, 17:11 UTC
Message-ID
<xmqqpoiacfqw.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<b9b52233e84a7f5bd0526f9625e4be06cbbd0ace.1487779910.git.matt@mattmccutchen.net>
Matt McCutchen <matt@mattmccutchen.net> writes:
> We're preparing to reuse this code in transport.c for "git fetch".
>
> While I'm here, internationalize the existing error message.
> ---
Sounds good.  Please just say it is OK for me to forge your sign-off ;-)
Show 15 quoted lines
> diff --git a/fetch-pack.h b/fetch-pack.h
> index c912e3d..fd4d80e 100644
> --- a/fetch-pack.h
> +++ b/fetch-pack.h
> @@ -45,4 +45,13 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
>  		       struct sha1_array *shallow,
>  		       char **pack_lockfile);
>  
> +/*
> + * Print an appropriate error message for each sought ref that wasn't
> + * matched.  Return 0 if all sought refs were matched, otherwise 1.
> + *
> + * The type of "sought" should be "const struct ref *const *" but for
> + * http://stackoverflow.com/questions/5055655/double-pointer-const-correctness-warnings-in-c .
> + */

This is an unfinished sentence, but I wonder if we even need to have it here? I'd be surprised if this function was unique in the codebase that takes an array pointer whose type is looser than necessary because of well-known language rules.

Previous: Matt McCutchenNext: Matt McCutchen
Message 12 of 17 in “fetch: print an error when declining to request an unadvertised object”
  1. fetch: print an error when declining to request an unadvertised objectMatt McCutchen, Feb 10, 2017
  2. Junio C HamanoFeb 10, 2017
  3. Matt McCutchenFeb 12, 2017
  4. Junio C HamanoFeb 12, 2017
  5. Matt McCutchenFeb 19, 2017
  6. fetch: print an error when declining to request an unadvertised objectMatt McCutchen, Feb 19, 2017
  7. Junio C HamanoFeb 21, 2017
  8. Matt McCutchenFeb 22, 2017
  9. Junio C HamanoFeb 22, 2017
  10. 2/3 fetch_refs_via_pack: call report_unmatched_refsMatt McCutchen, Feb 22, 2017
  11. 1/3 fetch-pack: move code to report unmatched refs to a functionMatt McCutchen, Feb 22, 2017
  12. Junio C HamanoFeb 22, 2017
  13. 1/3 fetch-pack: move code to report unmatched refs to a functionMatt McCutchen, Feb 22, 2017
  14. 3/3 fetch-pack: add specific error for fetching an unadvertised objectMatt McCutchen, Feb 22, 2017
  15. 2/3 fetch_refs_via_pack: call report_unmatched_refsMatt McCutchen, Feb 22, 2017
  16. Matt McCutchenFeb 22, 2017
  17. 3/3 fetch-pack: add specific error for fetching an unadvertised objectMatt McCutchen, Feb 22, 2017

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.