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

Re: [PATCH 1/6] t4051: add test for comments preceding function lines

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Nov 19, 2017, 01:18 UTC
Message-ID
<CAPig+cQTzBYLqHw5TRYFajTK2Uq2fE=q=h=b=VA43zdJs0_CMA@mail.gmail.com>
In-Reply-To
<b5815f62-3ed4-58ea-6d32-b156e44cbe3f@web.de>
On Sat, Nov 18, 2017 at 1:04 PM, René Scharfe <l.s.r@web.de> wrote:
Show 11 quoted lines
> When showing function context it would be helpful to show comments
> immediately before declarations, as they are most likely relevant.  Add
> a test for that.
>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---
> diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh
> @@ -85,6 +85,10 @@ test_expect_success 'setup' '
>> +test_expect_failure ' context includes comment' '
> +       grep "^ .*Hello comment" changed_hello.diff
> +'

This shows only that the the "* Hello comment." line is in the context but says nothing about the entire comment block being included (which patch 3/6 implements). Perhaps the test could be more thorough?

Show 11 quoted lines
> diff --git a/t/t4051/hello.c b/t/t4051/hello.c
> index 63b1a1e4ef..73e767e178 100644
> --- a/t/t4051/hello.c
> +++ b/t/t4051/hello.c
> @@ -1,4 +1,7 @@
>
> +/*
> + * Hello comment.
> + */
>  static void hello(void)        // Begin of hello
>  {
Previous: René ScharfeNext: René Scharfe
Message 3 of 15 in “show non-empty lines before functions with diff/grep -W”
  1. 0/6 show non-empty lines before functions with diff/grep -WRené Scharfe, Nov 18, 2017
  2. 1/6 t4051: add test for comments preceding function linesRené Scharfe, Nov 18, 2017
  3. Eric SunshineNov 19, 2017
  4. René ScharfeNov 19, 2017
  5. Junio C HamanoNov 20, 2017
  6. René ScharfeNov 20, 2017
  7. Junio C HamanoNov 21, 2017
  8. 3/6 xdiff: show non-empty lines before functions with -WRené Scharfe, Nov 18, 2017
  9. 5/6 grep: update boundary variable for pre-contextRené Scharfe, Nov 18, 2017
  10. 4/6 t7810: improve check of -W with user-defined function linesRené Scharfe, Nov 18, 2017
  11. 2/6 xdiff: factor out is_func_rec()René Scharfe, Nov 18, 2017
  12. 6/6 grep: show non-empty lines before functions with -WRené Scharfe, Nov 18, 2017
  13. Stefan BellerNov 20, 2017
  14. René ScharfeNov 20, 2017
  15. Stefan BellerNov 21, 2017

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.