On Oct 4, 2017, at 10:14 AM, Turaga, Nitesh <Nitesh.Turaga at RoswellPark.org> wrote:
Hi Thomas,
The following issue occurred because there was a commit on Aug 17th with all the duplicates. Unfortunately, your upstream repository has been contaminated with duplicate commits.
Till I figure out a solution on how to fix this, please hold off any further commits.
I?ll keep you posted. You might have to follow a few special instructions to add any commits you have on your local machine now.
Best,
Nitesh
On Oct 3, 2017, at 10:08 PM, Thomas Girke <thomas.girke at ucr.edu> wrote:
Hi Nitesh,
Sorry for bothering you again about a similar problem. The master/devel branch of
my systemPipeR package also contains upstream duplicates in the Bioc repos. However, I am
not able to resolve the problem entirely. When using the 'git merge --squash' approach,
that worked before, then the duplicates can be removed but this time I am ending up in
a trap at the push step:
git push upstream master
where I am getting the following error:
To git at git.bioconductor.org:packages/systemPipeR.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git at git.bioconductor.org:packages/systemPipeR.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
The solution to this would normally be to run a `git pull` first but when I do this
then I am getting all the duplicates back which puts me back where I started.
Running a git push with the -f argument also doesn't work since the usage of this option
gets rejected by the remote.
Do you have any suggestions what else I should try?
Thanks,
Thomas
On Tue, Sep 12, 2017 at 02:19:44AM +0000, Thomas Girke wrote:
The following allowed me to eliminate the duplicated commits in one step
via git merge --squash and then successfully push back to the bioc-git
server. After this I was able to switch to the swap branch approach to
avoid similar problems in the future.
Example here for master branch:
git checkout master
git pull upstream master # just in case
git reset --hard <commit_id> # Reset the current branch to the
commit right before dups started
git merge --squash HEAD@{1} # Squashes duplicated commits from
chosen <commit_id> to HEAD@{1} (state right before previous reset
step)
git commit -am "some_message" # Commit squashed changes
git push upstream master # Push to bioc-git server
I am not sure if the above is the best solution but I thought I report it
here in case others experience similar problems. BTW: in my case the
duplicates were all generated in the upstream merge (step 6) of the
instructions here: https://goo.gl/wWVEeT. None of the parent branches (on
github or bioc) used in this merge step contained duplicated commits at
least as far as I have checked so far. Perhaps some of this relates back to
the git svn/rebase steps we used under the old git mirror?
Just in case, the following command is very helpful to identify duplicate
commits based on patch-id. Commits with identical patch-ids are very likely
to have identical content.
git rev-list master | xargs -r -L1 git diff-tree -m -p | git
patch-id | sort | uniq -w40 -D | cut -c42-80 | xargs -r git log
--no-walk --pretty=format:"%h %ad %an (%cn) %s" --date-order
--date=iso
After duplicated commit pairs have been identified, one can check with diff
or vimdiff whether their content is identical:
git --no-pager show <commit_id1> > zzz1
git --no-pager show <commit_id2> > zzz2
vimdiff zzz1 zzz2
Thomas
This email message may contain legally privileged and/or confidential information. If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited. If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.