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

Re: [PATCH v3] diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds changes

From
Tim Henigan <tim.henigan@gmail.com>
Date
Jun 21, 2012, 15:07 UTC
Message-ID
<CAFouethNTzcWq_YKzGz+jRTeCjKZEC2ZYMZuQxkF+5AOTC=x-A@mail.gmail.com>
In-Reply-To
<20120620160607.GA12856@sigill.intra.peff.net>
On Wed, Jun 20, 2012 at 12:06 PM, Jeff King <peff@peff.net> wrote:
Show 9 quoted lines
> On Wed, Jun 20, 2012 at 09:38:15AM -0400, Tim Henigan wrote:
>>
>> Are you planning to send this patch to the list?  If not, can I
>> include it as 1 of 2 before my patch?  If we go that route, I'm not
>> sure how to properly show you as the author...
>
> I'd probably get to it eventually, but I haven't touched it since I sent
> it. If you want to include some tests and package it with a commit
> message, that would make me very happy.
Thanks, I will do that.

It looks like the best place to add tests is t4010-diff-pathspec.sh. The only cases not tested through other means appear to be:

    git diff <file in repo> <relative path outside repo>
    git diff <relative path outside repo> <relative path outside repo>

Other pathspec variations seem to be covered extensively by other tests (mostly as a side effect). Am I missing other variations that should be checked?

In both cases shown above, we are simply verifying that giving a relative path to diff does not cause it to abort. So it may be sufficient to only test one of the above.

The tests that I added to t4035-diff-quiet.sh already cover both of the cases listed above. Is it worthwhile to duplicate some of those tests in t4010?

Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 13 in “diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds changes”
  1. diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds changesTim Henigan, Jun 18, 2012
  2. Jeff KingJun 18, 2012
  3. Junio C HamanoJun 18, 2012
  4. Tim HeniganJun 19, 2012
  5. Jeff KingJun 19, 2012
  6. Tim HeniganJun 19, 2012
  7. Tim HeniganJun 20, 2012
  8. Jeff KingJun 20, 2012
  9. Junio C HamanoJun 20, 2012
  10. Jeff KingJun 20, 2012
  11. Junio C HamanoJun 20, 2012
  12. Tim HeniganJun 21, 2012
  13. Junio C HamanoJun 21, 2012

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.