On Tue, Dec 20, 2011 at 2:25 AM, Jakub Narebski <jnareb@xxxxxxxxx> wrote: > Brandon Casey <drafnel@xxxxxxxxx> writes: > >> diff --git a/t/t4018/ignore_global.cpp b/t/t4018/ignore_global.cpp >> new file mode 100644 >> index 0000000..95e23bc >> --- /dev/null >> +++ b/t/t4018/ignore_global.cpp >> @@ -0,0 +1,19 @@ >> +int WRONG_function_hunk_header_preceding_the_right_one (void) >> +{ >> + return 0; >> +} >> + >> +int RIGHT_function_hunk_header (void) >> +{ >> + printf("Hello, world\n"); >> + return 0; >> +} >> + >> +int WRONG_global_variable; >> + >> +int ChangeMe; >> + >> +int WRONG_function_hunk_header_following_the_right_one (void) >> +{ >> + return 0; >> +} > > Shouldn't ChangeMe be inside function? No, this one is placed here after the WRONG_global_variable to make sure that a global variable is not chosen for the hunk header. It should chose the most recently encountered function name for the hunk header, which is RIGHT_function_hunk_header. >> diff --git a/t/t4018/simple.cpp b/t/t4018/simple.cpp >> new file mode 100644 >> index 0000000..c96ad87 >> --- /dev/null >> +++ b/t/t4018/simple.cpp >> @@ -0,0 +1,32 @@ >> +/* >> + * Test file for testing the internal hunk header patterns >> + * >> + * The "RIGHT" hunk header function, the one that should appear on the >> + * hunk header line, should be named "RIGHT_function_hunk_header" and >> + * the body of this function should have an assignment that looks like >> + * >> + * answer = 0 > > Shouldn't it be ChangeMe? Whoops, I forgot about that text. Thanks for noticing. Yes this is incorrect now. I think I'll break that out into a README file. v3 forthcoming. -Brandon -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html