From: Junio C Hamano <gitster@pobox•com>
To: avarab@gmail•com, Lars Kellogg-Stedman <lars@oddbit•com>
Cc: git@vger•kernel.org
Subject: Re: Regression introduced in 03267e86
Date: Mon, 17 Apr 2023 09:54:55 -0700 [thread overview]
Message-ID: <xmqqttxemotc.fsf@gitster.g> (raw)
In-Reply-To: <bt4342bdip3nzlikjsv6wozszmcbsc2av6cyo3z2lra4jhx3ii@ut2sl5h4f5xn> (Lars Kellogg-Stedman's message of "Sun, 16 Apr 2023 13:20:20 -0400")
Lars Kellogg-Stedman <lars@oddbit•com> writes:
> [This behavior was originally reported in
> https://stackoverflow.com/q/76022720/147356.]
>
> Prior to commit 03267e8656, the following sequence would result in an
> empty commit:
>
> git init testrepo
> date > testrepo/testfile
> git -C testrepo add testfile
> git -C testrepo commit -m test --allow-empty --only
>
> After commit 03267e8656, the same sequence creates a commit that
> contains "testfile". I believe the original behavior was correct,
> based on the documentation for the `--only` option:
It looks like a convoluted way (aka use of an obscure option) to
create something useless (aka an empty root commit), but it should
be allowed and the last step should do what you expected.
> And while that passes all the tests, I'm not sure if its correct; the
> change in 03267e8656 was correcting a memory leak and I'm not sure I
> completely understand the details.
Yeah, figuring out how 03267e86 (commit: discard partial cache
before (re-)reading it, 2022-11-08) broke the behaviour is a good
first step.
Thanks for reporting.
prev parent reply other threads:[~2023-04-17 16:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-16 17:20 Regression introduced in 03267e8656truct object_id oid; Lars Kellogg-Stedman
2023-04-16 17:30 ` Regression introduced in 03267e8656 Lars Kellogg-Stedman
2023-04-17 16:54 ` Junio C Hamano [this message]
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=xmqqttxemotc.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=avarab@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=lars@oddbit$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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