Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Trieu Huynh <vikingtc4@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [GSoC PATCH v2] backfill: error out when HEAD cannot be parsed
Date: Thu, 02 Apr 2026 12:56:08 -0700	[thread overview]
Message-ID: <xmqqcy0hp25j.fsf@gitster.g> (raw)
In-Reply-To: <20260402191359.11304-1-viking4@gmail.com> (Trieu Huynh's message of "Fri, 3 Apr 2026 02:13:58 +0700")

Trieu Huynh <vikingtc4@gmail.com> writes:

> From: Trieu Huynh <vikingtc4@gmail.com>
>
> handle_revision_arg() returns non-zero on failure, but do_backfill()
> ignores the return value. On an empty repo with no commits, HEAD is
> unborn and handle_revision_arg() fails, but backfill silently
> continues with an empty revision walk and exists with a zero return
> code.

"exists" -> "exits", I think.

But more importantly (with Devil's advocate hat on), what's the
downside of the current behaviour?

You tell the command to backfill, the machinery does not find
anything necessary to fetch to backfill, and successfully, quickly,
and quietly exits.  That sounds like a graceful exit to me.

Is there anything wrong with that?

> +test_expect_success 'backfill on empty repo fails gracefully' '
> +	git init empty-repo &&
> +	test_must_fail git -C empty-repo backfill 2>err &&
> +	test_grep "unable to parse HEAD" err
> +'

  reply	other threads:[~2026-04-02 19:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 19:13 [GSoC PATCH v2] backfill: error out when HEAD cannot be parsed Trieu Huynh
2026-04-02 19:56 ` Junio C Hamano [this message]
2026-04-02 20:09   ` Junio C Hamano
2026-04-03 17:24     ` Trieu Huynh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqcy0hp25j.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=vikingtc4@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox