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

Re: [PATCH] merge_blobs: use strbuf instead of manually-sized mmfile_t

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 16, 2016, 21:27 UTC
Message-ID
<xmqqmvr0mjmc.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160216055043.GB28237@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> Yeah, maybe. There were two reasons I avoided adding a test.
>
> One, I secretly hoped that by dragging my feet we could get consensus on
> just ripping out merge-tree entirely. ;)
>
> Two, I'm not sure what the test output _should_ be. I think this case is
> buggy. So we can check that we don't corrupt the heap, which is nice,
> but I don't like adding a test that doesn't test_cmp the expected output
> (and see my earlier comments re: thinking hard).

Three, I know the existence of the program is not more than "we could do something like this" illustration by Linus, and its output is in no way _designed_ to be so. We know today that it does not do add/add conflict correctly thanks to this thread, but if we are going to keep this program, we'd need to start from really designing what its behaviour _should_ be, before casting the desirable behaviour into stone with tests.

> But if we are going to keep it, maybe some exercise of the code is
> better than none.

So, "exercise" is better than none in the sense that it would validate that "the command does something without barfing", but I think there is a downside to casting its current behaviour as the expected output in stone, if we are going to keep it.

Previous: Stefan FrühwirthNext: Stefan Frühwirth
Message 9 of 10 in “malloc memory corruption on merge-tree with leading newline”
  1. Stefan FrühwirthFeb 15, 2016
  2. Stefan FrühwirthFeb 15, 2016
  3. merge_blobs: use strbuf instead of manually-sized mmfile_tJeff King, Feb 16, 2016
  4. Eric SunshineFeb 16, 2016
  5. Jeff KingFeb 16, 2016
  6. Stefan FrühwirthFeb 16, 2016
  7. Jeff KingFeb 16, 2016
  8. Stefan FrühwirthFeb 19, 2016
  9. Junio C HamanoFeb 16, 2016
  10. Stefan FrühwirthFeb 19, 2016

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.