Re: [PATCH 22/48] merge-recursive: Fix sorting order and directory change assumptions
- From
Elijah Newren <newren@gmail.com>
- Date
- Aug 8, 2011, 19:21 UTC
- Message-ID
- <CABPp-BEBFa9vKcKBehq9gV+S1WW+0L+8XZ2+jHdiXsqBp4k+uA@mail.gmail.com>
- In-Reply-To
- <7vhb6jcg68.fsf@alter.siamese.dyndns.org>
On Mon, Jul 18, 2011 at 5:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
>> +static int string_list_df_name_compare(const void *a, const void *b)
>> +{
>> + const struct string_list_item *one = a;
>> + const struct string_list_item *two = b;
>> + /*
>> + * Here we only care that entries for D/F conflicts are
>> + * adjacent, in particular with the file of the D/F conflict
>> + * appearing before files below the corresponding directory.
>> + * The order of the rest of the list is irrelevant for us.
>> + *
>> + * To achieve this, we sort with df_name_compare and provide
>> + * the mode S_IFDIR so that D/F conflicts will sort correctly.
>> + * We use the mode S_IFDIR for everything else for simplicity,
>> + * since in other cases any changes in their order due to
>> + * sorting cause no problems for us.
>> + */
>
> I recall there was an issue of this sorting reported earlier...Yes, in git-fast-export, though. It was 060df62 (fast-export: Fix output order of D/F changes 2010-07-09), if you're curious.