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

Re: Potential bug in `git checkout --quiet`

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 5, 2023, 22:36 UTC
Message-ID
<xmqqh6o8qmce.fsf@gitster.g>
In-Reply-To
<ZPXdeRnLu6oKoVt2@debian.me>
Bagas Sanjaya <bagasdotme@gmail.com> writes:
Show 36 quoted lines
> On Mon, Sep 04, 2023 at 02:56:37PM +0200, Radovan Haluška wrote:
>> What did you do before the bug happened? (Steps to reproduce your issue)
>> 
>> ```
>> git clone --quiet --branch master --depth 1 --no-checkout --filter blob:none \
>>     git@github.com:acatai/Strategy-Card-Game-AI-Competition.git locm-agents
>> cd locm-agents
>> git sparse-checkout set --no-cone
>> git sparse-checkout add 'contest-2022-08-COG/ByteRL'
>> git checkout --quiet
>> ```
>> 
>> What did you expect to happen? (Expected behavior)
>> 
>> I expected to receive no output from any of the commands above.
>> 
>> What happened instead? (Actual behavior)
>> 
>> I received an output from the last command even though the `--quiet` switch was specified
>> 
>> What's different between what you expected and what actually happened?
>> 
>> This shouldn't have been printed on the screen:
>> 
>> '''
>> remote: Enumerating objects: 28, done.
>> remote: Counting objects: 100% (28/28), done.
>> remote: Compressing objects: 100% (27/27), done.
>> remote: Total 28 (delta 0), reused 25 (delta 0), pack-reused 0
>> Receiving objects: 100% (28/28), 31.40 MiB | 4.94 MiB/s, done.
>> '''
>> 
>
> I can reproduce this bug on v2.40.0 using your reproducer above. Yet,
> `git checkout --quiet` on normal repos (not partial ones) works as
> expected. Cc'ing people working on sparse-checkout recently.

I am not much involved in the lazy clone's on-demand downloading, but I am torn between calling this a bug and a feature.

Just like the original reporter "expected to receive no output", for a pure Git person like me, I expect to see *no* network activity while performing a local operation like "checkout". And from that point of view, "checkout --quiet" telling me that something unexpected and unusual (i.e. the operation "checkout" that is supposed to be local is lazily downloading blobs and trees from the outside world) is happening with the extra output is something I may even appreciate.

Having said that, I would not fundamentally oppose if those who want to improve the lazy clone feature wants to squelch messages from the transport layer while the top-level front end ("checkout" in this case) wants to operate quietly.

Thanks for a report.
Previous: Bagas Sanjaya
Message 3 of 3 in “Potential bug in `git checkout --quiet`”
  1. Radovan HaluškaSep 4, 2023
  2. Bagas SanjayaSep 4, 2023
  3. Junio C HamanoSep 5, 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.