feat: support %L
conflict marker size option #136
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mergiraf/mergiraf#136
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ada4a/mergiraf:conflict_marker_size"
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?
closes #128
I thought I'd make my work so far publicly available. Thoughts welcome!
WIP because of
560d1f0666
to13d54f36c6
7e5a149c1e
to85a3226db4
85a3226db4
to855f19c973
f1cf8c679b
todc1de7fea3
oh, it seems like we don't actually get to use
DisplaySettings
's methods, since, we may get an incompletesettings
(with*_revision_name
still being at default values). Having such incomplete structs passed around is really an anti-pattern, so I'd say we try to get rid of that first2ee2a96d1e
to136dbfe756
136dbfe756
tod745a700bf
cleaned up the commit history a little
d745a700bf
to3c85cd4af7
got rid of the whole builder thing, rebased onto main
3c85cd4af7
toe52dabdc35
WIP: feat: supportto feat: support%L
conflict marker size option%L
conflict marker size optionI'm still unsure about how this should interact with
ParsedMerge::parse
– isn't it the case that even ifmergiraf merge
gets called on a file wtih conflicts properly annotated with markers of some non-standard size, Mergiraf will still try to parse the file with the marker length assumed to be 7 (by virtue of the marker regex), and get totally confused? Because of this, I have first changedparse
to make it also takeDisplaySettings
as input, but then reverted this changeI've experimented with a test Git repo a little, and am now pretty sure that we indeed need to respect
conflict-marker-size
during parsing. I'll revert the revert then138a83caca
to8a2a4f192f
rebased onto main
I now realize that
8a2a4f192f
actually doesn't have anything to do with this PR per se (what I wanted to was 979ac4e77c9d5c9878b42debd6907fe7c1bf8caa), but I guess I'll just leave it be9ec1450056
tod0026890fd
Fixed the test
It looks great to me!
By the way, I made a quick test to understand better how the conflict marker size is picked by git. I was hoping that it would be able to dynamically pick a size that made conflict markers distinct from the lines already contained in the files involved, but that doesn't seem to be the case (it can be configured in
gitattributes
). Maybe it wouldn't be so useful anyway, because the reader would still have a hard time understanding which marker is what if the size of the conflict markers produced by git varies depending on the contents.I think it's also not often that you even have what-looks-like-conflict-markers lying around in your codebase. Rather, that would be expected in exactly the software that deals with the parsing/creation of those, e.g. diffy or mergiraf for that matter.
So I think that's another reason why such auto-detection functionality wouldn't be of much use anyway, and handling the exceptions explicitly by using
.gitattributes
would be exactly the right escape hatch. Speaking of which... that's exactly what my follow-up PR will consist of!DisplaySettings
#223