spine-generic / data-multi-subject

Multi-subject data for the Spine Generic project
Creative Commons Attribution 4.0 International
22 stars 15 forks source link

How to do a git rebase master #23

Open jcohenadad opened 4 years ago

jcohenadad commented 4 years ago

Working on a branch, I wanted to update it with a recently-updated master branch.

I went ahead with the traditional git rebase master, but encountered the following issue:

Full details ~~~ julien-macbook:~/code/spine-generic/data-multi-subject $ git checkout jca/17-defacing Switched to branch 'jca/17-defacing' julien-macbook:~/code/spine-generic/data-multi-subject $ git rebase master First, rewinding head to replay your work on top of it... git-annex: git status will show sub-cmrra02/anat/sub-cmrra02_T2w.nii.gz to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh sub-cmrra02/anat/sub-cmrra02_T2w.nii.gz git-annex: git status will show sub-cmrra04/anat/sub-cmrra04_T2w.nii.gz to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh sub-cmrra04/anat/sub-cmrra04_T2w.nii.gz git-annex: git status will show sub-cmrra05/anat/sub-cmrra05_T2w.nii.gz to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh sub-cmrra05/anat/sub-cmrra05_T2w.nii.gz git-annex: git status will show sub-oxfordFmrib07/anat/sub-oxfordFmrib07_T1w.nii.gz to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh sub-oxfordFmrib07/anat/sub-oxfordFmrib07_T1w.nii.gz git-annex: git status will show sub-stanford06/anat/sub-stanford06_T1w.nii.gz to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh sub-stanford06/anat/sub-stanford06_T1w.nii.gz Applying: Fixed defacing in a few subjects Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... error: Your local changes to the following files would be overwritten by merge: sub-cmrra02/anat/sub-cmrra02_T2w.nii.gz sub-cmrra04/anat/sub-cmrra04_T2w.nii.gz sub-cmrra05/anat/sub-cmrra05_T2w.nii.gz sub-oxfordFmrib07/anat/sub-oxfordFmrib07_T1w.nii.gz sub-stanford06/anat/sub-stanford06_T1w.nii.gz Please commit your changes or stash them before you merge. Aborting error: Failed to merge in the changes. Patch failed at 0001 Fixed defacing in a few subjects hint: Use 'git am --show-current-patch' to see the failed patch Resolve all conflicts manually, mark them as resolved with "git add/rm ", 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". ~~~

What's strange, is that the branch jca/17-defacing started of from master, the problematic files listed above where updated only in jca/17-defacing (not on master), so I am wondering why this conflict is showing up. Is this a singularity of git-annex? @kousu @drulex any idea?

jcohenadad commented 4 years ago

I tried the command indicated here, but it didn't help:

Full details ~~~ julien-macbook:~/code/spine-generic/data-multi-subject $ git checkout jca/17-defacing Switched to branch 'jca/17-defacing' julien-macbook:~/code/spine-generic/data-multi-subject $ gs julien-macbook:~/code/spine-generic/data-multi-subject $ git status | sed -n 's/modified://p' | xargs git update-index -q --refresh julien-macbook:~/code/spine-generic/data-multi-subject $ git rebase master First, rewinding head to replay your work on top of it... git-annex: git status will show sub-cmrra02/anat/sub-cmrra02_T2w.nii.gz to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh sub-cmrra02/anat/sub-cmrra02_T2w.nii.gz git-annex: git status will show sub-cmrra04/anat/sub-cmrra04_T2w.nii.gz to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh sub-cmrra04/anat/sub-cmrra04_T2w.nii.gz git-annex: git status will show sub-cmrra05/anat/sub-cmrra05_T2w.nii.gz to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh sub-cmrra05/anat/sub-cmrra05_T2w.nii.gz git-annex: git status will show sub-oxfordFmrib07/anat/sub-oxfordFmrib07_T1w.nii.gz to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh sub-oxfordFmrib07/anat/sub-oxfordFmrib07_T1w.nii.gz git-annex: git status will show sub-stanford06/anat/sub-stanford06_T1w.nii.gz to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh sub-stanford06/anat/sub-stanford06_T1w.nii.gz Applying: Fixed defacing in a few subjects Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... error: Your local changes to the following files would be overwritten by merge: sub-cmrra02/anat/sub-cmrra02_T2w.nii.gz sub-cmrra04/anat/sub-cmrra04_T2w.nii.gz sub-cmrra05/anat/sub-cmrra05_T2w.nii.gz sub-oxfordFmrib07/anat/sub-oxfordFmrib07_T1w.nii.gz sub-stanford06/anat/sub-stanford06_T1w.nii.gz Please commit your changes or stash them before you merge. Aborting error: Failed to merge in the changes. Patch failed at 0001 Fixed defacing in a few subjects hint: Use 'git am --show-current-patch' to see the failed patch Resolve all conflicts manually, mark them as resolved with "git add/rm ", 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". ~~~
jcohenadad commented 4 years ago

Since this was urgent, I went ahead and clicked on "rebase and merge" directly on github (without being able to rebase and wait for travis)

jcohenadad commented 4 years ago

Even more problematic:

does git-annex know i have another local copy somewhere??

Drulex commented 4 years ago

does git-annex know i have another local copy somewhere??

Did you clone from your filesystem?

Unfortunately I don't have extensive experience with git-annex and documentation on using it with the PR model seems to be scarce. Also the fact that the status command can glitch isn't the most reassuring thing..

Did you sync to S3 before making your PR/rebase?

jcohenadad commented 4 years ago

Did you clone from your filesystem?

I'm not sure I understand the question, but I did exactly as instructed here

Did you sync to S3 before making your PR/rebase?

Hum, I don't think I did. I only did a git pull on master, then went on my branch and did the rebase.

kousu commented 3 years ago

I tried the command indicated here, but it didn't help:

I'm 80% confident that this is entirely due to that "cosmetic" glitch that git-annex has. But I'm also only 80% confident in my workaround. Maybe git status was outputting those files as "added" instead of "modified", or reworded modified, or maybe it was outputting in french; there's a lot of ways my workaround could be buggy.

When it happens again paste the output of the plain git status.