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
Junio C Hamano <gitster@pobox.com>
Date
Nov 20, 2017, 00:36 UTC
Message-ID
<xmqqine5okeu.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<bde81d14-a955-4ea4-5799-2a95511d8215@web.de>
René Scharfe <l.s.r@web.de> writes:
> your suggested full-comment metric, i.e. more than nothing.  But more
> importantly it's the actual comment payload.  The leading "/*" line is
> included as a consequence of the employed heuristic, but a more
> refined one might omit it as it doesn't actually contain any comment.

I am slightly in favor of than against the above reasoning, but it probably deserves to be recorded somewhere more readily accessible than the mailing list archive. The title of the test "context *includes* comment" can be read to hint it by not saying that the precontext shows the *entire* comment, but that is a very weak hint that will be missed by anybody unaware of the reasoning behind this decision.

    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.

... but without specifying the choice of lines too rigidly in the test---we may want to stop before and not include "/*" in the future, for example.

perhaps?
Previous: René ScharfeNext: René Scharfe
Message 5 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.