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

Re: [PATCH v2] t4018: introduce test cases for the internal hunk header patterns

From
Thomas Rast <trast@student.ethz.ch>
Date
Dec 20, 2011, 09:13 UTC
Message-ID
<87ty4vli5s.fsf@thomas.inf.ethz.ch>
In-Reply-To
<1324348939-27115-1-git-send-email-drafnel@gmail.com>
Brandon Casey <drafnel@gmail.com> writes:
> Let's introduce some infrastructure to make it easy to create test cases
> for the hunk header patterns and provide a few cases for the cpp pattern.
[...]
>    int WRONG_function_hunk_header (void)
[...]
>    int RIGHT_function_hunk_header (void)
>    {
>            const char *msg = "ChangeMe";
Excellent idea!
Show 6 quoted lines
> +template <class T> int RIGHT_function_hunk_header (T unused)
> +{
> +	const char *msg = "ChangeMe";
> +	printf("Hello, world, %s\n", msg);
> +	return 0;
> +}

I'd still like to have an extremely contrived overuse of templated classes, like so:

---- 8< ----
int WRONG_function_hunk_header_preceding_the_right_one (void)
{
	return 0;
}
foo::RIGHT<int*&,1>::operator<<(int bar)
{
	const char *msg = "ChangeMe";
	printf("Hello, world, %s\n", msg);
	return 0;
}
int WRONG_function_hunk_header_following_the_right_one (void)
{
	return 0;
}
---- >8 ----

That will guard us against updating the C++ pattern to something better but still slightly too simple.

Other than that and Jakub's comments,
Acked-by: Thomas Rast <trast@student.ethz.ch>
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Brandon CaseyNext: Johannes Sixt
Message 26 of 35 in “attr: map builtin userdiff drivers to well-known extensions”
  1. attr: map builtin userdiff drivers to well-known extensionsJeff King, Dec 16, 2011
  2. Johannes SixtDec 16, 2011
  3. Junio C HamanoDec 16, 2011
  4. Jeff KingDec 16, 2011
  5. Jeff KingDec 16, 2011
  6. Junio C HamanoDec 16, 2011
  7. Jeff KingDec 17, 2011
  8. Johannes SixtDec 16, 2011
  9. Jeff KingDec 17, 2011
  10. Jonathan NiederDec 17, 2011
  11. 1/2 attr: map builtin userdiff drivers to well-known extensionsJeff King, Dec 19, 2011
  12. Jonathan NiederDec 19, 2011
  13. Jeff KingDec 19, 2011
  14. Ævar Arnfjörð BjarmasonDec 22, 2011
  15. 2/2 attr: drop C/C++ default extension mappingJeff King, Dec 19, 2011
  16. Jonathan NiederDec 19, 2011
  17. Thomas RastDec 19, 2011
  18. t4018: introduce test cases for the internal hunk header patternsBrandon Casey, Dec 19, 2011
  19. t4018: add a few more test cases for cpp hunk header matchingBrandon Casey, Dec 19, 2011
  20. Junio C HamanoDec 19, 2011
  21. Brandon CaseyDec 19, 2011
  22. Junio C HamanoDec 19, 2011
  23. t4018: introduce test cases for the internal hunk header patternsBrandon Casey, Dec 20, 2011
  24. Jakub NarebskiDec 20, 2011
  25. Brandon CaseyDec 20, 2011
  26. Thomas RastDec 20, 2011
  27. Johannes SixtDec 20, 2011
  28. Junio C HamanoDec 20, 2011
  29. Mark LevedahlDec 16, 2011
  30. Jeff KingDec 16, 2011
  31. Philip OakleyDec 16, 2011
  32. Jeff KingDec 16, 2011
  33. Philip OakleyDec 21, 2011
  34. Jeff KingDec 23, 2011
  35. Junio C HamanoDec 16, 2011

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.