All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: Karthik Nayak <karthik.188@gmail.com>,
	 peff@peff.net, git@vger.kernel.org,  nika@thelayzells.com
Subject: Re: [PATCH] refs: fix creation of corrupted reflogs for symrefs
Date: Wed, 22 Jan 2025 09:56:23 -0800	[thread overview]
Message-ID: <xmqqsepawx4o.fsf@gitster.g> (raw)
In-Reply-To: <Z5De17-Ed3K31kzh@pks.im> (Patrick Steinhardt's message of "Wed, 22 Jan 2025 13:04:39 +0100")

Patrick Steinhardt <ps@pks.im> writes:

>> This caused a bug in Git 2.48 where target references of symrefs being
>> updated would create a corrupted reflog entry for the symref since the
>> old_oid is not populated. Undo the skip in logic to fix this issue and
>> also add a test to ensure that such an issue doesn't arise in the
>> future.
>
> It's a bit curious that you describe the fix here, then in the next
> paragraph describe why we have skipped the logic only to reiterate the
> fix.
>
>> The early exit was added as a performance optimization for reflog-only
>> updates, but this accidentally broke symref reflog handling. Remove the
>> optimization since it wasn't essential to the original changes.

Yeah, that indeed is a "bit" curious.  I'd call it confusing, though
;-).

> Okay, makes sense. The error is specific to the "files" backend, which
> might be worth mentioning in the commit message.

Indeed.

>>  test_description='Test git update-ref and basic ref logging'
>> +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
>> +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>>  
>>  . ./test-lib.sh
>>  
>
> We could use `git symbolic-ref HEAD` to resolve the branch name instead
> of overriding the branch name here.

I agree.  That sounds like a more sensible way to go.

Thanks.

  reply	other threads:[~2025-01-22 17:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21 20:40 `git update-ref` fails to set reflog old_oid in 2.48 Nika Layzell
2025-01-21 21:52 ` Jeff King
2025-01-22  6:47   ` Karthik Nayak
2025-01-22 10:03   ` [PATCH] refs: fix creation of corrupted reflogs for symrefs Karthik Nayak
2025-01-22 12:04     ` Patrick Steinhardt
2025-01-22 17:56       ` Junio C Hamano [this message]
2025-01-23 10:21       ` Karthik Nayak
2025-01-22 15:02     ` Jeff King
2025-01-23 11:08       ` Karthik Nayak
2025-01-23 14:34         ` Jeff King
2025-01-23 11:29     ` [PATCH v2] " Karthik Nayak
2025-01-23 17:55       ` Junio C Hamano
2025-01-24 10:38         ` Karthik Nayak

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=xmqqsepawx4o.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.com \
    --cc=nika@thelayzells.com \
    --cc=peff@peff.net \
    --cc=ps@pks.im \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.