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

Re: [PATCH] merge-recursive: restore accidentally dropped setting of path

From
Elijah Newren <newren@gmail.com>
Date
Jun 4, 2019, 20:14 UTC
Message-ID
<CABPp-BGmgCPt7y9Qhtud3VAPDE-D07=Cw6jH9QverveMWV_iuw@mail.gmail.com>
In-Reply-To
<20190604131400.GS951@szeder.dev>
On Tue, Jun 4, 2019 at 6:14 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 15 quoted lines
>
> 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.
>
...
Show 8 quoted lines
> > 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.
Show 10 quoted lines
> > +             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"'.

Show 7 quoted lines
> > +             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.
Previous: SZEDER GáborNext: Elijah Newren
Message 7 of 14 in “[ANNOUNCE] Git v2.22.0-rc3”
  1. Junio C HamanoJun 3, 2019
  2. Ben HumphreysJun 4, 2019
  3. SZEDER GáborJun 4, 2019
  4. merge-recursive: restore accidentally dropped setting of pathElijah Newren, Jun 4, 2019
  5. Ben HumphreysJun 4, 2019
  6. SZEDER GáborJun 4, 2019
  7. Elijah NewrenJun 4, 2019
  8. Elijah NewrenJun 4, 2019
  9. merge-recursive: restore accidentally dropped setting of pathElijah Newren, Jun 4, 2019
  10. SZEDER GáborJun 4, 2019
  11. Junio C HamanoJun 4, 2019
  12. Elijah NewrenJun 4, 2019
  13. Bhaskar ChowdhuryJun 4, 2019
  14. Git for Windows v2.22.0-rc3, was Re: [ANNOUNCE] Git v2.22.0-rc3Johannes Schindelin, Jun 4, 2019

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.