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

How to resolve merge conflicts via the command line created by trying to integrate the license-maintainer? #9

Open
jamesray1 opened this issue Apr 18, 2018 · 14 comments

Comments

@jamesray1
Copy link
Contributor

So I got merge conflicts on several files with a pull request here. Here is the patch diff. I'm not sure how to resolve this, following the instructions to resolve the conflicts via the command line didn't help.

@jamesray1
Copy link
Contributor Author

I'll try to figure it out myself.

@jamesray1
Copy link
Contributor Author

I have no idea, I have spent ages on this now (more than 3 hours in total), and the only difference is that I am adding the license header to each file.

@jamesray1 jamesray1 reopened this Apr 18, 2018
@xkr47
Copy link
Member

xkr47 commented Apr 18, 2018

ok I will try to have a look in a few hours.. ok if I create a new PR if I manage to fix it? I will keep you as author of the commits as much as I can..

@jamesray1
Copy link
Contributor Author

jamesray1 commented Apr 18, 2018

So I get conflicting files, but I don't get any merge conflicts like here.

 ✘ james@james-Streacom  ~/dod   develop  git status
On branch develop
Your branch is up-to-date with 'origin/develop'.

nothing to commit, working tree clean
 james@james-Streacom  ~/dod   develop  git checkout jamesray1-develop
Switched to branch 'jamesray1-develop'
 james@james-Streacom  ~/dod   jamesray1-develop  git status
On branch jamesray1-develop
nothing to commit, working tree clean
 james@james-Streacom  ~/dod   jamesray1-develop  git remote --verbose
githooks-license-maintainer	git@github.com:NitorCreations/license-maintainer.git (fetch)
githooks-license-maintainer	git@github.com:NitorCreations/license-maintainer.git (push)
origin	https://github.com/jamesray1/diamond_drops.git (fetch)
origin	https://github.com/jamesray1/diamond_drops.git (push)
upstream	https://github.com/Drops-of-Diamond/diamond_drops (fetch)
upstream	https://github.com/Drops-of-Diamond/diamond_drops (push)

@jamesray1
Copy link
Contributor Author

@xkr47 I'll see how I go working on it in the meantime.

@jamesray1
Copy link
Contributor Author

Stopping for now, I may resume in the morning.

@jamesray1
Copy link
Contributor Author

OK I made progress with git diff <commit> <commit>

@jamesray1
Copy link
Contributor Author

It's OK I'm making progress with Meld after using git pull --rebase upstream develop, many git rebase --skips, git push origin develop, git pull origin develop and git mergetool --tool=meld.

@xkr47 xkr47 changed the title How to resolve merge conflicts via the command line created by trying to integrate the license-maintainer? <How to resolve merge conflicts via the command line created by trying to integrate the license-maintainer? Apr 19, 2018
@xkr47
Copy link
Member

xkr47 commented Apr 19, 2018

I can see from your commits that using plain YEAR and AUTHORS as template keys was a devastatingly poor choice on my behalf. It will keep changing "AUTHORS" in the middle of the license text with the list of authors sadly. I will need to change that in my project so it will no longer do that. Need to figure out how to do that without breaking it for current users. Will get back to you on this.

@jamesray1 jamesray1 changed the title <How to resolve merge conflicts via the command line created by trying to integrate the license-maintainer? How to resolve merge conflicts via the command line created by trying to integrate the license-maintainer? Apr 19, 2018
@jamesray1
Copy link
Contributor Author

Yeah I should've pointed that out, thanks for reviewing!

@jamesray1
Copy link
Contributor Author

Note that for the Unlicense, you don't need to have a copyright line with the year and authors. I removed that line from my template and some files, while the output of the commit had the following for each file that didn't have a year or author:

Use of uninitialized value $years_str in split at .githooks/license-maintainer/license.pmline 118.
Use of uninitialized value $_[0] in split at .githooks/license-maintainer/license.pm line155.

@xkr47
Copy link
Member

xkr47 commented Apr 20, 2018

Ok, this is a clear bug. I will fix it when I can.

@xkr47 xkr47 reopened this Apr 20, 2018
@jamesray1
Copy link
Contributor Author

jamesray1 commented Apr 20, 2018

This is my patch for license.pm without references to year or authors. https://gist.github.com/jamesray1/914185797d335d96509be33c7062f420

Note that I have no experience with Perl until now. I just removed all references, then hacked modifications to fix compiler errors until I got to an error with the pre-commit.

While that seems to work, I need to modify the pre-commit next.

@jamesray1
Copy link
Contributor Author

jamesray1 commented Apr 23, 2018

So I commented out references in the pre-commit, but it is failing on line 131. https://gist.github.com/jamesray1/f9754e72c452a856cf02295991a4734e. I haven't been able to debug it using the Perl Debug extension with VS Code.

 james@james-Streacom  ~/dod   license-maintainer3 ✚  git commit -m "Comment out references to author and years.
dquote> "
Argument "// UML Generator https://github.com/adjivas/ml\nextern c..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "use cli::config;\n\n#[derive(PartialEq)]\nenum ConfigTyp..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "/// The mode the client is running in\n#[derive(Debug, P..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "use std::env;\n\npub fn get_env() -> String {\n    let k..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "use fern;\nuse fern::colors::{Color, ColoredLevelConfig}..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "pub mod config;\npub mod config_env;\npub mod config_log..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "use cli::config;\nuse notary;\nuse proposer;\nuse messag..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "#[derive(PartialEq, Debug, Clone)]\npub struct Body;" isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "use collation::header;\nuse collation::body;\n\n#[derive..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "use ethereum_types;\nuse tiny_keccak;\n\n#[derive(Partia..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "pub mod collation;\npub mod header;\npub mod body;" isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "//! ![uml](ml.svg)\n\n// External crates\nextern crate e..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "extern crate diamond_drops;\n\nextern crate fern;\n\n#[m..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "use collation::collation;\n\nuse ethereum_types;\n\n\n#[..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "use collation::collation;\nuse message;\nuse client_thre..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "use ethereum_types;\n\npub struct Proposer {\n    id: et..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
Argument "use message;\n\nuse ethereum_types;\n\nuse std::sync::mp..." isn't numeric in numeric eq (==) at .git/hooks/pre-commit line 131.
[license-maintainer3 1e1a3cb] Comment out references to author and years.
 1 file changed, 33 insertions(+), 63 deletions(-)

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

2 participants