Re: [PATCH v2 12/20] merge-ort: have process_entries operate in a defined order
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Nov 11, 2020, 16:09 UTC
- Message-ID
- <4432ae6c-90ae-90d9-218f-15856395efac@gmail.com>
- In-Reply-To
- <20201102204344.342633-13-newren@gmail.com>
On 11/2/2020 3:43 PM, Elijah Newren wrote:
Show 7 quoted lines
> We want to handle paths below a directory before needing to handle the > directory itself. Also, we want to handle the directory immediately > after the paths below it, so we can't use simple lexicographic ordering > from strcmp (which would insert foo.txt between foo and foo/file.c). > Copy string_list_df_name_compare() from merge-recursive.c, and set up a > string list of paths sorted by that function so that we can iterate in > the desired order.
This is at least the second time we've copied something from merge-recursive.c. Should we be starting a merge-utils.[c|h] to group these together under a common implementation?
> + /* Put every entry from paths into plist, then sort */
> strmap_for_each_entry(&opt->priv->paths, &iter, e) {
> + string_list_append(&plist, e->key)->util = e->value;
> + }nit: are braces required here?
-Stolee