Re: [PATCH v2 02/10] merge-ort: add a special minimal index just for renormalization
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Mar 11, 2021, 14:48 UTC
- Message-ID
- <10b30844-2e4c-157f-b4c6-5e4890e18858@gmail.com>
- In-Reply-To
- <24454e67b186992b9ef7a8ac6f220cbb4aaafd6b.1615271086.git.gitgitgadget@gmail.com>
On 3/9/2021 1:24 AM, Elijah Newren via GitGitGadget wrote:
Show 10 quoted lines
> From: Elijah Newren <newren@gmail.com> > > renormalize_buffer() requires an index_state, which is something that > merge-ort does not operate with. However, all the renormalization code > needs is an index with a .gitattributes file...plus a little bit of > setup. Create such an index, along with the deallocation and > attr_direction handling. > > A subsequent commit will add a function to finish the initialization > of this index.
Is this the best way to solve this problem? Shouldn't we extract the logic that interacts with the .gitattributes file from renormalize_buffer() (say, to renormalize_buffer_attributes()) and just pass the .gitattributes file instead of creating a fake index?
It probably moves more code to do it the way I recommend, but it helps to separate the concerns a bit better. Of course, I haven't tried doing it myself, so maybe it's harder than I think. Thanks, -Stolee