{"thread":{"id":"54252","subject":"[PATCH] cmake: ignore generated files","startedAt":"2020-09-17T20:37:50Z","lastAt":"2020-09-25T10:47:53Z","messageCount":22,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano","Johannes Schindelin","Đoàn Trần Công Danh","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"405800","messageId":"pull.735.git.1600375065498.gitgitgadget@gmail.com","threadId":"54252","inReplyTo":null,"subject":"[PATCH] cmake: ignore generated files","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-09-17T20:37:45Z","receivedAt":"2020-09-17T20:37:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nWhen using CMake to generate the files required to build Git in Visual\nStudio, a bunch of files are generated. We will want to prevent them\nfrom being tracked in Git.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    Ignore files generated by CMake\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-735%2Fdscho%2Fignore-generated-cmake-files-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-735/dscho/ignore-generated-cmake-files-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/735\n\n .gitignore | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/.gitignore b/.gitignore\nindex 9673e792db..36f5ac4138 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -239,3 +239,9 @@ Release/\n /git.VC.VC.opendb\n /git.VC.db\n *.dSYM\n+*.vcxproj\n+*.vcxproj.filters\n+/CMakeCache.txt\n+/CMakeFiles/\n+/*.cmake\n+/DartConfiguration.tcl\n\nbase-commit: 54e85e7af1ac9e9a92888060d6811ae767fea1bc\n-- \ngitgitgadget\n"},{"id":"405805","messageId":"xmqqtuvwoyz5.fsf@gitster.c.googlers.com","threadId":"54252","inReplyTo":"pull.735.git.1600375065498.gitgitgadget@gmail.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-17T21:49:34Z","receivedAt":"2020-09-17T21:49:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> When using CMake to generate the files required to build Git in Visual\n> Studio, a bunch of files are generated. We will want to prevent them\n> from being tracked in Git.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>     Ignore files generated by CMake\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-735%2Fdscho%2Fignore-generated-cmake-files-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-735/dscho/ignore-generated-cmake-files-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/735\n>\n>  .gitignore | 6 ++++++\n>  1 file changed, 6 insertions(+)\n>\n> diff --git a/.gitignore b/.gitignore\n> index 9673e792db..36f5ac4138 100644\n> --- a/.gitignore\n> +++ b/.gitignore\n> @@ -239,3 +239,9 @@ Release/\n>  /git.VC.VC.opendb\n>  /git.VC.db\n>  *.dSYM\n> +*.vcxproj\n> +*.vcxproj.filters\n> +/CMakeCache.txt\n> +/CMakeFiles/\n> +/*.cmake\n> +/DartConfiguration.tcl\n\nGood to catch these cruft.  \n\nDoes the equivalent of \"make distclean\" need to be updated to clean\nthem as well, or is it sufficient to ignore the build procedure and\njust rely on \"git clean -f -x\"?\n"},{"id":"405856","messageId":"nycvar.QRO.7.76.6.2009181510240.5061@tvgsbejvaqbjf.bet","threadId":"54252","inReplyTo":"xmqqtuvwoyz5.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-09-18T13:11:11Z","receivedAt":"2020-09-18T13:24:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Thu, 17 Sep 2020, Junio C Hamano wrote:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n> > From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> >\n> > When using CMake to generate the files required to build Git in Visual\n> > Studio, a bunch of files are generated. We will want to prevent them\n> > from being tracked in Git.\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >     Ignore files generated by CMake\n> >\n> > Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-735%2Fdscho%2Fignore-generated-cmake-files-v1\n> > Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-735/dscho/ignore-generated-cmake-files-v1\n> > Pull-Request: https://github.com/gitgitgadget/git/pull/735\n> >\n> >  .gitignore | 6 ++++++\n> >  1 file changed, 6 insertions(+)\n> >\n> > diff --git a/.gitignore b/.gitignore\n> > index 9673e792db..36f5ac4138 100644\n> > --- a/.gitignore\n> > +++ b/.gitignore\n> > @@ -239,3 +239,9 @@ Release/\n> >  /git.VC.VC.opendb\n> >  /git.VC.db\n> >  *.dSYM\n> > +*.vcxproj\n> > +*.vcxproj.filters\n> > +/CMakeCache.txt\n> > +/CMakeFiles/\n> > +/*.cmake\n> > +/DartConfiguration.tcl\n>\n> Good to catch these cruft.\n>\n> Does the equivalent of \"make distclean\" need to be updated to clean\n> them as well, or is it sufficient to ignore the build procedure and\n> just rely on \"git clean -f -x\"?\n\nSince CMake in conjunction with Visual Studio completely side-steps\n`make`, I think it would make most sense to ignore `make distclean` in\nthis context and go for `git clean -dfx` instead.\n\nCiao,\nDscho\n"},{"id":"405871","messageId":"xmqqft7fnlxr.fsf@gitster.c.googlers.com","threadId":"54252","inReplyTo":"nycvar.QRO.7.76.6.2009181510240.5061@tvgsbejvaqbjf.bet","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-18T15:28:48Z","receivedAt":"2020-09-18T15:28:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Good to catch these cruft.\n>>\n>> Does the equivalent of \"make distclean\" need to be updated to clean\n>> them as well, or is it sufficient to ignore the build procedure and\n>> just rely on \"git clean -f -x\"?\n>\n> Since CMake in conjunction with Visual Studio completely side-steps\n> `make`, I think it would make most sense to ignore `make distclean` in\n> this context and go for `git clean -dfx` instead.\n\nI think you misunderstood the question, overlooking the \"equivalent\"\npart.\n\nI expected that when CMake & VS discards build artifacts, it would\nnot make literal use of \"make distclean\".  After all, it does not\nuse \"make all\" to build, either.\n\nThat led me to suspect that CMake & VS may have a build target that\nis used to discard build artifacts, the moral equivalent to \"make\ndistclean\".  That is where my question \"if we are making .gitignore\naware of more crufts, don't we need to tell the machinery, which is\nequivalent to 'make disclean', came from.\n\nWhat I am hearing here is that people with CMake & VS use \"git clean\n-dfx\" when they want to go back to the pristine state, unlike those\nwho use \"make distclean\", and there is nothing to adjust for newly\ndiscovered crufts we are leaving on the filesystem.  \n\nIf that is the case, it is 100% fine.  It was that I just didn't\nexpect not having a \"remove cruft\" rule in the build procedure.\n\nThanks.\n\n"},{"id":"405874","messageId":"20200918155015.GA1837@danh.dev","threadId":"54252","inReplyTo":"xmqqft7fnlxr.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-09-18T15:50:15Z","receivedAt":"2020-09-18T15:50:19Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2020-09-18 08:28:48-0700, Junio C Hamano <gitster@pobox.com> wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> Good to catch these cruft.\n> >>\n> >> Does the equivalent of \"make distclean\" need to be updated to clean\n> >> them as well, or is it sufficient to ignore the build procedure and\n> >> just rely on \"git clean -f -x\"?\n> >\n> > Since CMake in conjunction with Visual Studio completely side-steps\n> > `make`, I think it would make most sense to ignore `make distclean` in\n> > this context and go for `git clean -dfx` instead.\n> \n> I think you misunderstood the question, overlooking the \"equivalent\"\n> part.\n> \n> I expected that when CMake & VS discards build artifacts, it would\n> not make literal use of \"make distclean\".  After all, it does not\n> use \"make all\" to build, either.\n\nActually, in CMake land, people usually do this instead:\n\n\tmkdir build\n\tcmake [-Ggenerator] ..\n\t<make/ninja/msbuild>\n\nThen, when they want to run something equivalent with make distclean,\nthey run:\n\n\tcd ..\n\trm -rf build\n\ninstead.\n\nThe change that Dscho suggested was meant for those people that run\nCMake in same directory of source dir, which is mostly discouraged\nin CMake land.\n\nIn additional, CMake's default Generator in *nix is Unix Makefiles,\nwhich will clash with our Makefile, and totally unsupported.\n\nI think the original CMake proposal didn't touch .gitignore because\nthey run in a separated build-dir.\n\n-- \nDanh\n"},{"id":"405876","messageId":"xmqq7dsrnjhi.fsf@gitster.c.googlers.com","threadId":"54252","inReplyTo":"20200918155015.GA1837@danh.dev","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-18T16:21:45Z","receivedAt":"2020-09-18T16:21:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n\n> Actually, in CMake land, people usually do this instead:\n>\n> \tmkdir build\n> \tcmake [-Ggenerator] ..\n> \t<make/ninja/msbuild>\n\nI presume you \"cd build\" between steps 1 & 2?  I take the \"people\nusually do\" is the best current practice?\n\n> Then, when they want to run something equivalent with make distclean,\n> they run:\n>\n> \tcd ..\n> \trm -rf build\n>\n> instead.\n>\n> The change that Dscho suggested was meant for those people that run\n> CMake in same directory of source dir, which is mostly discouraged\n> in CMake land.\n>\n> In additional, CMake's default Generator in *nix is Unix Makefiles,\n> which will clash with our Makefile, and totally unsupported.\n\nI recall that our CMakeLists file asks the top-level Makefile about\nbasic things so that we do not have to duplicate \"list of files\"\netc.  in places, so I can understand that it would lead to a\ndisaster to do \"cmake -Ggenerator\" at the top-level.\n\n> I think the original CMake proposal didn't touch .gitignore because\n> they run in a separated build-dir.\n\nIf so, not only my \"do we need a matching change to CMakeLists to\nteach how to clean crufts?\" becomes unnecessary, but the original\npatch that started this thread to touch .gitignore at the top level,\ndoes, too.\n\nI wonder what led Dscho not to follow the \"create a 'build' dir and\ndo things there\" practice.  Judging from the fact that the \"because\nthey run in a separate build directory\" assumption did not hold to\nsomebody as experienced as Dscho, it is likely others would do the\nsame.\n\nWhat can we do to make it easier for people to discover and follow\nthe best current practice?  Are there things in our build\ninstruction document (e.g. the comment at the top of CMakeLists.txt)\nthat needs updating?\n\nThanks.\n"},{"id":"405924","messageId":"20200919004030.GB1837@danh.dev","threadId":"54252","inReplyTo":"xmqq7dsrnjhi.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-09-19T00:40:30Z","receivedAt":"2020-09-19T00:40:35Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2020-09-18 09:21:45-0700, Junio C Hamano <gitster@pobox.com> wrote:\n> Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n> \n> > Actually, in CMake land, people usually do this instead:\n> >\n> > \tmkdir build\n> > \tcmake [-Ggenerator] ..\n> > \t<make/ninja/msbuild>\n> \n> I presume you \"cd build\" between steps 1 & 2?\n\nOpps, yes, there is a \"cd build\" there, and it should be:\n\n\tcmake [-G<generator>] ..\n\n<generator> is the target build system, default to \"Unix Makefiles\"\nin *nix land.\n\n> I take the \"people usually do\" is the best current practice?\n\nI would say it's the best practice. It's recommended in cmake official\nguide (although, they don't write the word \"best practice\") [1]\n\n\tIt is recommended to build in a separate directory to the\n\tsource because that keeps the source directory pristine,\n\tallows for building a single source with multiple toolchains,\n\tand allows easy clearing of build artifacts by simply deleting\n\tthe build directory.\n\n> \n> > Then, when they want to run something equivalent with make distclean,\n> > they run:\n> >\n> > \tcd ..\n> > \trm -rf build\n> >\n> > instead.\n> >\n> > The change that Dscho suggested was meant for those people that run\n> > CMake in same directory of source dir, which is mostly discouraged\n> > in CMake land.\n> >\n> > In additional, CMake's default Generator in *nix is Unix Makefiles,\n> > which will clash with our Makefile, and totally unsupported.\n> \n> I recall that our CMakeLists file asks the top-level Makefile about\n> basic things so that we do not have to duplicate \"list of files\"\n> etc.  in places, so I can understand that it would lead to a\n> disaster to do \"cmake -Ggenerator\" at the top-level.\n\nYes, and in some first iteration, the proposal didn't check for\nbuilddir != sourcedir when -G\"Unix Makefiles\", which was corrected later.\n\nI haven't checked, but I could imagine that \"cmake -Gninja\" at top-level\nsourcedir should work without problems, though.\n\n> > I think the original CMake proposal didn't touch .gitignore because\n> > they run in a separated build-dir.\n> \n> If so, not only my \"do we need a matching change to CMakeLists to\n> teach how to clean crufts?\" becomes unnecessary, but the original\n> patch that started this thread to touch .gitignore at the top level,\n> does, too.\n> \n> I wonder what led Dscho not to follow the \"create a 'build' dir and\n> do things there\" practice.  Judging from the fact that the \"because\n> they run in a separate build directory\" assumption did not hold to\n> somebody as experienced as Dscho, it is likely others would do the\n> same.\n> \n> What can we do to make it easier for people to discover and follow\n> the best current practice?  Are there things in our build\n> instruction document (e.g. the comment at the top of CMakeLists.txt)\n> that needs updating?\n\nI think Sibi had done a lot of good work to write instruction at the\ntop of CMakeLists.txt, I guess it's a bit too much instruction.\nThe instruction for out of source build was written after the\ninstruction to build in-tree.\n\nShould we change the order?  I don't really know.\n\nI only tried to build Git with CMake only one during the review process.\nAnd haven't touched it ever since.\n\n1: https://cmake.org/cmake/help/v3.18/guide/user-interaction/index.html#command-line-cmake-tool\n\n-- \nDanh\n"},{"id":"405925","messageId":"xmqq1riylhcu.fsf@gitster.c.googlers.com","threadId":"54252","inReplyTo":"20200919004030.GB1837@danh.dev","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-19T00:50:41Z","receivedAt":"2020-09-19T00:50:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n\n>> What can we do to make it easier for people to discover and follow\n>> the best current practice?  Are there things in our build\n>> instruction document (e.g. the comment at the top of CMakeLists.txt)\n>> that needs updating?\n>\n> I think Sibi had done a lot of good work to write instruction at the\n> top of CMakeLists.txt, I guess it's a bit too much instruction.\n> The instruction for out of source build was written after the\n> instruction to build in-tree.\n>\n> Should we change the order?  I don't really know.\n\nOh, absolutely.  \n\nIt begins with\n\n    cmake `relative-path-to-CMakeLists.txt` -DCMAKE_BUILD_TYPE=Release\n    Eg.\n    From the root of git source tree\n            `cmake contrib/buildsystems/ `\n    This will build the git binaries at the root\n\nwhich tells exactly what Dscho did and got him writing the patch in\nquestion.  You'd need to keep reading to be merely _aware_ that it\nis possible to do an out-of-tree build, without getting even told\nthat it is the norm in CMake land.\n\nWe should just remove the above and start the comment seciton with\nsomething more like this:\n\n    When using CMake, building in place is highly discouraged.\n    Instead, create a new \"git-build\" directory and perform your\n    build there, like this (from the top of the working tree):\n\n            $ mkdir git-build\n            $ cd git-build\n            $ cmake ../contrib/buildsystems/ -DCMAKE_BUILD_TYPER=Release\n\n    This will build the git binaries in git-build directory\n\nDoing so would reduce the number of choices the user has to make,\nand reduce the confusion.\n\nThanks.\n"},{"id":"406095","messageId":"nycvar.QRO.7.76.6.2009201914330.5061@tvgsbejvaqbjf.bet","threadId":"54252","inReplyTo":"xmqqft7fnlxr.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-09-20T17:15:01Z","receivedAt":"2020-09-21T22:30:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Fri, 18 Sep 2020, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> >> Good to catch these cruft.\n> >>\n> >> Does the equivalent of \"make distclean\" need to be updated to clean\n> >> them as well, or is it sufficient to ignore the build procedure and\n> >> just rely on \"git clean -f -x\"?\n> >\n> > Since CMake in conjunction with Visual Studio completely side-steps\n> > `make`, I think it would make most sense to ignore `make distclean` in\n> > this context and go for `git clean -dfx` instead.\n>\n> I think you misunderstood the question, overlooking the \"equivalent\"\n> part.\n>\n> I expected that when CMake & VS discards build artifacts, it would\n> not make literal use of \"make distclean\".  After all, it does not\n> use \"make all\" to build, either.\n>\n> That led me to suspect that CMake & VS may have a build target that\n> is used to discard build artifacts, the moral equivalent to \"make\n> distclean\".  That is where my question \"if we are making .gitignore\n> aware of more crufts, don't we need to tell the machinery, which is\n> equivalent to 'make disclean', came from.\n>\n> What I am hearing here is that people with CMake & VS use \"git clean\n> -dfx\" when they want to go back to the pristine state, unlike those\n> who use \"make distclean\", and there is nothing to adjust for newly\n> discovered crufts we are leaving on the filesystem.\n\nYes, that is my understanding.\n\n> If that is the case, it is 100% fine.  It was that I just didn't\n> expect not having a \"remove cruft\" rule in the build procedure.\n\nThanks,\nDscho\n"},{"id":"406099","messageId":"xmqqr1qud9zl.fsf@gitster.c.googlers.com","threadId":"54252","inReplyTo":"nycvar.QRO.7.76.6.2009201914330.5061@tvgsbejvaqbjf.bet","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-21T22:46:06Z","receivedAt":"2020-09-21T22:46:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> What I am hearing here is that people with CMake & VS use \"git clean\n>> -dfx\" when they want to go back to the pristine state, unlike those\n>> who use \"make distclean\", and there is nothing to adjust for newly\n>> discovered crufts we are leaving on the filesystem.\n>\n> Yes, that is my understanding.\n\nI do not know if you have read other messages in the thread, but my\ncurrent understanding of what we learned in this thread [*1*] is\nthat those who use CMake, especially in a tree like ours that has\nits own Makefiles, (sh|w)ould create a throw-away directory and run\nbuild there, so even \"git clean -dxf\" is not part of their \"clean\"\nprocedure.\n\n\n[Footnote]\n\n*1* https://lore.kernel.org/git/20200919004030.GB1837@danh.dev/\n"},{"id":"406101","messageId":"nycvar.QRO.7.76.6.2009201916040.5061@tvgsbejvaqbjf.bet","threadId":"54252","inReplyTo":"xmqq7dsrnjhi.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-09-20T17:37:41Z","receivedAt":"2020-09-21T22:52:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Fri, 18 Sep 2020, Junio C Hamano wrote:\n\n> Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n>\n> > Actually, in CMake land, people usually do this instead:\n> >\n> > \tmkdir build\n> > \tcmake [-Ggenerator] ..\n> > \t<make/ninja/msbuild>\n>\n> I presume you \"cd build\" between steps 1 & 2?  I take the \"people\n> usually do\" is the best current practice?\n>\n> > Then, when they want to run something equivalent with make distclean,\n> > they run:\n> >\n> > \tcd ..\n> > \trm -rf build\n> >\n> > instead.\n> >\n> > The change that Dscho suggested was meant for those people that run\n> > CMake in same directory of source dir, which is mostly discouraged\n> > in CMake land.\n\nIt is discouraged, but not disallowed.\n\n> > In additional, CMake's default Generator in *nix is Unix Makefiles,\n> > which will clash with our Makefile, and totally unsupported.\n>\n> I recall that our CMakeLists file asks the top-level Makefile about\n> basic things so that we do not have to duplicate \"list of files\"\n> etc.  in places, so I can understand that it would lead to a\n> disaster to do \"cmake -Ggenerator\" at the top-level.\n\nIndeed, when asking CMake to generate a Makefile twice, there will be a\nproblem.\n\nBut so far, we successfully resisted making the CMake support powerful\nenough to support anything but Windows and Visual C.\n\n> > I think the original CMake proposal didn't touch .gitignore because\n> > they run in a separated build-dir.\n>\n> If so, not only my \"do we need a matching change to CMakeLists to\n> teach how to clean crufts?\" becomes unnecessary, but the original\n> patch that started this thread to touch .gitignore at the top level,\n> does, too.\n>\n> I wonder what led Dscho not to follow the \"create a 'build' dir and\n> do things there\" practice.  Judging from the fact that the \"because\n> they run in a separate build directory\" assumption did not hold to\n> somebody as experienced as Dscho, it is likely others would do the\n> same.\n\nThat's because Dscho does not like the separate build directory, even if\nthey know that in the CMake world, it is kind of expected.\n\nIt's just that it would be super convenient for Visual Studio users to\njust generate their project files in-place. That's why I started down that\nroad.\n\n> What can we do to make it easier for people to discover and follow\n> the best current practice?  Are there things in our build\n> instruction document (e.g. the comment at the top of CMakeLists.txt)\n> that needs updating?\n\nIdeally, we would tell Visual Studio users to \"just install CMake, start\nits GUI, direct it to the Git source, configure and generate\". Alas, it is\nnot that easy:\n\n- The `SH_EXE` is not found by default (`C:\\Program Files\\Git\\bin\\sh.exe`\n  should be used in the vast majority of the cases),\n- If the build directory is left unspecified, the non-writable `C:\\Program\n  Files\\CMake\\bin` directory is used,\n- The `compat\\vcbuild\\vcpkg` system is not initialized automatically, and\n  even if the user initialized it, the dependencies (such as expat, zlib)\n  are still not found.\n\nI would like to make things easier, and forcing users to use a separate\nbuild directory (that needs to be outside of the Git source tree because\nour `.gitignore` does not handle it well) would go the other direction, I\nfear.\n\nIn short: this `.gitignore` is but one small step in the endeavor to make\nit more convenient for Visual Studio users to contribute.\n\nCiao,\nDscho\n"},{"id":"406196","messageId":"xmqqr1qsjxgb.fsf@gitster.c.googlers.com","threadId":"54252","inReplyTo":"nycvar.QRO.7.76.6.2009201916040.5061@tvgsbejvaqbjf.bet","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-23T15:59:32Z","receivedAt":"2020-09-23T15:59:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> > The change that Dscho suggested was meant for those people that run\n>> > CMake in same directory of source dir, which is mostly discouraged\n>> > in CMake land.\n>\n> It is discouraged, but not disallowed.\n> ...\n>> > I think the original CMake proposal didn't touch .gitignore because\n>> > they run in a separated build-dir.\n>>\n>> If so, not only my \"do we need a matching change to CMakeLists to\n>> teach how to clean crufts?\" becomes unnecessary, but the original\n>> patch that started this thread to touch .gitignore at the top level,\n>> does, too.\n>>\n>> I wonder what led Dscho not to follow the \"create a 'build' dir and\n>> do things there\" practice.  Judging from the fact that the \"because\n>> they run in a separate build directory\" assumption did not hold to\n>> somebody as experienced as Dscho, it is likely others would do the\n>> same.\n>\n> That's because Dscho does not like the separate build directory, even if\n> they know that in the CMake world, it is kind of expected.\n\nSorry, but that does not sound like a convincing excuse because ...\n\n> It's just that it would be super convenient for Visual Studio users to\n> just generate their project files in-place. That's why I started down that\n> road.\n> ...\n> Ideally, we would tell Visual Studio users to \"just install CMake, start\n> its GUI, direct it to the Git source, configure and generate\". Alas, it is\n> not that easy:\n>\n> - The `SH_EXE` is not found by default (`C:\\Program Files\\Git\\bin\\sh.exe`\n>   should be used in the vast majority of the cases),\n> - If the build directory is left unspecified, the non-writable `C:\\Program\n>   Files\\CMake\\bin` directory is used,\n> - The `compat\\vcbuild\\vcpkg` system is not initialized automatically, and\n>   even if the user initialized it, the dependencies (such as expat, zlib)\n>   are still not found.\n\n... if the build directory needs to be specified anyway, there don't\nseem to be a big difference between telling them to create an empty\nbuild place and use it and telling them to point at the source tree\nitself, so ...\n\n> I would like to make things easier, and forcing users to use a separate\n> build directory (that needs to be outside of the Git source tree because\n> our `.gitignore` does not handle it well) would go the other direction, I\n> fear.\n\n... the above sounds like the argument concentrates too much on\nwhere the build directory is (i.e. between \"in place\" and \"a\nthrow-away directory next door\"), which sounds like much smaller\npoint compared to the other things that needs to be improved in the\nVS users.  And making a choice against what is recommended as best\npractice...?  I dunno.\n\n"},{"id":"406204","messageId":"nycvar.QRO.7.76.6.2009231502430.5061@tvgsbejvaqbjf.bet","threadId":"54252","inReplyTo":"xmqqr1qud9zl.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-09-23T13:08:26Z","receivedAt":"2020-09-23T17:10:58Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Mon, 21 Sep 2020, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> >> What I am hearing here is that people with CMake & VS use \"git clean\n> >> -dfx\" when they want to go back to the pristine state, unlike those\n> >> who use \"make distclean\", and there is nothing to adjust for newly\n> >> discovered crufts we are leaving on the filesystem.\n> >\n> > Yes, that is my understanding.\n>\n> I do not know if you have read other messages in the thread,\n\nI did.\n\n> but my current understanding of what we learned in this thread [*1*] is\n> that those who use CMake, especially in a tree like ours that has its\n> own Makefiles, (sh|w)ould create a throw-away directory and run build\n> there, so even \"git clean -dxf\" is not part of their \"clean\" procedure.\n\nWell, our CMake support does not extend to generating Makefiles: we\nspecifically target only Windows withour CMake support, and since there is\nno need to help developers who already use the Git for Windows SDK or\nCygwin, we really focus only on supporting Visual Studio.\n\nIn that respect, I think that all that talk about Makefiles isn't quite\nspot on.\n\nIn any case, `git clean -dfx` strikes me as a perfectly acceptable\nequivalent of `make clean` when no `make` is available, as is the case in\nVisual Studio's case.\n\nCiao,\nDscho\n\n> [Footnote]\n>\n> *1* https://lore.kernel.org/git/20200919004030.GB1837@danh.dev/\n>\n"},{"id":"406206","messageId":"xmqqsgb8idvv.fsf@gitster.c.googlers.com","threadId":"54252","inReplyTo":"pull.735.git.1600375065498.gitgitgadget@gmail.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-23T17:47:32Z","receivedAt":"2020-09-23T17:47:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> When using CMake to generate the files required to build Git in Visual\n> Studio, a bunch of files are generated. We will want to prevent them\n> from being tracked in Git.\n\nIf we were to go this route, let's\n\n * update the log message to say that we assume we will use CMake to\n   build in-place.\n\n * update the comment in the top part of the CMakeList.txt that\n   suggests it is a possibility to use it from subdirectories.\n\n * optionally, update the same comment to recommend \"clean -xdf\"\n   as a way to bring the source tree back to the pristine state.\n\nWill queue with a tentative attempt to do the first bullet point to\nsave one roundtip, something like:\n\n    When using CMake to generate the files required to build Git\n    in-place for Visual Studio, ...\n\nOther two points needs help from others (iow, I won't do so myself\nright now).\n\nThanks.\n"},{"id":"406207","messageId":"xmqqo8lwidly.fsf@gitster.c.googlers.com","threadId":"54252","inReplyTo":"xmqqsgb8idvv.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-23T17:53:29Z","receivedAt":"2020-09-23T17:53:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n>> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>>\n>> When using CMake to generate the files required to build Git in Visual\n>> Studio, a bunch of files are generated. We will want to prevent them\n>> from being tracked in Git.\n>\n> If we were to go this route, let's\n>\n>  * update the log message to say that we assume we will use CMake to\n>    build in-place.\n>\n>  * update the comment in the top part of the CMakeList.txt that\n>    suggests it is a possibility to use it from subdirectories.\n\nSorry, sent too soon.  Either s/update/remove/, or to say that\nthis project assume things are built in-place.\n\n>  * optionally, update the same comment to recommend \"clean -xdf\"\n>    as a way to bring the source tree back to the pristine state.\n>\n> Will queue with a tentative attempt to do the first bullet point to\n> save one roundtip, something like:\n>\n>     When using CMake to generate the files required to build Git\n>     in-place for Visual Studio, ...\n>\n> Other two points needs help from others (iow, I won't do so myself\n> right now).\n>\n> Thanks.\n"},{"id":"406217","messageId":"nycvar.QRO.7.76.6.2009232224410.5061@tvgsbejvaqbjf.bet","threadId":"54252","inReplyTo":"xmqqr1qsjxgb.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-09-23T20:27:17Z","receivedAt":"2020-09-23T20:27:35Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 23 Sep 2020, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> >> > The change that Dscho suggested was meant for those people that run\n> >> > CMake in same directory of source dir, which is mostly discouraged\n> >> > in CMake land.\n> >\n> > It is discouraged, but not disallowed.\n> > ...\n> >> > I think the original CMake proposal didn't touch .gitignore because\n> >> > they run in a separated build-dir.\n> >>\n> >> If so, not only my \"do we need a matching change to CMakeLists to\n> >> teach how to clean crufts?\" becomes unnecessary, but the original\n> >> patch that started this thread to touch .gitignore at the top level,\n> >> does, too.\n> >>\n> >> I wonder what led Dscho not to follow the \"create a 'build' dir and\n> >> do things there\" practice.  Judging from the fact that the \"because\n> >> they run in a separate build directory\" assumption did not hold to\n> >> somebody as experienced as Dscho, it is likely others would do the\n> >> same.\n> >\n> > That's because Dscho does not like the separate build directory, even if\n> > they know that in the CMake world, it is kind of expected.\n>\n> Sorry, but that does not sound like a convincing excuse because ...\n>\n> > It's just that it would be super convenient for Visual Studio users to\n> > just generate their project files in-place. That's why I started down that\n> > road.\n> > ...\n> > Ideally, we would tell Visual Studio users to \"just install CMake, start\n> > its GUI, direct it to the Git source, configure and generate\". Alas, it is\n> > not that easy:\n> >\n> > - The `SH_EXE` is not found by default (`C:\\Program Files\\Git\\bin\\sh.exe`\n> >   should be used in the vast majority of the cases),\n> > - If the build directory is left unspecified, the non-writable `C:\\Program\n> >   Files\\CMake\\bin` directory is used,\n> > - The `compat\\vcbuild\\vcpkg` system is not initialized automatically, and\n> >   even if the user initialized it, the dependencies (such as expat, zlib)\n> >   are still not found.\n>\n> ... if the build directory needs to be specified anyway, there don't\n\nIt doesn't need to be specified.\n\n> seem to be a big difference between telling them to create an empty\n> build place and use it and telling them to point at the source tree\n> itself, so ...\n>\n> > I would like to make things easier, and forcing users to use a separate\n> > build directory (that needs to be outside of the Git source tree because\n> > our `.gitignore` does not handle it well) would go the other direction, I\n> > fear.\n>\n> ... the above sounds like the argument concentrates too much on\n> where the build directory is (i.e. between \"in place\" and \"a\n> throw-away directory next door\"), which sounds like much smaller\n> point compared to the other things that needs to be improved in the\n> VS users.  And making a choice against what is recommended as best\n> practice...?  I dunno.\n\nAll I want is for the CMake support to be easier to use, yet we go in the\nopposite direction: instead of allowing to use CMake under more\ncircumstances (which actually *works*, we just don't have the appropriate\npatterns in our `.gitignore` yet to avoid adding and committing the\ngenerated files), we now seem to intend to require a separate build\ndirectory.\n\nThat's the opposite direction of making things more convenient for Visual\nStudio users.\n\nCiao,\nDscho\n"},{"id":"406219","messageId":"xmqqft78i5zd.fsf@gitster.c.googlers.com","threadId":"54252","inReplyTo":"nycvar.QRO.7.76.6.2009232224410.5061@tvgsbejvaqbjf.bet","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-23T20:38:14Z","receivedAt":"2020-09-23T20:38:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> All I want is for the CMake support to be easier to use, yet we go in the\n> opposite direction: instead of allowing to use CMake under more\n> circumstances (which actually *works*, we just don't have the appropriate\n\nNot, \"more\", but what you are doing is to ensure it is used at only\none single place, which is the top-level (and nowhere else, judging\nfrom the .gitignore additions).\n\nAnd that is fine---if you were to add .gitignore entries, you cannot\nleave it up to the end-users where the build happens.\n  \nSo, let's not pretend that you are allowing \"more circumstances\".\nForcing a single choice to make things predictable is fine, but\nlet's explain it as such, so that people won't be confused into\nthinking that they can follow their experiences gained from using\nCMake in other projects that lets them build in a separate\ndirectory.  The other things in our project, including the\npatterns added to .gitignore with the patch in question, are not set\nup to allow that.\n\n"},{"id":"406245","messageId":"20200924091901.GA24954@szeder.dev","threadId":"54252","inReplyTo":"nycvar.QRO.7.76.6.2009231502430.5061@tvgsbejvaqbjf.bet","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2020-09-24T09:19:01Z","receivedAt":"2020-09-24T09:19:10Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Wed, Sep 23, 2020 at 03:08:26PM +0200, Johannes Schindelin wrote:\n> In any case, `git clean -dfx` strikes me as a perfectly acceptable\n> equivalent of `make clean` when no `make` is available, as is the case in\n> Visual Studio's case.\n\nNot at all: 'make (dist)clean' only removes build artifacts and leaves\nuntracked files intact, while 'git clean -dfx' removes untracked files\nas well, so using the latter instead of the former might easily lead to\ndata loss.\n\n"},{"id":"406251","messageId":"20200924103437.GA18952@danh.dev","threadId":"54252","inReplyTo":"nycvar.QRO.7.76.6.2009232224410.5061@tvgsbejvaqbjf.bet","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-09-24T10:34:37Z","receivedAt":"2020-09-24T10:34:42Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"Hi Dscho,\n\nOn 2020-09-23 22:27:17+0200, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > ... the above sounds like the argument concentrates too much on\n> > where the build directory is (i.e. between \"in place\" and \"a\n> > throw-away directory next door\"), which sounds like much smaller\n> > point compared to the other things that needs to be improved in the\n> > VS users.  And making a choice against what is recommended as best\n> > practice...?  I dunno.\n> \n> All I want is for the CMake support to be easier to use, yet we go in the\n> opposite direction: instead of allowing to use CMake under more\n> circumstances (which actually *works*, we just don't have the appropriate\n> patterns in our `.gitignore` yet to avoid adding and committing the\n> generated files), we now seem to intend to require a separate build\n> directory.\n\nI've left Windows development land for a long time.\nSo, please take below discussion with grain of salt.\n\nWhen I was there, CMake Users on Windows mostly used CMake-GUI to\ngenerate build system for CMake since running CMake as CLI in Windows\ntakes too much hassle.\n\nWhen I was there, CMake-GUI shows the option to choose build directories\nexplicitly, and whenever the source directories changed, the build\ndirectories also changed, with some [-/]build added into sourcedir [1]\n\nI heard that nowaday, CMake is supported natively with MSVC, I don't\nknow what is the default option when using CMake with MSVC, but from\nthe history of MSVC always supports building out of tree, and\ninformation for Microsoft Docs [2]:\n\n\tClick the Show All Files button at the top of Solution\n\tExplorer to see all the CMake-generated output in the\n\tout/build/<config> folders.\n\nI think the default UX with CMake on Windows is building project out\nof tree.\n\n> That's the opposite direction of making things more convenient for Visual\n> Studio users.\n\nSo, I don't think we would provide them more convenient with this change.\n\n\n1: https://cmake.org/runningcmake/\n2: https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=vs-2019\n\n-- \nDanh\n"},{"id":"406272","messageId":"xmqqblhvgkwk.fsf@gitster.c.googlers.com","threadId":"54252","inReplyTo":"20200924091901.GA24954@szeder.dev","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-09-24T17:11:07Z","receivedAt":"2020-09-24T17:11:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"SZEDER Gábor <szeder.dev@gmail.com> writes:\n\n> On Wed, Sep 23, 2020 at 03:08:26PM +0200, Johannes Schindelin wrote:\n>> In any case, `git clean -dfx` strikes me as a perfectly acceptable\n>> equivalent of `make clean` when no `make` is available, as is the case in\n>> Visual Studio's case.\n>\n> Not at all: 'make (dist)clean' only removes build artifacts and leaves\n> untracked files intact, while 'git clean -dfx' removes untracked files\n> as well, so using the latter instead of the former might easily lead to\n> data loss.\n\nWell, with the patch in question applied, \"git clean -f\" would be usable\nas a poor-man's replacement that removes \"ignored and expendable\" paths\nthat match patterns listed in the file, so...\n"},{"id":"406317","messageId":"nycvar.QRO.7.76.6.2009250650280.5061@tvgsbejvaqbjf.bet","threadId":"54252","inReplyTo":"20200924103437.GA18952@danh.dev","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-09-25T05:02:10Z","receivedAt":"2020-09-25T09:09:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Danh,\n\nOn Thu, 24 Sep 2020, Đoàn Trần Công Danh wrote:\n\n> On 2020-09-23 22:27:17+0200, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > > ... the above sounds like the argument concentrates too much on\n> > > where the build directory is (i.e. between \"in place\" and \"a\n> > > throw-away directory next door\"), which sounds like much smaller\n> > > point compared to the other things that needs to be improved in the\n> > > VS users.  And making a choice against what is recommended as best\n> > > practice...?  I dunno.\n> >\n> > All I want is for the CMake support to be easier to use, yet we go in the\n> > opposite direction: instead of allowing to use CMake under more\n> > circumstances (which actually *works*, we just don't have the appropriate\n> > patterns in our `.gitignore` yet to avoid adding and committing the\n> > generated files), we now seem to intend to require a separate build\n> > directory.\n>\n> I've left Windows development land for a long time.\n> So, please take below discussion with grain of salt.\n>\n> When I was there, CMake Users on Windows mostly used CMake-GUI to\n> generate build system for CMake since running CMake as CLI in Windows\n> takes too much hassle.\n>\n> When I was there, CMake-GUI shows the option to choose build directories\n> explicitly, and whenever the source directories changed, the build\n> directories also changed, with some [-/]build added into sourcedir [1]\n\nIn my tests, the build directory was left empty. When I clicked the button\nnext to it, it defaulted to the same directory as `CMakeLists.txt`:\n`contrib/buildsystems/`.\n\nI might be holding this thing wrong, but if I don't, then we would\nactually have to add a _different_ set of patterns to `.gitignore`.\n\n> I heard that nowaday, CMake is supported natively with MSVC, I don't\n> know what is the default option when using CMake with MSVC, but from\n> the history of MSVC always supports building out of tree, and\n> information for Microsoft Docs [2]:\n>\n> \tClick the Show All Files button at the top of Solution\n> \tExplorer to see all the CMake-generated output in the\n> \tout/build/<config> folders.\n\nOh wow, I missed this. And it looks promising: when I open a fresh\ncheckout of current git/git's `master` branch in a freshly updated Visual\nStudio 2019, it finds the CMakeLists.txt file automatically.\n\nBut that's where the happy news end: it stops with the error message:\n\nCMake Error at [...]\\contrib\\buildsystems\\CMakeLists.txt:46 (message):\n  sh: shell interpreter was not found in your path, please install one.On\n  Windows, you can get it as part of 'Git for Windows' install at\n  https://gitforwindows.org/\tgit\n[...]\\contrib\\buildsystems\\CMakeLists.txt\t46\n\nSo there's a bit of work left to do for me.\n\n> I think the default UX with CMake on Windows is building project out\n> of tree.\n\nIndeed, it _does_ create `contrib/buildsystems/out/` and starts outputting\nfiles to `contrib/buildsystems/out/build/x64-Debug (default)/`.\n\nSeeing as using Visual Studio's built-in CMake support is much more\nconvenient to use than a separate CMake installation, I reconsidered my\noriginal idea, and now think that y'all are right, my current patch isn't\nthe best way forward. I'll rework the patch into a proper patch series\nthat takes into account what I learned today.\n\n> > That's the opposite direction of making things more convenient for Visual\n> > Studio users.\n>\n> So, I don't think we would provide them more convenient with this change.\n\nIndeed. And more convenience is what I want, I don't want developers on\nWindows to struggle with the tooling when all they want to do is to\ncontribute to Git.\n\nThank you,\nDscho\n\n>\n>\n> 1: https://cmake.org/runningcmake/\n> 2: https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=vs-2019\n>\n> --\n> Danh\n>\n"},{"id":"406319","messageId":"nycvar.QRO.7.76.6.2009250808000.5061@tvgsbejvaqbjf.bet","threadId":"54252","inReplyTo":"xmqqft78i5zd.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] cmake: ignore generated files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-09-25T06:40:20Z","receivedAt":"2020-09-25T10:47:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 23 Sep 2020, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> > All I want is for the CMake support to be easier to use, yet we go in the\n> > opposite direction: instead of allowing to use CMake under more\n> > circumstances (which actually *works*, we just don't have the appropriate\n>\n> Not, \"more\", but what you are doing is to ensure it is used at only\n> one single place, which is the top-level (and nowhere else, judging\n> from the .gitignore additions).\n>\n> And that is fine---if you were to add .gitignore entries, you cannot\n> leave it up to the end-users where the build happens.\n>\n> So, let's not pretend that you are allowing \"more circumstances\".\n> Forcing a single choice to make things predictable is fine, but\n> let's explain it as such, so that people won't be confused into\n> thinking that they can follow their experiences gained from using\n> CMake in other projects that lets them build in a separate\n> directory.  The other things in our project, including the\n> patterns added to .gitignore with the patch in question, are not set\n> up to allow that.\n\nWhile I respectfully disagree that I force a single choice on anybody, I\ndo agree that there is value in having one recommended route that is well\nsupported.\n\nThanks,\nDscho\n"}]}