{"thread":{"id":"55949","subject":"[PATCH 1/3] Makefile: mark \"check\" target as .PHONY","startedAt":"2021-06-17T10:01:47Z","lastAt":"2021-06-29T19:25:27Z","messageCount":15,"participants":["Ævar Arnfjörð Bjarmason","Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"427684","messageId":"patch-1.3-27c94247f8-20210617T095827Z-avarab@gmail.com","threadId":"55949","inReplyTo":"cover-0.3-0000000000-20210617T095827Z-avarab@gmail.com","subject":"[PATCH 1/3] Makefile: mark \"check\" target as .PHONY","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:01:36Z","receivedAt":"2021-06-17T10:01:47Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Fix a bug in 44c9e8594e (Fix up header file dependencies and add\nsparse checking rules, 2005-07-03), we never marked the phony \"check\"\ntarget as such.\n\nPerhaps we should just remove it, since as of a combination of\n912f9980d2 (Makefile: help people who run 'make check' by mistake,\n2008-11-11) 0bcd9ae85d (sparse: Fix errors due to missing\ntarget-specific variables, 2011-04-21) we've been suggesting the user\nrun \"make sparse\" directly.\n\nBut under that mode it still does something, as well as directing the\nuser to run \"make test\" under non-sparse. So let's punt that and\nnarrowly fix the PHONY bug.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/Makefile b/Makefile\nindex c3565fc0f8..7f984bce50 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2910,6 +2910,7 @@ hdr-check: $(HCO)\n style:\n \tgit clang-format --style file --diff --extensions c,h\n \n+.PHONY: check\n check: config-list.h command-list.h\n \t@if sparse; \\\n \tthen \\\n-- \n2.32.0.576.g59759b6ca7d\n\n"},{"id":"427685","messageId":"cover-0.3-0000000000-20210617T095827Z-avarab@gmail.com","threadId":"55949","inReplyTo":null,"subject":"[PATCH 0/3] Makefile: misc trivial fixes","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:01:35Z","receivedAt":"2021-06-17T10:01:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"I'm re-rolling ab/config-based-hooks-base to deal with (among other\nthings) a vcbuild failure. This doesn't fix that, but allows me to fix\nthat in one place, instead copy/pasting things all over the place.\n\nThe reason I'd need to do that is because we define GENERATED_H, but\nthen proceed not to use it when we should. This small series fixes\nthat in 2/3, and fixes a couple of adjacent trivial issues in 1/3 and\n3/3.\n\nÆvar Arnfjörð Bjarmason (3):\n  Makefile: mark \"check\" target as .PHONY\n  Makefile: stop hardcoding {command,config}-list.h\n  Makefile: remove an out-of-date comment\n\n Makefile              | 13 +++++--------\n compat/vcbuild/README |  2 +-\n config.mak.uname      |  6 +++---\n 3 files changed, 9 insertions(+), 12 deletions(-)\n\n-- \n2.32.0.576.g59759b6ca7d\n\n"},{"id":"427686","messageId":"patch-3.3-ddae86802e-20210617T095827Z-avarab@gmail.com","threadId":"55949","inReplyTo":"cover-0.3-0000000000-20210617T095827Z-avarab@gmail.com","subject":"[PATCH 3/3] Makefile: remove an out-of-date comment","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:01:38Z","receivedAt":"2021-06-17T10:01:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This comment added in dfea575017 (Makefile: lazily compute header\ndependencies, 2010-01-26) has been out of date since\n92b88eba9f (Makefile: use `git ls-files` to list header files, if\npossible, 2019-03-04), when we did exactly what it tells us not to do\nand added $(GENERATED_H) to $(OBJECTS) dependencies.\n\nThe rest of it was also somewhere between inaccurate and outdated,\nsince as of b8ba629264 (Makefile: fold MISC_H into LIB_H, 2012-06-20)\nit's not followed by a list of header files, that got moved earlier in\nthe file into LIB_H in b8ba629264 (Makefile: fold MISC_H into LIB_H,\n2012-06-20).\n\nLet's just remove it entirely, to the extent that we have anything\nuseful to say here the comment on the\n\"USE_COMPUTED_HEADER_DEPENDENCIES\" variable a few lines above this\nchange does the job for us.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 6 ------\n 1 file changed, 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 66f5ded3a4..29a152cd4f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2503,12 +2503,6 @@ ifneq ($(dep_files_present),)\n include $(dep_files_present)\n endif\n else\n-# Dependencies on header files, for platforms that do not support\n-# the gcc -MMD option.\n-#\n-# Dependencies on automatically generated headers such as command-list.h\n-# should _not_ be included here, since they are necessary even when\n-# building an object for the first time.\n \n $(OBJECTS): $(LIB_H) $(GENERATED_H)\n endif\n-- \n2.32.0.576.g59759b6ca7d\n\n"},{"id":"427687","messageId":"patch-2.3-6e164edb0b-20210617T095827Z-avarab@gmail.com","threadId":"55949","inReplyTo":"cover-0.3-0000000000-20210617T095827Z-avarab@gmail.com","subject":"[PATCH 2/3] Makefile: stop hardcoding {command,config}-list.h","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T10:01:37Z","receivedAt":"2021-06-17T10:01:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change various places that hardcode the names of these two files to\nrefer to either $(GENERATED_H), or to a new generated-hdrs\ntarget. That target is consistent with the *-objs targets I recently\nadded in 029bac01a8 (Makefile: add {program,xdiff,test,git,fuzz}-objs\n& objects targets, 2021-02-23).\n\nI have not tested the Windows-specific change in config.mak.uname\nbeing made here, but we use other variables from the Makefile in the\nsame block, and the GENERATED_H is fully defined before we include\nconfig.mak.uname.\n\nHardcoding command-list.h there seems to have been a case of\ncopy/paste programming in dce7d29551 (msvc: support building Git using\nMS Visual C++, 2019-06-25). The config-list.h was added later in\n709df95b78 (help: move list_config_help to builtin/help, 2020-04-16).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile              | 6 ++++--\n compat/vcbuild/README | 2 +-\n config.mak.uname      | 6 +++---\n 3 files changed, 8 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7f984bce50..66f5ded3a4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -817,6 +817,8 @@ XDIFF_LIB = xdiff/lib.a\n \n GENERATED_H += command-list.h\n GENERATED_H += config-list.h\n+.PHONY: generated-hdrs\n+generated-hdrs: $(GENERATED_H)\n \n LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \\\n \t$(FIND) . \\\n@@ -2888,7 +2890,7 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE\n .PHONY: sparse $(SP_OBJ)\n sparse: $(SP_OBJ)\n \n-EXCEPT_HDRS := command-list.h config-list.h unicode-width.h compat/% xdiff/%\n+EXCEPT_HDRS := $(GENERATED_H) unicode-width.h compat/% xdiff/%\n ifndef GCRYPT_SHA256\n \tEXCEPT_HDRS += sha256/gcrypt.h\n endif\n@@ -2911,7 +2913,7 @@ style:\n \tgit clang-format --style file --diff --extensions c,h\n \n .PHONY: check\n-check: config-list.h command-list.h\n+check: $(GENERATED_H)\n \t@if sparse; \\\n \tthen \\\n \t\techo >&2 \"Use 'make sparse' instead\"; \\\ndiff --git a/compat/vcbuild/README b/compat/vcbuild/README\nindex 51fb083dbb..29ec1d0f10 100644\n--- a/compat/vcbuild/README\n+++ b/compat/vcbuild/README\n@@ -92,7 +92,7 @@ The Steps of Build Git with VS2008\n    the git operations.\n \n 3. Inside Git's directory run the command:\n-       make command-list.h config-list.h\n+       make generated-hdrs\n    to generate the header file needed to compile git.\n \n 4. Then either build Git with the GNU Make Makefile in the Git projects\ndiff --git a/config.mak.uname b/config.mak.uname\nindex cb443b4e02..af4c5c540e 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -722,9 +722,9 @@ vcxproj:\n \t echo '</Project>') >git-remote-http/LinkOrCopyRemoteHttp.targets\n \tgit add -f git/LinkOrCopyBuiltins.targets git-remote-http/LinkOrCopyRemoteHttp.targets\n \n-\t# Add command-list.h and config-list.h\n-\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 config-list.h command-list.h\n-\tgit add -f config-list.h command-list.h\n+\t# Add generated headers\n+\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(GENERATED_H)\n+\tgit add -f $(GENERATED_H)\n \n \t# Add scripts\n \trm -f perl/perl.mak\n-- \n2.32.0.576.g59759b6ca7d\n\n"},{"id":"427784","messageId":"60cbaad7c4cee_9bf208a6@natae.notmuch","threadId":"55949","inReplyTo":"patch-1.3-27c94247f8-20210617T095827Z-avarab@gmail.com","subject":"RE: [PATCH 1/3] Makefile: mark \"check\" target as .PHONY","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-06-17T20:04:39Z","receivedAt":"2021-06-17T20:04:54Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2910,6 +2910,7 @@ hdr-check: $(HCO)\n>  style:\n>  \tgit clang-format --style file --diff --extensions c,h\n>  \n> +.PHONY: check\n>  check: config-list.h command-list.h\n>  \t@if sparse; \\\n>  \tthen \\\n\nObviously correct.\n\n-- \nFelipe Contreras"},{"id":"427785","messageId":"60cbad11b13f5_9bf20896@natae.notmuch","threadId":"55949","inReplyTo":"patch-2.3-6e164edb0b-20210617T095827Z-avarab@gmail.com","subject":"RE: [PATCH 2/3] Makefile: stop hardcoding {command,config}-list.h","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-06-17T20:14:09Z","receivedAt":"2021-06-17T20:14:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> Change various places that hardcode the names of these two files to\n> refer to either $(GENERATED_H), or to a new generated-hdrs\n> target.\n\nAvoiding hard-coded things is generally a good idea, and I can smell\nthere's an advantage nearby, but it's not stated.\n\nCan you spell out what you are trying to achieve?\n\n> Hardcoding command-list.h there seems to have been a case of\n> copy/paste programming in dce7d29551 (msvc: support building Git using\n> MS Visual C++, 2019-06-25).\n\nActually that's not the commit, it's this one:\n\n976aaedca0 (msvc: add a Makefile target to pre-generate the Visual\nStudio solution, 2019-07-29)\n\nThe changes themselves look good to me.\n\n-- \nFelipe Contreras"},{"id":"427787","messageId":"60cbb6bc37daf_9bf20865@natae.notmuch","threadId":"55949","inReplyTo":"patch-3.3-ddae86802e-20210617T095827Z-avarab@gmail.com","subject":"RE: [PATCH 3/3] Makefile: remove an out-of-date comment","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-06-17T20:55:24Z","receivedAt":"2021-06-17T20:55:29Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> This comment added in dfea575017 (Makefile: lazily compute header\n> dependencies, 2010-01-26) has been out of date since\n> 92b88eba9f (Makefile: use `git ls-files` to list header files, if\n> possible, 2019-03-04), when we did exactly what it tells us not to do\n> and added $(GENERATED_H) to $(OBJECTS) dependencies.\n\nVery true.\n\n> The rest of it was also somewhere between inaccurate and outdated,\n> since as of b8ba629264 (Makefile: fold MISC_H into LIB_H, 2012-06-20)\n> it's not followed by a list of header files, that got moved earlier in\n> the file into LIB_H in b8ba629264 (Makefile: fold MISC_H into LIB_H,\n> 2012-06-20).\n\nI don't see the point in mentioning b8ba629264 twice, perhaps you meant:\n\n60d24dd255 (Makefile: fold XDIFF_H and VCSSVN_H into LIB_H, 2012-07-06)\n\nThis commit also removed part of the comment:\n\n  # XXX. Please check occasionally that these include all dependencies\n  # gcc detects!\n\nI have tried to understand what was the purpose of that comment in the\npast, but I don't get it, it says:\n\n  Dependencies on automatically generated headers such as command-list.h\n  should _not_ be included here, since they are necessary even when\n  building an object for the first time.\n\nWhy would it matter if we are building the object for the first time, or\nrebuilding it? If we need command-list.h to build help.o once, we need\nit always. What am I missing?\n\nIt seems to me this comment never made sense.\n\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2503,12 +2503,6 @@ ifneq ($(dep_files_present),)\n>  include $(dep_files_present)\n>  endif\n>  else\n> -# Dependencies on header files, for platforms that do not support\n> -# the gcc -MMD option.\n> -#\n> -# Dependencies on automatically generated headers such as command-list.h\n> -# should _not_ be included here, since they are necessary even when\n> -# building an object for the first time.\n>  \n\nCan we remove that extra space once we are at it?\n\n>  $(OBJECTS): $(LIB_H) $(GENERATED_H)\n>  endif\n\nThe change itself looks good to me.\n\nCheers.\n\n-- \nFelipe Contreras"},{"id":"427789","messageId":"87zgvo435v.fsf@evledraar.gmail.com","threadId":"55949","inReplyTo":"60cbad11b13f5_9bf20896@natae.notmuch","subject":"Re: [PATCH 2/3] Makefile: stop hardcoding {command,config}-list.h","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-17T20:58:59Z","receivedAt":"2021-06-17T21:00:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Jun 17 2021, Felipe Contreras wrote:\n\n> Ævar Arnfjörð Bjarmason wrote:\n>> Change various places that hardcode the names of these two files to\n>> refer to either $(GENERATED_H), or to a new generated-hdrs\n>> target.\n>\n> Avoiding hard-coded things is generally a good idea, and I can smell\n> there's an advantage nearby, but it's not stated.\n>\n> Can you spell out what you are trying to achieve?\n\nIt's hinted at in the CL, but this is series 1/3 of a re-roll of the\nbase topic for config-based hooks, real use of this is made in step 2/3,\n3/3 has a better overview:\nhttp://lore.kernel.org/git/cover-00.27-0000000000-20210617T101216Z-avarab@gmail.com\n\n>> Hardcoding command-list.h there seems to have been a case of\n>> copy/paste programming in dce7d29551 (msvc: support building Git using\n>> MS Visual C++, 2019-06-25).\n>\n> Actually that's not the commit, it's this one:\n>\n> 976aaedca0 (msvc: add a Makefile target to pre-generate the Visual\n> Studio solution, 2019-07-29)\n\nThanks, I had both in my buffers somewhere and copied over the wrong\none. Will correct pending further feedback...\n"},{"id":"427795","messageId":"60cbc56c92b4_1299208f6@natae.notmuch","threadId":"55949","inReplyTo":"87zgvo435v.fsf@evledraar.gmail.com","subject":"Re: [PATCH 2/3] Makefile: stop hardcoding {command,config}-list.h","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-06-17T21:58:04Z","receivedAt":"2021-06-17T21:58:10Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> \n> On Thu, Jun 17 2021, Felipe Contreras wrote:\n> \n> > Ævar Arnfjörð Bjarmason wrote:\n> >> Change various places that hardcode the names of these two files to\n> >> refer to either $(GENERATED_H), or to a new generated-hdrs\n> >> target.\n> >\n> > Avoiding hard-coded things is generally a good idea, and I can smell\n> > there's an advantage nearby, but it's not stated.\n> >\n> > Can you spell out what you are trying to achieve?\n> \n> It's hinted at in the CL,\n\nYes, but the commit message should stand on its own.\n\n> but this is series 1/3 of a re-roll of the\n> base topic for config-based hooks, real use of this is made in step 2/3,\n> 3/3 has a better overview:\n> http://lore.kernel.org/git/cover-00.27-0000000000-20210617T101216Z-avarab@gmail.com\n\nYeah, I read the cover letter afterwards, but I'm just putting my\nreviewer cap; the rationale belongs in the commit message: we will want\nmore generated files in GENERATED_H.\n\nAlso, I presume you meant this one:\n\nhttps://lore.kernel.org/git/cover-0.3-0000000000-20210617T100239Z-avarab@gmail.com/\n\nCheers.\n\n-- \nFelipe Contreras"},{"id":"427814","messageId":"87tulv4mw7.fsf@evledraar.gmail.com","threadId":"55949","inReplyTo":"60cbc56c92b4_1299208f6@natae.notmuch","subject":"Re: [PATCH 2/3] Makefile: stop hardcoding {command,config}-list.h","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-18T08:05:33Z","receivedAt":"2021-06-18T08:06:53Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Jun 17 2021, Felipe Contreras wrote:\n\n> Ævar Arnfjörð Bjarmason wrote:\n>> \n>> On Thu, Jun 17 2021, Felipe Contreras wrote:\n>> \n>> > Ævar Arnfjörð Bjarmason wrote:\n>> >> Change various places that hardcode the names of these two files to\n>> >> refer to either $(GENERATED_H), or to a new generated-hdrs\n>> >> target.\n>> >\n>> > Avoiding hard-coded things is generally a good idea, and I can smell\n>> > there's an advantage nearby, but it's not stated.\n>> >\n>> > Can you spell out what you are trying to achieve?\n>> \n>> It's hinted at in the CL,\n>\n> Yes, but the commit message should stand on its own.\n>\n>> but this is series 1/3 of a re-roll of the\n>> base topic for config-based hooks, real use of this is made in step 2/3,\n>> 3/3 has a better overview:\n>> http://lore.kernel.org/git/cover-00.27-0000000000-20210617T101216Z-avarab@gmail.com\n>\n> Yeah, I read the cover letter afterwards, but I'm just putting my\n> reviewer cap; the rationale belongs in the commit message: we will want\n> more generated files in GENERATED_H.\n>\n\n\nThanks, I'll reword it. I initially figured in this case it was better\nnot to distract from a stand-alone change with what inspired it, but\nwill do.\n\n> Also, I presume you meant this one:\n> https://lore.kernel.org/git/cover-0.3-0000000000-20210617T100239Z-avarab@gmail.com/\n\nThat's 2/3, but yes. That comes after this one. I meant to link to 3/3\nto give the general overview of how this relates to that re-rolled topic\nat large.\n"},{"id":"428766","messageId":"cover-0.3-0000000000-20210629T190137Z-avarab@gmail.com","threadId":"55949","inReplyTo":"cover-0.3-0000000000-20210617T095827Z-avarab@gmail.com","subject":"[PATCH v2 0/3] Makefile: misc trivial fixes","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T19:03:30Z","receivedAt":"2021-06-29T19:03:38Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"A base topic for some larger changes. See the v1 CL for a summary:\nhttp://lore.kernel.org/git/cover-0.3-0000000000-20210617T095827Z-avarab@gmail.com\n\nThe only changes since v1 are to commit message issues pointed out by\nFelipe and a trivial whitespace change. I also updated the commit\nmessage of 2/3 as he suggested to point out why the change is being\nmade.\n\nÆvar Arnfjörð Bjarmason (3):\n  Makefile: mark \"check\" target as .PHONY\n  Makefile: stop hardcoding {command,config}-list.h\n  Makefile: remove an out-of-date comment\n\n Makefile              | 14 +++++---------\n compat/vcbuild/README |  2 +-\n config.mak.uname      |  6 +++---\n 3 files changed, 9 insertions(+), 13 deletions(-)\n\nRange-diff against v1:\n-:  ---------- > 1:  27c94247f8 Makefile: mark \"check\" target as .PHONY\n1:  6e164edb0b ! 2:  983d072d52 Makefile: stop hardcoding {command,config}-list.h\n    @@ Commit message\n         added in 029bac01a8 (Makefile: add {program,xdiff,test,git,fuzz}-objs\n         & objects targets, 2021-02-23).\n     \n    +    A follow-up commit (not part of this series) will add a new generated\n    +    hook-list.h. By doing this refactoring we'll only need to add the new\n    +    file to the GENERATED_H variable, not EXCEPT_HDRS, the vcbuild/README\n    +    etc.\n    +\n         I have not tested the Windows-specific change in config.mak.uname\n         being made here, but we use other variables from the Makefile in the\n         same block, and the GENERATED_H is fully defined before we include\n         config.mak.uname.\n     \n         Hardcoding command-list.h there seems to have been a case of\n    -    copy/paste programming in dce7d29551 (msvc: support building Git using\n    -    MS Visual C++, 2019-06-25). The config-list.h was added later in\n    -    709df95b78 (help: move list_config_help to builtin/help, 2020-04-16).\n    +    copy/paste programming in 976aaedca0 (msvc: add a Makefile target to\n    +    pre-generate the Visual Studio solution, 2019-07-29). The\n    +    config-list.h was added later in 709df95b78 (help: move\n    +    list_config_help to builtin/help, 2020-04-16).\n     \n         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n2:  ddae86802e ! 3:  44a4781218 Makefile: remove an out-of-date comment\n    @@ Commit message\n         The rest of it was also somewhere between inaccurate and outdated,\n         since as of b8ba629264 (Makefile: fold MISC_H into LIB_H, 2012-06-20)\n         it's not followed by a list of header files, that got moved earlier in\n    -    the file into LIB_H in b8ba629264 (Makefile: fold MISC_H into LIB_H,\n    -    2012-06-20).\n    +    the file into LIB_H in 60d24dd255 (Makefile: fold XDIFF_H and VCSSVN_H\n    +    into LIB_H, 2012-07-06).\n     \n         Let's just remove it entirely, to the extent that we have anything\n         useful to say here the comment on the\n    @@ Makefile: ifneq ($(dep_files_present),)\n     -# Dependencies on automatically generated headers such as command-list.h\n     -# should _not_ be included here, since they are necessary even when\n     -# building an object for the first time.\n    - \n    +-\n      $(OBJECTS): $(LIB_H) $(GENERATED_H)\n      endif\n    + \n-- \n2.32.0.615.g90fb4d7369\n\n"},{"id":"428767","messageId":"patch-1.3-27c94247f8-20210629T190137Z-avarab@gmail.com","threadId":"55949","inReplyTo":"cover-0.3-0000000000-20210629T190137Z-avarab@gmail.com","subject":"[PATCH v2 1/3] Makefile: mark \"check\" target as .PHONY","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T19:03:31Z","receivedAt":"2021-06-29T19:03:44Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Fix a bug in 44c9e8594e (Fix up header file dependencies and add\nsparse checking rules, 2005-07-03), we never marked the phony \"check\"\ntarget as such.\n\nPerhaps we should just remove it, since as of a combination of\n912f9980d2 (Makefile: help people who run 'make check' by mistake,\n2008-11-11) 0bcd9ae85d (sparse: Fix errors due to missing\ntarget-specific variables, 2011-04-21) we've been suggesting the user\nrun \"make sparse\" directly.\n\nBut under that mode it still does something, as well as directing the\nuser to run \"make test\" under non-sparse. So let's punt that and\nnarrowly fix the PHONY bug.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/Makefile b/Makefile\nindex c3565fc0f8..7f984bce50 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2910,6 +2910,7 @@ hdr-check: $(HCO)\n style:\n \tgit clang-format --style file --diff --extensions c,h\n \n+.PHONY: check\n check: config-list.h command-list.h\n \t@if sparse; \\\n \tthen \\\n-- \n2.32.0.615.g90fb4d7369\n\n"},{"id":"428768","messageId":"patch-2.3-983d072d52-20210629T190137Z-avarab@gmail.com","threadId":"55949","inReplyTo":"cover-0.3-0000000000-20210629T190137Z-avarab@gmail.com","subject":"[PATCH v2 2/3] Makefile: stop hardcoding {command,config}-list.h","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T19:03:32Z","receivedAt":"2021-06-29T19:03:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change various places that hardcode the names of these two files to\nrefer to either $(GENERATED_H), or to a new generated-hdrs\ntarget. That target is consistent with the *-objs targets I recently\nadded in 029bac01a8 (Makefile: add {program,xdiff,test,git,fuzz}-objs\n& objects targets, 2021-02-23).\n\nA follow-up commit (not part of this series) will add a new generated\nhook-list.h. By doing this refactoring we'll only need to add the new\nfile to the GENERATED_H variable, not EXCEPT_HDRS, the vcbuild/README\netc.\n\nI have not tested the Windows-specific change in config.mak.uname\nbeing made here, but we use other variables from the Makefile in the\nsame block, and the GENERATED_H is fully defined before we include\nconfig.mak.uname.\n\nHardcoding command-list.h there seems to have been a case of\ncopy/paste programming in 976aaedca0 (msvc: add a Makefile target to\npre-generate the Visual Studio solution, 2019-07-29). The\nconfig-list.h was added later in 709df95b78 (help: move\nlist_config_help to builtin/help, 2020-04-16).\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile              | 6 ++++--\n compat/vcbuild/README | 2 +-\n config.mak.uname      | 6 +++---\n 3 files changed, 8 insertions(+), 6 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7f984bce50..66f5ded3a4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -817,6 +817,8 @@ XDIFF_LIB = xdiff/lib.a\n \n GENERATED_H += command-list.h\n GENERATED_H += config-list.h\n+.PHONY: generated-hdrs\n+generated-hdrs: $(GENERATED_H)\n \n LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \\\n \t$(FIND) . \\\n@@ -2888,7 +2890,7 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE\n .PHONY: sparse $(SP_OBJ)\n sparse: $(SP_OBJ)\n \n-EXCEPT_HDRS := command-list.h config-list.h unicode-width.h compat/% xdiff/%\n+EXCEPT_HDRS := $(GENERATED_H) unicode-width.h compat/% xdiff/%\n ifndef GCRYPT_SHA256\n \tEXCEPT_HDRS += sha256/gcrypt.h\n endif\n@@ -2911,7 +2913,7 @@ style:\n \tgit clang-format --style file --diff --extensions c,h\n \n .PHONY: check\n-check: config-list.h command-list.h\n+check: $(GENERATED_H)\n \t@if sparse; \\\n \tthen \\\n \t\techo >&2 \"Use 'make sparse' instead\"; \\\ndiff --git a/compat/vcbuild/README b/compat/vcbuild/README\nindex 51fb083dbb..29ec1d0f10 100644\n--- a/compat/vcbuild/README\n+++ b/compat/vcbuild/README\n@@ -92,7 +92,7 @@ The Steps of Build Git with VS2008\n    the git operations.\n \n 3. Inside Git's directory run the command:\n-       make command-list.h config-list.h\n+       make generated-hdrs\n    to generate the header file needed to compile git.\n \n 4. Then either build Git with the GNU Make Makefile in the Git projects\ndiff --git a/config.mak.uname b/config.mak.uname\nindex cb443b4e02..af4c5c540e 100644\n--- a/config.mak.uname\n+++ b/config.mak.uname\n@@ -722,9 +722,9 @@ vcxproj:\n \t echo '</Project>') >git-remote-http/LinkOrCopyRemoteHttp.targets\n \tgit add -f git/LinkOrCopyBuiltins.targets git-remote-http/LinkOrCopyRemoteHttp.targets\n \n-\t# Add command-list.h and config-list.h\n-\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 config-list.h command-list.h\n-\tgit add -f config-list.h command-list.h\n+\t# Add generated headers\n+\t$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(GENERATED_H)\n+\tgit add -f $(GENERATED_H)\n \n \t# Add scripts\n \trm -f perl/perl.mak\n-- \n2.32.0.615.g90fb4d7369\n\n"},{"id":"428769","messageId":"patch-3.3-44a4781218-20210629T190137Z-avarab@gmail.com","threadId":"55949","inReplyTo":"cover-0.3-0000000000-20210629T190137Z-avarab@gmail.com","subject":"[PATCH v2 3/3] Makefile: remove an out-of-date comment","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-06-29T19:03:33Z","receivedAt":"2021-06-29T19:03:46Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This comment added in dfea575017 (Makefile: lazily compute header\ndependencies, 2010-01-26) has been out of date since\n92b88eba9f (Makefile: use `git ls-files` to list header files, if\npossible, 2019-03-04), when we did exactly what it tells us not to do\nand added $(GENERATED_H) to $(OBJECTS) dependencies.\n\nThe rest of it was also somewhere between inaccurate and outdated,\nsince as of b8ba629264 (Makefile: fold MISC_H into LIB_H, 2012-06-20)\nit's not followed by a list of header files, that got moved earlier in\nthe file into LIB_H in 60d24dd255 (Makefile: fold XDIFF_H and VCSSVN_H\ninto LIB_H, 2012-07-06).\n\nLet's just remove it entirely, to the extent that we have anything\nuseful to say here the comment on the\n\"USE_COMPUTED_HEADER_DEPENDENCIES\" variable a few lines above this\nchange does the job for us.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n Makefile | 7 -------\n 1 file changed, 7 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 66f5ded3a4..14996b6840 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2503,13 +2503,6 @@ ifneq ($(dep_files_present),)\n include $(dep_files_present)\n endif\n else\n-# Dependencies on header files, for platforms that do not support\n-# the gcc -MMD option.\n-#\n-# Dependencies on automatically generated headers such as command-list.h\n-# should _not_ be included here, since they are necessary even when\n-# building an object for the first time.\n-\n $(OBJECTS): $(LIB_H) $(GENERATED_H)\n endif\n \n-- \n2.32.0.615.g90fb4d7369\n\n"},{"id":"428771","messageId":"60db73952e3af_4f7020818@natae.notmuch","threadId":"55949","inReplyTo":"cover-0.3-0000000000-20210629T190137Z-avarab@gmail.com","subject":"RE: [PATCH v2 0/3] Makefile: misc trivial fixes","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-06-29T19:25:09Z","receivedAt":"2021-06-29T19:25:27Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> A base topic for some larger changes. See the v1 CL for a summary:\n> http://lore.kernel.org/git/cover-0.3-0000000000-20210617T095827Z-avarab@gmail.com\n> \n> The only changes since v1 are to commit message issues pointed out by\n> Felipe and a trivial whitespace change. I also updated the commit\n> message of 2/3 as he suggested to point out why the change is being\n> made.\n\nThis version looks good to me:\n\nReviewed-by: Felipe Contreras <felipe.contreras@gmail.com>\n\n-- \nFelipe Contreras"}]}