From: Elijah Newren <newren@gmail.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>,
ben.humphreys@atlassian.com,
Ben Humphreys <behumphreys@atlassian.com>
Subject: Re: [PATCH] merge-recursive: restore accidentally dropped setting of path
Date: Tue, 4 Jun 2019 13:14:46 -0700 [thread overview]
Message-ID: <CABPp-BGmgCPt7y9Qhtud3VAPDE-D07=Cw6jH9QverveMWV_iuw@mail.gmail.com> (raw)
In-Reply-To: <20190604131400.GS951@szeder.dev>
On Tue, Jun 4, 2019 at 6:14 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
>
> On Tue, Jun 04, 2019 at 12:26:14AM -0700, Elijah Newren wrote:
> > Of course, this wasn't the only bug; it also showed we had a glaring
> > whole in our test coverage -- there's a dearth of tests for rename/add
> > conflicts, and in particular none involving content merges for the
> > rename side. So, I created a patch which adds some tests for that
> > (which triggered the assertion error). I pulled SZEDER's fix into the
> > same patch and added a commit message explaining the issue, using a
> > Based-on-patch-by tag for the fix. SZEDER: if you'd like to see this
> > in a different format (maybe I add tests which show the error and then
> > in a separate patch authored by you we introduce your fix?), just let
> > me know.
>
> Nah, I'm fine with it.
>
...
> > In commit 8daec1df03de ("merge-recursive: switch from (oid,mode) pairs
> > to a diff_filespec", 2019-04-05), we actually switched from
> > (oid,mode,path) triplets to a diff_filespec -- but most callsites in the
> > patch only needed to worry about oid and mode so the commit message
> > focused on that. The oversight in the commit message apparently spilled
> > over to the code as will; one of the dozen or so callsites accidentally
>
> s/will/well/
Thanks, will fix this up.
> > + git ls-files -u >out &&
> > + test_line_count = 2 out &&
> > + git ls-files -u b >out &&
>
> Are these two 'git ls-files -u' executions as intended, i.e. first
> without a file and then with 'b'?
>
> Or is this a bit of a "Huh?!"-inducing way (for me; for you it might
> be an idiom :) to check that 'b' has two unmerged entries and no other
> file has unmerged entries?
Yes, with rename/add there's always a possibility that the original
filename ('a', in this case) appears unmerged or that due to the
rename/add collision that both paths are renamed (e.g. 'b.HEAD' and
'b.MERGE_HEAD') and entries for these are found in the index. I'll
add a quick little comment before the second saying 'Also, make sure
both unmerged entries are for "b"'.
> > + git hash-object b >actual &&
> > + git hash-object ours >expect &&
> > + test_cmp expect actual
>
> So these last three lines compute the object ids of two files and then
> compare those two oids to make sure they match... But wouldn't a
> 'test_cmp ours b' do the trick just as well?
Yes, that'd be better. I'll fix it up and resend.
next prev parent reply other threads:[~2019-06-04 20:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-03 20:23 [ANNOUNCE] Git v2.22.0-rc3 Junio C Hamano
2019-06-04 1:32 ` Ben Humphreys
2019-06-04 2:30 ` SZEDER Gábor
2019-06-04 7:26 ` [PATCH] merge-recursive: restore accidentally dropped setting of path Elijah Newren
2019-06-04 8:33 ` Ben Humphreys
2019-06-04 13:14 ` SZEDER Gábor
2019-06-04 20:14 ` Elijah Newren [this message]
2019-06-04 20:22 ` Elijah Newren
2019-06-04 20:27 ` [PATCH v2] " Elijah Newren
2019-06-04 21:07 ` SZEDER Gábor
2019-06-04 21:33 ` Junio C Hamano
2019-06-04 22:48 ` Elijah Newren
2019-06-04 1:47 ` [ANNOUNCE] Git v2.22.0-rc3 Bhaskar Chowdhury
2019-06-04 14:45 ` Git for Windows v2.22.0-rc3, was " Johannes Schindelin
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='CABPp-BGmgCPt7y9Qhtud3VAPDE-D07=Cw6jH9QverveMWV_iuw@mail.gmail.com' \
--to=newren@gmail.com \
--cc=behumphreys@atlassian.com \
--cc=ben.humphreys@atlassian.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=szeder.dev@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).