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

Re: [BUG] assertion failure in builtin-mv.c with "git mv -k"

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 14, 2009, 19:02 UTC
Message-ID
<7vbpu91zjf.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<496E0D1C.20807@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 7 quoted lines
> So, should I prepare a series like:
>
> 1: test case and mark known fail
> 2: the 1 line fix
> 3: mark test pass
>
> Or should 2+3 be squashed into one?

If "git mv" already has its own sets of tests with a good coverage, please strive to add a case that covers your fix to an existing script. Then step #1 above would be a patch to add a few "test_expect_failure" tests to an existing file, and step #3 would be a patch to flip expect_failure to expect_success.

And in such a case, for a single liner, all three can be squashed in to a single patch. It would show what changed in the code and have a few new test_expect_success tests added to the test suite, and it would be obvious to anybody who looks at such a change 6 months down the road that the test cases added by the patch are the cases that did not work without the changes to the code. It never makes sense to separate steps #2 and #3 for any fix.

If "git mv" did not have adequate test coverage, then please add a test script with both expect_success (for cases that should have been there when somebody worked on "git mv" originally), and expect_failure to expose the bug you found in your first patch. Again, the second patch would update the code and flip expect_failure to expect_success.

I see there is t7001-mv and even though it claims to concentrate on its operation from subdirectory, it has tests for more basic modes of the operation.

So my recommendation would be to have a single patch that:
 (1) retitles t7001;
 (2) adds your new -k tests to it; and
 (3) adds the 1-liner fix.
Previous: Jeff KingNext: Michael J Gruber
Message 6 of 14 in “[BUG] assertion failure in builtin-mv.c with "git mv -k"”
  1. Matthieu MoyJan 14, 2009
  2. Michael J GruberJan 14, 2009
  3. Johannes SchindelinJan 14, 2009
  4. Michael J GruberJan 14, 2009
  5. Jeff KingJan 14, 2009
  6. Junio C HamanoJan 14, 2009
  7. Michael J GruberJan 15, 2009
  8. Junio C HamanoJan 15, 2009
  9. Matthieu MoyJan 16, 2009
  10. 0/3 Add test cases for "git mv -k" and fix a known breakage.Michael J Gruber, Jan 14, 2009
  11. 1/3 add test cases for "git mv -k"Michael J Gruber, Jan 14, 2009
  12. 2/3 fix handling of multiple untracked files for git mv -kMichael J Gruber, Jan 14, 2009
  13. 3/3 mark fixed breakage as expect pass for "git mv -k" multiple filesMichael J Gruber, Jan 14, 2009
  14. fix handling of multiple untracked files for git mv -kMichael J Gruber, Jan 14, 2009

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.