Re: [GSoC PATCH v9 2/5] repo: add the field references.format
From: Junio C Hamano <hidden>
Date: 2025-08-11 15:44:33
Phillip Wood [off-list ref] writes:
Hi Lucas On 07/08/2025 16:02, Lucas Seiki Oshiro wrote:quoted
++ +The returned data is lexicographically sorted by the keys.What's the reason for this? If I query three keys from a script then it is much easier to parse the output if I know the keys are going to appear in the same order that they were on the command line. If the command re-orders them my script now has to check the value of each key which results in a bunch of unnecessary string comparisons because it cannot determine the key from the position in the output. While we were producing json output there was a need to de-duplicate the keys when that output format was selected. However, we no-longer produce json and in any case de-duplication could have been achieved without sorting the input keys by using a hash table, or, as there is a small fixed number of keys, an array that records the keys we've already seen.
Very good. Thanks.