Re: [PATCH v3 4/7] fetch: add --refetch option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 4, 2022, 21:19 UTC
- Message-ID
- <xmqqa6e51kms.fsf@gitster.g>
- In-Reply-To
- <a503b98f33328133f9a89ad7eba986b73535c461.1646406275.git.gitgitgadget@gmail.com>
"Robert Coup via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 11 quoted lines
> +static int verbosity, deepen_relative, set_upstream, refetch;
> static int progress = -1;
> static int enable_auto_gc = 1;
> static int tags = TAGS_DEFAULT, unshallow, update_shallow, deepen;
> @@ -190,6 +190,9 @@ static struct option builtin_fetch_options[] = {
> OPT_SET_INT_F(0, "unshallow", &unshallow,
> N_("convert to a complete repository"),
> 1, PARSE_OPT_NONEG),
> + OPT_SET_INT_F(0, "refetch", &refetch,
> + N_("re-fetch without negotiating common commits"),
> + 1, PARSE_OPT_NONEG),I guess the existing --unshallow has the same problem, but it strikes me odd that these aren't doing a bog-standard OPT_BOOL(), with default value of "false", like, say "--update-head-ok" does.
That will naturally support things like
git fetch --refetch --no-refetch
where a later option overrides what an earlier option did.