Closed kousu closed 3 years ago
Because it was a bit tricky, here's a record of how I merged master
into this while retaining all the commits cleanly:
rebase
which is always a bit scary.$ git remote add r git@github.com:renelabounek/data-multi-subject.git
$ git fetch r
$ git checkout -b r-master-backup r/master
$ git push -u origin HEAD:rl/height-weight
$ git checkout -b r-master-rebase r/master
$ git rebase 27ac875fe87e4ef18954a27bb79db0aa9e3ac2ae
$ git rebase -x 'dos2unix participants.tsv && git add participants.tsv && git commit --amend -C HEAD' -X theirs 27ac875fe87e4ef18954a27bb79db0aa9e3ac2ae
This is a bit hard to explain but I'll try:
rebase
: replay each commit-x
: after each commit, run dos2unix
over the file and recommit it-X
: when there is a conflict pick the older version; and there usually are conflicts, because in the original patch, all the lines had Windows line endings, which appear to be conflicts to git. So to fix this, just pick the version with the Windows line ending, but then immediately -x
happens, rewriting participants.tsv to the proper form and recommitting
To double check this worked, compare the patches:
diff --color -u <(git format-patch --stdout 27ac875fe87e4ef18954a27bb79db0aa9e3ac2ae..r-master) <(git format-patch --stdout 27ac875fe87e4ef18954a27bb79db0aa9e3ac2ae..HEAD)
I've also extracted this to a linter in #87, along with a .tsv linter in #86, and I am hoping those will be merged first so that the format will be tested, as requested by @jcohenadad in https://github.com/spine-generic/data-multi-subject/pull/57#issuecomment-702247465.
git rebase -i 27ac875fe87e4ef18954a27bb79db0aa9e3ac2ae
with this rebase-todo
:
pick 2de478de9 Update participants.tsv
s 484560d7c Update participants.tsv
s f9b2f4fc8 Update participants.tsv
s 472c78c2a Update participants.json
s a1b505323 Update participants.tsv
s 8004dc491 Update participants.tsv
pick f52cdd5f8 Update participants.tsv
pick ca01dccd8 add unf metadata
pick 18305ddb0 added height and weight for cmrrb dataset
pick 6ba2d682c added height and weight for brnoCeitec
pick 9cff345a4 scan date updated for sub-brnoCetitec02
pick df2139698 update info sub-perform01,03,05,06
$ git log --oneline
298c02ee4 (HEAD -> r-master-rebase) update info sub-perform01,03,05,06
37140f685 scan date updated for sub-brnoCetitec02
082b89171 added height and weight for brnoCeitec
094e94f02 added height and weight for cmrrb dataset
fd8c61ecc add unf metadata
a12499c4c Update participants.tsv
026c9ab73 Added height and height columns
27ac875fe Handle testing forks. (#83)
master
and do the conflict resolution:$ git rebase master
$ git rebase master
Auto-merging participants.tsv
CONFLICT (content): Merge conflict in participants.tsv
error: could not apply 026c9ab73... Added height and height columns
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 026c9ab73... Added height and height columns
vi participants.tsv
I needed to copy the ucdavis
lines down, and add empty height/weight columns to them.
I also made sure to dos2unix
the file:
$ dos2unix participants.tsv
$ git add participants.tsv
Finish merging:
$ git rebase --continue
$ git push -f -u r master
Enter passphrase for key '/home/kousu/.ssh/id_rsa.github':
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To github.com:renelabounek/data-multi-subject.git
+ 1c48531b4...46df26243 master -> master (forced update)
Branch 'master' set up to track remote branch 'master' from 'r'.
...ah but this last step was a mistake, and is why we're here in this thread and not over in #57 now. :shrug: . Sorry.
Thank you for taking the time to improve this dataset @renelabounek. Sorry it took so long to get it merged.
This was https://github.com/spine-generic/data-multi-subject/pull/57, but I accidentally closed that by pushing the wrong branch to the wrong remote after resolving the merge conflicts. Sorry! It's all still here.