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

Re: Regression introduced in 03267e86

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 17, 2023, 16:54 UTC
Message-ID
<xmqqttxemotc.fsf@gitster.g>
In-Reply-To
<bt4342bdip3nzlikjsv6wozszmcbsc2av6cyo3z2lra4jhx3ii@ut2sl5h4f5xn>
Lars Kellogg-Stedman <lars@oddbit.com> writes:
Show 14 quoted lines
> [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.
Previous: Lars Kellogg-Stedman
Message 3 of 3 in “Regression introduced in 03267e8656truct object_id oid;”
  1. Lars Kellogg-StedmanApr 16, 2023
  2. Lars Kellogg-StedmanApr 16, 2023
  3. Junio C HamanoApr 17, 2023

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.