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

Re: [PATCH 4/4] fetch: implement fetch.fsck.*

From
Junio C Hamano <gitster@pobox.com>
Date
May 25, 2018, 04:09 UTC
Message-ID
<xmqqy3g8nzph.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180524193516.28713-5-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 8 quoted lines
>  fsck.skipList::
> -	Like `fsck.<msg-id>` this variable has a corresponding
> -	`receive.fsck.skipList` variant.
> +	Like `fsck.<msg-id>` this variable has corresponding
> +	`receive.fsck.skipList` and `fetch.fsck.skipList` variants.
>  +
>  The path to a sorted list of object names (i.e. one SHA-1 per line)
>  that are known to be broken in a non-fatal way and should be

I think I've said this already, but I tend to agree with Eric that this is the other way around. Perhaps that is because I consider fsck.<var> the most basic one people would want to understand first, and then corresponding <command>.fsck.<var> a mere specialization of it. So "Here is what fsck.skipList does" followed by "By the way, you can configure it only for the (internal) fsck run during the object transfer with transfer.fsck.skipList" feels more natural presentation order.

Show 27 quoted lines
> diff --git a/fetch-pack.c b/fetch-pack.c
> index 490c38f833..9e4282788e 100644
> --- a/fetch-pack.c
> +++ b/fetch-pack.c
> @@ -19,6 +19,7 @@
>  #include "sha1-array.h"
>  #include "oidset.h"
>  #include "packfile.h"
> +#include "fsck.h"
>  
>  static int transfer_unpack_limit = -1;
>  static int fetch_unpack_limit = -1;
> @@ -33,6 +34,7 @@ static int agent_supported;
>  static int server_supports_filtering;
>  static struct lock_file shallow_lock;
>  static const char *alternate_shallow_file;
> +static struct strbuf fsck_msg_types = STRBUF_INIT;
>  
>  /* Remember to update object flag allocation in object.h */
>  #define COMPLETE	(1U << 0)
> @@ -935,7 +937,8 @@ static int get_pack(struct fetch_pack_args *args,
>  			 */
>  			argv_array_push(&cmd.args, "--fsck-objects");
>  		else
> -			argv_array_push(&cmd.args, "--strict");
> +			argv_array_pushf(&cmd.args, "--strict%s",
> +					 fsck_msg_types.buf);
This made a reader wonder what fsck_msg_types.buf[] has.

It is empty or a comma separated list of things, prefixed with =, that is constructed by repeated calls to fetch_pack_config_cb(), so syntactically what we feed index-pack looks like "--strict", "--strict=thing", or "--strict=thing1,thing2,....,thingn". And each "thing" is either "<msgtype>=<value>" or "skiplist=<objectname>".

The buffer that has both msgtype specification and object name should not be called fsck_msg_types, though. It is probably fsck_exception or something.

Show 17 quoted lines
> +		strbuf_addf(&fsck_msg_types, "%cskiplist=%s",
> +			fsck_msg_types.len ? ',' : '=', path);
> +		free((char *)path);
> +		return 0;
> +	}
> +
> +	if (skip_prefix(var, "fetch.fsck.", &var)) {
> +		if (is_valid_msg_type(var, value))
> +			strbuf_addf(&fsck_msg_types, "%c%s=%s",
> +				fsck_msg_types.len ? ',' : '=', var, value);
> +		else
> +			warning("Skipping unknown msg id '%s'", var);
> +		return 0;
> +	}
> +
> +	return git_default_config(var, value, cb);
> +}
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 18 of 69 in “BUG: No way to set fsck.<msg-id> when cloning”
  1. Ævar Arnfjörð BjarmasonMay 24, 2018
  2. Kevin DaudtMay 24, 2018
  3. Ævar Arnfjörð BjarmasonMay 24, 2018
  4. Jeff KingMay 24, 2018
  5. 0/4 fsck: doc fixes & fetch.fsck.* implementationÆvar Arnfjörð Bjarmason, May 24, 2018
  6. 1/4 config doc: don't describe *.fetchObjects twiceÆvar Arnfjörð Bjarmason, May 24, 2018
  7. Junio C HamanoMay 25, 2018
  8. 3/4 config doc: elaborate on what transfer.fsckObjects doesÆvar Arnfjörð Bjarmason, May 24, 2018
  9. Eric SunshineMay 24, 2018
  10. Junio C HamanoMay 25, 2018
  11. Ævar Arnfjörð BjarmasonMay 31, 2018
  12. 2/4 config doc: unify the description of fsck.* and receive.fsck.*Ævar Arnfjörð Bjarmason, May 24, 2018
  13. Eric SunshineMay 24, 2018
  14. Ævar Arnfjörð BjarmasonMay 24, 2018
  15. Eric SunshineMay 24, 2018
  16. Junio C HamanoMay 25, 2018
  17. 4/4 fetch: implement fetch.fsck.*Ævar Arnfjörð Bjarmason, May 24, 2018
  18. Junio C HamanoMay 25, 2018
  19. 0/5 fsck: doc fixes & fetch.fsck.* implementationÆvar Arnfjörð Bjarmason, May 25, 2018
  20. 1/5 config doc: don't describe *.fetchObjects twiceÆvar Arnfjörð Bjarmason, May 25, 2018
  21. Eric SunshineMay 25, 2018
  22. 2/5 config doc: unify the description of fsck.* and receive.fsck.*Ævar Arnfjörð Bjarmason, May 25, 2018
  23. Eric SunshineMay 25, 2018
  24. Junio C HamanoMay 28, 2018
  25. Ævar Arnfjörð BjarmasonMay 28, 2018
  26. Junio C HamanoMay 30, 2018
  27. Junio C HamanoMay 30, 2018
  28. Ævar Arnfjörð BjarmasonMay 31, 2018
  29. Junio C HamanoJun 1, 2018
  30. 4/5 config doc: mention future aspirations for transfer.fsckObjectsÆvar Arnfjörð Bjarmason, May 25, 2018
  31. Christian CouderMay 25, 2018
  32. 5/5 fetch: implement fetch.fsck.*Ævar Arnfjörð Bjarmason, May 25, 2018
  33. Junio C HamanoMay 30, 2018
  34. Ævar Arnfjörð BjarmasonMay 31, 2018
  35. 3/5 config doc: elaborate on what transfer.fsckObjects doesÆvar Arnfjörð Bjarmason, May 25, 2018
  36. Eric SunshineMay 25, 2018
  37. 00/10 fsck: doc fixes & fetch.fsck.* implementationÆvar Arnfjörð Bjarmason, Jul 27, 2018
  38. SZEDER GáborJul 30, 2018
  39. 01/10 receive.fsck.<msg-id> tests: remove dead codeÆvar Arnfjörð Bjarmason, Jul 27, 2018
  40. Junio C HamanoJul 27, 2018
  41. Ævar Arnfjörð BjarmasonJul 27, 2018
  42. Junio C HamanoJul 27, 2018
  43. 02/10 config doc: don't describe *.fetchObjects twiceÆvar Arnfjörð Bjarmason, Jul 27, 2018
  44. Junio C HamanoJul 27, 2018
  45. 03/10 config doc: unify the description of fsck.* and receive.fsck.*Ævar Arnfjörð Bjarmason, Jul 27, 2018
  46. Junio C HamanoJul 27, 2018
  47. 04/10 config doc: elaborate on what transfer.fsckObjects doesÆvar Arnfjörð Bjarmason, Jul 27, 2018
  48. Junio C HamanoJul 27, 2018
  49. 05/10 config doc: elaborate on fetch.fsckObjects securityÆvar Arnfjörð Bjarmason, Jul 27, 2018
  50. Junio C HamanoJul 27, 2018
  51. Ævar Arnfjörð BjarmasonJul 28, 2018
  52. 06/10 transfer.fsckObjects tests: untangle confusing setupÆvar Arnfjörð Bjarmason, Jul 27, 2018
  53. 07/10 fetch: implement fetch.fsck.*Ævar Arnfjörð Bjarmason, Jul 27, 2018
  54. Junio C HamanoJul 27, 2018
  55. Junio C HamanoJul 27, 2018
  56. Duy NguyenJul 30, 2018
  57. Ævar Arnfjörð BjarmasonJul 30, 2018
  58. 08/10 fsck: test & document {fetch,receive}.fsck.* config fallbackÆvar Arnfjörð Bjarmason, Jul 27, 2018
  59. Junio C HamanoJul 27, 2018
  60. 09/10 fsck: add stress tests for fsck.skipListÆvar Arnfjörð Bjarmason, Jul 27, 2018
  61. 10/10 fsck: test and document unknown fsck.<msg-id> valuesÆvar Arnfjörð Bjarmason, Jul 27, 2018
  62. Ævar Arnfjörð BjarmasonJul 27, 2018
  63. Junio C HamanoJul 27, 2018
  64. Ævar Arnfjörð BjarmasonJul 28, 2018
  65. Junio C HamanoJul 30, 2018
  66. Junio C HamanoMay 28, 2018
  67. Jeff KingMay 24, 2018
  68. Thomas BraunMay 24, 2018
  69. Ævar Arnfjörð BjarmasonMay 25, 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.