git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH v4 2/2] merge-recursive: fix the refresh logic in update_file_flags
Date: Wed, 19 Feb 2020 13:39:26 -0800	[thread overview]
Message-ID: <xmqq36b6dzox.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CABPp-BFH2qgM2oR-6g-3RgPegpq4yZujizxCb=_Ax0g2WFOYYw@mail.gmail.com> (Elijah Newren's message of "Wed, 19 Feb 2020 11:32:03 -0800")

Elijah Newren <newren@gmail.com> writes:

>> Hmph, !.call_depth would avoid resetting update_wd to 0, so the only
>> difference this patch makes is when the caller of this helper passed
>> (update_wd == 0) during the outermost merge.  We did not tell
>> add_cacheinfo() to refresh, and refresh_cache_entry() was not
>> called.  But the new code forces refresh to happen for normal
>> entries.  The proposed log message explains that a refresh is needed
>> for a new cache entry, but if I am reading the code correctly, this
>> function is called with !update_wd from two places, one of which is
>> the "Adding %s" /* do not overwrite ... */ the log message mentions.
>>
>> But the other one?  When both sides added identically, we do have an
>> up-to-date result on our side already, so shouldn't we avoid forcing
>> update_wd in that case?
>
> This change doesn't force update_wd (write out a new file, also
> implies refreshing is needed), this only forces refreshing (check
> stat-related fields of existing file).
>
>> I do not think passing refresh==1 in that case will produce an
>> incorrect result, but doesn't it force an unnecessary refreshing?
>>
>> Puzzled.
>
> It does force a refreshing, and it is a necessary one based on
> merge-recursive's design.  You can verify by putting an "exit 1" right
> ...
> So, this was a bug all along for BOTH cases, we just didn't notice before.

Ah, thanks.  It was just me getting a wrong impression from the
proposed log message that only the other one needed refresh; if both
sides need a refresh, then the change is absolutely correct.

Thanks for clearing my puzzlement.  Will queue.


      reply	other threads:[~2020-02-19 21:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 17:15 [PATCH] t3424: new rebase testcase documenting a stat-dirty-like failure Elijah Newren via GitGitGadget
2020-02-17 19:12 ` Elijah Newren
2020-02-18 15:05   ` Phillip Wood
2020-02-18 15:59     ` Elijah Newren
2020-02-19 11:01       ` Phillip Wood
2020-02-19 16:00         ` Elijah Newren
2020-02-19 16:38           ` Junio C Hamano
2020-02-19 19:33           ` Phillip Wood
2020-02-18 14:03 ` Johannes Schindelin
2020-02-18 15:55   ` Elijah Newren
2020-02-18 20:55 ` [PATCH v2] " Elijah Newren via GitGitGadget
2020-02-18 21:33   ` Junio C Hamano
2020-02-18 22:01     ` Elijah Newren
2020-02-18 22:15   ` [PATCH v3] t3433: " Elijah Newren via GitGitGadget
2020-02-19 17:04     ` [PATCH v4 0/2] " Elijah Newren via GitGitGadget
2020-02-19 17:04       ` [PATCH v4 1/2] " Elijah Newren via GitGitGadget
2020-02-19 17:04       ` [PATCH v4 2/2] merge-recursive: fix the refresh logic in update_file_flags Elijah Newren via GitGitGadget
2020-02-19 18:40         ` Junio C Hamano
2020-02-19 19:32           ` Elijah Newren
2020-02-19 21:39             ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqq36b6dzox.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=newren@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).