mirror of
https://github.com/git/git.git
synced 2026-02-27 18:29:43 +00:00
Fix a formatting regression in1b81d8cb19(help: use command-list.txt for the source of guides, 2018-05-20). Adjust the output of "git help --guides" and any other future single-section commands so that a newline isn't inserted before the only section being printed. This changes the output from: $ git help --guides The Git concept guides are: [...] To: $ git help --guides The Git concept guides are: [...] That we started printing an extra "\n" in1b81d8cb19wasn't intended, but an emergent effect of moving all of the printing of "git help" output to code that was ready to handle printing N sections. With1b81d8cb19we started using the "print_cmd_by_category()" function added earlier in the same series, or incfb22a02ab(help: use command-list.h for common command list, 2018-05-10). Fixing this formatting nit is easy enough. Let's have all of the output that would like to be "\n"-separated from other lines emit its own "\n". We then adjust "print_cmd_by_category()" to only print a "\n" to delimit the sections it's printing out. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 KiB
20 KiB