Skip to content
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

git node v8 backport aborts on merge conflict #303

Closed
hashseed opened this issue Nov 9, 2018 · 5 comments
Closed

git node v8 backport aborts on merge conflict #303

hashseed opened this issue Nov 9, 2018 · 5 comments

Comments

@hashseed
Copy link
Member

hashseed commented Nov 9, 2018

git node v8 backport attempts at some point to do a git apply -3, which fails often. The -3 doesn't help since Node's copy of V8 doesn't have a git history.

How about not aborting, but wait for the user to fix the conflicts and git add the fixes and then continue?

@targos
Copy link
Member

targos commented Nov 9, 2018

+1000 if you know how to do that! I was not able to get conflict markers with git apply when I developed the command.

@joyeecheung
Copy link
Member

joyeecheung commented Nov 9, 2018

I think the thing necessary to implement is more like to have a way to persist the state and then be able to restart from here once the user fixes the conflict?

const todo = [common.getCurrentV8Version(), generatePatch(), applyPatch()];

git node land is able to do that by persisting states to .ncu/land and always reading this file to understand the previous state so that users can git node land --continue all the way down while fixing errors

get session() {
return readJson(this.sessionPath);
}

@targos
Copy link
Member

targos commented Nov 9, 2018

The real problem is that there is no conflict to fix. The patch fails and that's all. No files are modified

@joyeecheung
Copy link
Member

joyeecheung commented Nov 9, 2018

@targos One way to tackle that is to use git apply --reject, and prompt the user to use wiggle on the .rej files (which applies wherever possible and generates the conflict marker wherever impossible), though that cannot guarantee to work either (I guess it's better than outright failure?) Then when the conflicts are fixed, read some persisted state from disk to bake the commit message and so on.

@hashseed
Copy link
Member Author

I made an attempt to solve this: use patch -p1 --merge --no-backup-if-mismatch so that we get conflict markers in the files, and then prompt the user to continue once conflicts are resolved.

@targos targos closed this as completed Apr 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants