-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EXP-13070: Update s7 to checkout subrepos in case of merge conflicts #85
Conversation
system7/Hooks/S7PostCheckoutHook.m
Outdated
|
||
NSArray<S7SubrepoDescription *> *const subrepoConflicts = [self findConflictsInConfig:toConfig]; | ||
if (0 != subrepoConflicts.count) { | ||
fromConfig = [self makeConfigWithConfig:fromConfig removingSubrepoDescriptions:subrepoConflicts]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Трохи не люблю міняти значення для input variables, але з іншого боку не хочеться префікси додавати і писати щось таке:
toConfig:(S7Config *)aToConfig
S7Config *toConfig = aToConfig
Подумав, що переприсвоїти буде меншим злом. Якщо що - відкритий до пропозицій
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пропоную замість цього, в місці
dispatch_apply(subreposToCheckout.count, DISPATCH_APPLY_AUTO, ^(size_t i) {
S7SubrepoDescription *subrepoDesc = subreposToCheckout[i];
превірити S7SubrepoDescConflict + shouldSkipConflicts, і зробити або s7logWarn("skipping conflict") + return або, якщо NO == shouldSkipConflicts, тоді logError + recordFailingExitCode
system7/Hooks/S7PostCheckoutHook.m
Outdated
fromConfig:fromConfig | ||
toConfig:toConfig | ||
clean:clean | ||
skipConflicts:NO]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зараз по дефолту skipConflicts:NO
. Явно передається YES
тільки в S7PostCheckoutHook
. Насправді, хороше питання, яке має бути значення по дефолту. Поки не ризикнув поставити YES
system7/Types/S7SubrepoDescription.h
Outdated
@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN | |||
|
|||
@property (nonatomic, nullable) NSString *comment; | |||
|
|||
@property (nonatomic, readonly) BOOL hasConflict; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Щоб не перевіряти на isKindOfClass:[S7SubrepoDescriptionConflict class]
додав проперю
echo | ||
|
||
assert grep '"<<<"' .s7substate > /dev/null # must be a conflict marker in .s7substate | ||
assert test -d Dependencies/ReaddleLib # subrepo must be present in conflict state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пропоную тут власне перевірити, що ReaddleLib знаходиться в стані конфлікту.
Як варіант – що там є .git/MERGE_HEAD. Або, що файл RDMath.h містить конфлікт маркер
А для RDPDFKit чекнути, що там правильна ревізія. git -C Dependencies/RDPDFKit rev-parse HEAD == correct revision
system7/Hooks/S7PostCheckoutHook.m
Outdated
|
||
NSArray<S7SubrepoDescription *> *const subrepoConflicts = [self findConflictsInConfig:toConfig]; | ||
if (0 != subrepoConflicts.count) { | ||
fromConfig = [self makeConfigWithConfig:fromConfig removingSubrepoDescriptions:subrepoConflicts]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пропоную замість цього, в місці
dispatch_apply(subreposToCheckout.count, DISPATCH_APPLY_AUTO, ^(size_t i) {
S7SubrepoDescription *subrepoDesc = subreposToCheckout[i];
превірити S7SubrepoDescConflict + shouldSkipConflicts, і зробити або s7logWarn("skipping conflict") + return або, якщо NO == shouldSkipConflicts, тоді logError + recordFailingExitCode
Після сьогоднішнього обговорення і змін мені реалізація подобається більше |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Саша, дуже дякую!
Мене все ж муляє о той hasConflict
у S7SubrepoDescription. Можна все ж попросити його прибрати, і фактично в одному місці написати isKindOfClass? Ти не проти?
Так, звичайно. Зараз зроблю |
https://readdle-j.atlassian.net/browse/EXP-13070
Тепер у випадку конфліктів у
.s7substate
робиться checkout тим сабрепам які змержились без конфлікту.Додав uint & integration tests.