On Thu, Oct 21, 2021 at 01:14:37AM +0200, Ævar Arnfjörð Bjarmason wrote: > Jeff: Just in terms of error prone both of these implementations will > accept bad input that's being caught in 8/8 of this series. > > We accept a lot of bad input now, ending up with some combinations of > bad output or compile errors if you screw with the input *.txt files. I > think I've addressed all of those in this series. I don't mind more error-checking, though TBH I don't find a huge value in it. But what I did mean was: > If you mean the general concept of making a "foo.gen" from a "foo.txt" > as an intermediate with make as a way to get to "many-foo.h" I don't > really see how it's error prone conceptually. You get error checking > each step of the way, and it encourages logic that's simpler each step > of the way. Yes. It just seems like the Makefile gets more complicated, and sometimes that can lead to subtle dependency issues (e.g., the ".build" dependency in the earlier iteration of the series). And in general I'd much rather debug an awk script than a Makefile. > Per Eric's Sunshine's upthread comments an awk and Perl implementation > were both considered before[1]. Ah sorry, I thought it was just a perl one that had been the show-stopper. I hadn't noticed the awk one. However, the point of my patch was to use perl if available, and fall back otherwise. Maybe that's too ugly, but it does address the concern with Eric's implementation. > I.e. I think if you e.g. touch Documentation/git-a*.txt with this series > with/without this awk version the difference in runtime is within the > error bars. I.e. making the loop faster isn't necessary. It's better to > get to a point where make can save you from doing all/most of the work > by checking modification times, rather than making an O(n) loop faster. FWIW, I don't agree with this paragraph at all. Parallelizing or reusing partial results is IMHO inferior to just making things faster. > I'm also interested in (and have WIP patches for) simplifying things > more generally in the Makefile. Once we have a file exploded out has > just the synopsis line that can be used to replace what's now in > Documentation/cmd-list.perl, i.e. those summary blurbs also end up in > "man git". > > There's subtle dependency issues there as well, and just having a > one-off solution for the the command-list.h doesn't get us closer to > addressing that sibling implementation. So I don't know what "subtle dependency issues" you found here, but this is exactly the kind of complexity it was my goal to avoid. -Peff