Module Name: src Committed By: rillig Date: Mon Feb 15 23:46:46 UTC 2021
Modified Files: src/distrib/sets: fmt-list Log Message: distrib/sets/fmt-list: document how to sort by directory first In lists/base/mi, the directory ./libdata/firmware contains several subdirectories for which the entries do not look aligned right now, even after normalizing the alignment. This is because the indentation for a directory is not determined globally for all directory entries from the complete file, but instead for each group of items, after sorting, that have the same directory. This results in several entries having only a single item per group, such as ./libdata/firmware/nouveau, and this single item is obviously consistently indented since all of its 1 lines are already indented to the same depth. One possible solution for this is to sort the entries in another order, keeping all entries from a directory together. This allows to quickly see all entries from a certain directory, but on the other hand, when adding a new directory plus some entries, the directory has to be listed far away from its entries. (This would be done automatically by fmt-list though, which weakens this argument a bit.) Another possible solution for this is to first determine the indentation for all entries from each directory, no matter how far these entries are apart, and then indent these entries to the common indentation. This may or may not help since there will still be single entries between groups of differently indented entries. Writing down the intuitive rules for how to align the entries properly is a nontrivial task. See pkglint/varalignblock, which is around 650 lines of code, plus around 4000 lines of test code. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/fmt-list Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.