]> Kevux Git Server - rit/commit
help: cleanup the contruction of keys_uniq
authorAmisha Chhajed <amishhhaaaa@gmail.com>
Wed, 11 Mar 2026 19:24:53 +0000 (00:54 +0530)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Mar 2026 19:44:44 +0000 (12:44 -0700)
commit088e994bf62a8135b87615c3e786958b397a9fd7
tree00ddd97d11b45bfeef90140485ce95e42018f859
parent7c02d39fc2ed2702223c7674f73150d9a7e61ba4
help: cleanup the contruction of keys_uniq

construction of keys_uniq depends on sort operation
executed on keys before processing, which does not
gurantee that keys_uniq will be sorted.

refactor the code to shift the sort operation after
the processing to remove dependency on key's sort operation
and strictly maintain the sorted order of keys_uniq.

move strbuf init and release out of loop to reuse same buffer.

dedent sort -u and sed in tests and replace grep with sed, to
avoid piping grep's output to sed.

Suggested-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Signed-off-by: Amisha Chhajed <amishhhaaaa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/help.c
t/t0012-help.sh