Call checkout-index just once per file #424
No reviewers
Labels
No labels
Compat/Breaking
Kind
Bad merge
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
New language
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mergiraf/mergiraf#424
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "xmo/mergiraf:optimise-checkout-index"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
extract_revision(_from_git)?
is always called 3 times (either directly or indirectly viaextract_revision
, doesn't really make a difference), one time to get the base version of a file, one time to get the left, and one time to get the right.However this is a lot of unnecessary git interactions given Git can do that on its own by calling
checkout-index --stage=all
. It's a bit more complex to parse but not exactly heinous.This is a small optimisation on the git
checkout-index
calls to call that only once instead of thrice.de84f99c12
shows that--staged=all
and--temp
were added at the same time, and hints that--staged=all
was very much added to speed up the case of resolving all three revisions:It's likely to conflict with #423 but the resolution should be straightforward?
(
and re-reading that commit, I now re-member that I need to handle the case of ashould be fixed).
stage temp as a failure which I forgot to do147bad56a8
to8819d1172c
Hi @xmo, how nice! Thanks a lot for those contributions and welcome to the project :)
The optimization you propose here looks good to me. It's also covered by existing tests so I don't think we need more here.
In the future, I think it would be helpful to support returning only the left and right revisions, even though the base one is missing, as this is still a valid use case for Mergiraf (both sides add the same file with different contents). But your version is consistent with the existing behaviour of the tool, so I think it's worth keeping the scope of this PR to this optimization and tackle this improvement later.