Re: [PATCH 3/5] backfill: accept revision arguments
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 17, 2026, 22:01 UTC
- Message-ID
- <xmqqy0jqi08s.fsf@gitster.g>
- In-Reply-To
- <dc6652c84c8d37b124eb76c2a9cdfdc4db4a149d.1773707361.git.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
> - repo_init_revisions(ctx->repo, &revs, "");
> - handle_revision_arg("HEAD", &revs, 0, 0);So we used to "cheat" and did an initialization without even knowing in which directory we were started ...
> + /* Walk from HEAD if otherwise unspecified. */
> + if (!ctx->revs.pending.nr)
> + handle_revision_arg("HEAD", &ctx->revs, 0, 0);... but by initializing the revs correctly in the caller, we would be correcting it. Looking good.
Show 11 quoted lines
> @@ -134,7 +135,12 @@ int cmd_backfill(int argc, const char **argv, const char *prefix, struct reposit > builtin_backfill_usage, options); > > argc = parse_options(argc, argv, prefix, options, builtin_backfill_usage, > - 0); > + PARSE_OPT_KEEP_UNKNOWN_OPT | > + PARSE_OPT_KEEP_ARGV0 | > + PARSE_OPT_KEEP_DASHDASH); > + > + repo_init_revisions(repo, &ctx.revs, prefix); > + argc = setup_revisions(argc, argv, &ctx.revs, NULL);
OK.