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

Re: [PATCH 3/3] doc/Makefile: drop doc-diff worktree and temporary files on "make clean"

From
Jeff King <peff@peff.net>
Date
Aug 31, 2018, 20:07 UTC
Message-ID
<20180831200748.GD5120@sigill.intra.peff.net>
In-Reply-To
<20180831063318.33373-4-sunshine@sunshineco.com>
On Fri, Aug 31, 2018 at 02:33:18AM -0400, Eric Sunshine wrote:
Show 7 quoted lines
> doc-diff creates a temporary working tree (git-worktree) and generates a
> bunch of temporary files which it does not remove since they act as a
> cache to speed up subsequent runs. Although doc-diff's working tree and
> generated files are not strictly build products of the Makefile (which,
> itself, never runs doc-diff), as a convenience, update "make clean" to
> clean up doc-diff's working tree and generated files along with other
> development detritus normally removed by "make clean".
Makes sense.
Show 9 quoted lines
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index a42dcfc745..26e268ae8d 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -332,6 +332,7 @@ clean:
>  	$(RM) SubmittingPatches.txt
>  	$(RM) $(cmds_txt) $(mergetools_txt) *.made
>  	$(RM) manpage-base-url.xsl
> +	'$(SHELL_PATH_SQ)' ./doc-diff --clean

This spelling took me by surprise. The doc-diff script itself specifies /bin/sh, and we do not build it, so the #! line is never replaced. I guess we are leaving it to people on exotic shells to run "$their_sh doc-diff" in the first place. That's probably OK, since it should work out of the box on most /bin/sh instances, and people on other platforms aren't that likely to even run it.

I don't think the script does anything complicated that would choke a lesser /bin/sh. But it doesn't hurt to be defensive, since this bit of the Makefile will be run for everyone, whether they care about doc-diff or not.

So that all makes sense. I initially wrote this to suggest that we call out this subtlety in the commit message. But I see this is based on existing instances from ee7ec2f9de (documentation: Makefile accounts for SHELL_PATH setting, 2009-03-22). So maybe I am just showing my ignorance. ;)

-Peff
Previous: Eric SunshineNext: Eric Sunshine
Message 11 of 25 in “doc-diff: always use oids inside worktree”
  1. doc-diff: always use oids inside worktreeJeff King, Aug 30, 2018
  2. Eric SunshineAug 30, 2018
  3. doc/Makefile: remove tmp-doc-diff on "make clean"Jeff King, Aug 30, 2018
  4. Eric SunshineAug 30, 2018
  5. Eric SunshineAug 30, 2018
  6. Jeff KingAug 30, 2018
  7. 0/3 doc-diff: add "clean" mode & fix portability problemEric Sunshine, Aug 31, 2018
  8. 1/3 doc-diff: fix non-portable 'man' invocationEric Sunshine, Aug 31, 2018
  9. Jeff KingAug 31, 2018
  10. 3/3 doc/Makefile: drop doc-diff worktree and temporary files on "make clean"Eric Sunshine, Aug 31, 2018
  11. Jeff KingAug 31, 2018
  12. Eric SunshineAug 31, 2018
  13. Jonathan NiederSep 17, 2018
  14. Junio C HamanoSep 17, 2018
  15. Jonathan NiederSep 17, 2018
  16. Junio C HamanoSep 17, 2018
  17. Jonathan NiederSep 17, 2018
  18. Jeff KingSep 18, 2018
  19. Eric SunshineSep 17, 2018
  20. Eric SunshineSep 17, 2018
  21. 2/3 doc-diff: add --clean mode to remove temporary working gunkEric Sunshine, Aug 31, 2018
  22. Jeff KingAug 31, 2018
  23. Eric SunshineAug 31, 2018
  24. Junio C HamanoAug 31, 2018
  25. Jeff KingAug 31, 2018

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.