threads / discuss / 61817

seen branch dirty after 'make clean'

Subject: seen branch dirty after 'make clean'

## tl;dr

2 messages between Jul 21, 2024 and Jul 22, 2024.

replies: 1people: 2as markdown or json

Ramsay Jones· Jul 21, 2024, 20:43 UTC · lore

Just a quick heads up; with current seen branch, if you do a 'make clean' before building (as I routinely do), then:

  $ pwd
  /home/ramsay/git
  $ 
  $ git gcs HEAD
  19a89823f5 ("Merge branch 'pw/add-patch-with-suppress-blank-empty' into seen", 2024-07-20)
  $ 
  $ make clean >/dev/null
  $ 
  $ git status -uno
  On branch seen
  Your branch is up-to-date with 'origin/seen'.
  
  Changes not staged for commit:
    (use "git add/rm <file>..." to update what will be committed)
    (use "git restore <file>..." to discard changes in working directory)
  	deleted:    Documentation/docinfo.html
  
  no changes added to commit (use "git add" and/or "git commit -a")
  $ 
  $ git describe --dirty
  v2.46.0-rc1-129-g19a89823f5-dirty
  $ 
  $ git restore Documentation/docinfo.html
  $ 
  $ git status -uno
  On branch seen
  Your branch is up-to-date with 'origin/seen'.
  
  nothing to commit (use -u to show untracked files)
  $ 
  $ git describe --dirty
  v2.46.0-rc1-129-g19a89823f5
  $ 
 
This is because commit dbc2de902e ("asciidoctor: fix `synopsis` rendering",
2024-07-20) adds a tracked file (Documentation/docinfo.html) which the clean
target deletes (via *.html).

ATB, Ramsay Jones

Junio C Hamano· Jul 22, 2024, 16:18 UTC · re: Ramsay Jones · lore

Re: seen branch dirty after 'make clean'

Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
Show 9 quoted lines
> Just a quick heads up; with current seen branch, if you do a 'make clean'
> before building (as I routinely do), then:
>   $ git describe --dirty
>   v2.46.0-rc1-129-g19a89823f5
>   $ 
>  
> This is because commit dbc2de902e ("asciidoctor: fix `synopsis` rendering",
> 2024-07-20) adds a tracked file (Documentation/docinfo.html) which the clean
> target deletes (via *.html).

Not just "make clean" but Documentation/.gitignore explicitly says that in this project, we consider HTML files expendable, which is a sensible stance to take, because they are generated from other sources and nobody ought to be writing HTML by hand.

Let me squash this (or something like that) in.
Thanks.
 Documentation/Makefile                          | 5 +++++
 Documentation/{docinfo.html => docinfo-html.in} | 0
 2 files changed, 5 insertions(+)
diff --git c/Documentation/Makefile w/Documentation/Makefile
index 78e407e4bd..371d56eb5e 100644
--- c/Documentation/Makefile
+++ w/Documentation/Makefile
@@ -209,6 +209,8 @@ XMLTO_EXTRA += --skip-validation
 XMLTO_EXTRA += -x manpage.xsl
 endif
 
+ASCIIDOC_DEPS += docinfo.html
+
 SHELL_PATH ?= $(SHELL)
 # Shell quote;
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
@@ -337,6 +339,9 @@ clean:
 	$(RM) $(cmds_txt) $(mergetools_txt) *.made
 	$(RM) GIT-ASCIIDOCFLAGS
 
+docinfo.html: docinfo-html.in
+	$(QUIET_GEN)$(RM) $@ && cat $< >$@
+
 $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS)
 	$(QUIET_ASCIIDOC)$(TXT_TO_HTML) -d manpage -o $@ $<
 
diff --git c/Documentation/docinfo.html w/Documentation/docinfo-html.in
similarity index 100%
rename from Documentation/docinfo.html
rename to Documentation/docinfo-html.in

← back to recent threads