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

Re: [PATCH v3 1/2] git-p4: add test case for "Translation of file content failed" error

From
Luke Diamand <luke@diamand.org>
Date
Sep 21, 2015, 07:47 UTC
Message-ID
<55FFB614.7000908@diamand.org>
In-Reply-To
<CAPig+cSFbYzLi8daS55B_sdvDPW4q6yOC5Hm75+Rmr-s1aFRHw@mail.gmail.com>
On 20/09/15 23:29, Eric Sunshine wrote:
Show 18 quoted lines
> On Sun, Sep 20, 2015 at 5:34 PM, Lars Schneider
> <larsxschneider@gmail.com> wrote:
>
>> What is the preferred way by the Git community? Combine patch and
>> test in one commit or a patch commit followed by a test commit? I
>> would prefer to have everything in one commit.
>
> If the tests are in a separate patch, Junio seems to prefer adding
> them after the problem is fixes; the idea being that tests are added
> to ensure that some future change doesn't break the feature, as
> opposed to showing that your patch fixes a bug.
>
> Whether or not to combine the fix with the new tests often depends
> upon the length of the patches and how easy or hard it is to review
> them. In this case, the fix itself is fairly short, but the tests are
> slightly lengthy, so there may not be a clear cut answer. As a
> reviewer, I tend to prefer smaller patches, however, this situation
> doesn't demand it, so use your best judgment.

I think in the past we have a test added that demonstrates the problem, with "test_expect_failure", followed by the fix, which also flips the test to "test_expect_success".

Luke
Previous: Eric SunshineNext: Junio C Hamano
Message 6 of 12 in “git-p4: handle "Translation of file content failed"”
  1. 0/2 git-p4: handle "Translation of file content failed"larsxschneider@gmail.com, Sep 20, 2015
  2. 1/2 git-p4: add test case for "Translation of file content failed" errorlarsxschneider@gmail.com, Sep 20, 2015
  3. Eric SunshineSep 20, 2015
  4. Lars SchneiderSep 20, 2015
  5. Eric SunshineSep 20, 2015
  6. Luke DiamandSep 21, 2015
  7. Junio C HamanoSep 21, 2015
  8. Luke DiamandSep 21, 2015
  9. Lars SchneiderSep 21, 2015
  10. Torsten BögershausenSep 21, 2015
  11. Junio C HamanoSep 21, 2015
  12. 2/2 git-p4: handle "Translation of file content failed"larsxschneider@gmail.com, Sep 20, 2015

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.