[Bioc-devel] Git svn mirror: Duplicated commit entries (introduced by git svn rebase?)

Dan Tenenbaum dtenenba at fredhutch.org
Tue Feb 23 20:59:18 CET 2016


Hi Henrik,

I am not an expert in these matters but I'll take a stab at this (I have asked someone who might know but have not yet heard back).

See below.


----- Original Message -----
> From: "Henrik Bengtsson" <henrik.bengtsson at gmail.com>
> To: "bioC-devel" <bioc-devel at stat.math.ethz.ch>
> Sent: Friday, February 19, 2016 1:16:09 PM
> Subject: [Bioc-devel] Git svn mirror: Duplicated commit entries (introduced	by git svn rebase?)

> Hi.
> 
> I've got https://github.com/HenrikBengtsson/aroma.light which I've

BTW you should probably change the repo comment on this repo as it refers to the defunct git-svn bridge.


> successfully used for years to sync to Biconductor SVN via the
> BiocGitHub bridge.  All the time I've had the `master` branch synced
> to Bioc.  (I've also had my own `develop` branch to which I made all
> the commits which I then merged in to `master`).
> 
> Next, I'm following the instruction in Section 'Scenario 2: Set Up
> Your Own GitHub Repository' on
> https://www.bioconductor.org/developers/how-to/git-mirrors/.  However,
> I end up with duplicated commit entries.  For example, I fork
> https://github.com/HenrikBengtsson/aroma.light to
> https://github.com/hb-slash/aroma.light and do the following:

I'm not sure why you did this forking. You could have just run update_remotes.sh in
https://github.com/HenrikBengtsson/aroma.light . But it doesn't do any harm, I guess, you just have to keep track of where you want your development to happen.

> 
> n6{henrik}: curl -O
> https://raw.githubusercontent.com/Bioconductor/mirror/master/update_remotes.sh
>  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                 Dload  Upload   Total   Spent    Left  Speed
> 100  3303  100  3303    0     0  13741      0 --:--:-- --:--:-- --:--:-- 18350
> 
> n6{henrik}: git clone https://github.com/hb-slash/aroma.light.git
> Cloning into 'aroma.light'...
> remote: Counting objects: 1936, done.
> remote: Compressing objects: 100% (670/670), done.
> remote: Total 1936 (delta 1263), reused 1928 (delta 1256), pack-reused 0
> Receiving objects: 100% (1936/1936), 813.83 KiB | 1.04 MiB/s, done.
> Resolving deltas: 100% (1263/1263), done.
> Checking connectivity... done.
> 
> n6{henrik}: cd aroma.light
> 
> n6{henrik}: git status
> On branch master
> Your branch is up-to-date with 'origin/master'.
> nothing to commit, working directory clean
> 
> n6{henrik}: bash ../update_remotes.sh
> Commit to git as normal, when you want to push your commits to svn
>  1. `git checkout devel` to switch to the devel branch. (use release-X.X for
>        release branches)
>  2. `git svn rebase` to get the latest SVN changes.
>  3. `git merge master --log` to merge your changes from the master branch
>        or skip this step and work directly on the current branch.
>  4. `git svn dcommit --add-author-from` to sync and commit
>        your changes to svn.
> n6{henrik}: pwd
> /home/henrik/ghf/aroma.light
> 
> n6{henrik}: git br
>  devel
> * master
>  release-3.0
>  release-3.1
>  release-3.2
> 
> n6{henrik}: git checkout devel
> Switched to branch 'devel'
> Your branch is up-to-date with 'bioc/master'.
> 
> n6{henrik}: git svn rebase
> Migrating from a git-svn v1 layout...
> Data from a previous version of git-svn exists, but
>        .git/svn
>        (required for this version (2.1.3) of git-svn) does not exist.
> Done migrating from a git-svn v1 layout
> Rebuilding
> .git/svn/refs/remotes/git-svn-devel/.rev_map.bc3139a8-67e5-0310-9ffc-ced21a209358
> ...
> r18895 = 143ee9ee3f234d83b56e32db0b0b8d4383f2a61d
> r18903 = 5ef8bcd18515a2ef2de90d165ea831797380dd9d
> r18904 = 9c5d176667c453079e571a224b7609f51033a1a9
> [... (in total 193 of these lines) ...]
> r109270 = 1cfcf8f2d257c6a2a90d9292b93a6863e3aabf51
> r109589 = 0c24adb439efd2f30e45e8927e4bcbde0273f320
> r109592 = dc91cede48ea7d60263e452304e035622497a25b
> r109897 = 496182c760cbac378f98b374008d5273d48b5ec9
> r112254 = 44cd054eb4115d6955cd918b84f382bca41a7839
> r113262 = 81f338b4f7d6825786f917f9e712889db20f66f2
> Done rebuilding
> .git/svn/refs/remotes/git-svn-devel/.rev_map.bc3139a8-67e5-0310-9ffc-ced21a209358
> Current branch devel is up to date.
> 
> n6{henrik}: git status
> On branch devel
> Your branch is up-to-date with 'bioc/master'.
> 
> n6{henrik}: git checkout master
> Switched to branch 'master'
> Your branch is up-to-date with 'origin/master'.
> 
> n6{henrik}: git merge -X theirs devel
> Auto-merging tests/normalizeFragmentLength-ex2.R
> Merge made by the 'recursive' strategy.
> tests/normalizeFragmentLength-ex2.R | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> n6{henrik}: git status
> On branch master
> Your branch is ahead of 'origin/master' by 194 commits.
>  (use "git push" to publish your local commits)
> nothing to commit, working directory clean
> 
> Note that this single merge now makes local master to be **194**
> commits ahead of origin/master.   This looks like 193 + 1 where 193
> corresponds to those 193 "tweaks" introduced by `git svn rebase`.
> 
> I did a `git push --all` after the above, so you can see the
> repository online at https://github.com/hb-slash/aroma.light/.  For
> instance, there are lots of the commits are now duplicated, where one
> show my original commit message the other the "Git-SVN bridge"
> message, e.g.
> 
> "Updated NEWS to reflect new Bioc releases.":
> https://github.com/hb-slash/aroma.light/commit/32e70c12bd9b6ea106128a1db466a13aebcf88a6
> 
> "Commit made by the Bioconductor Git-SVN bridge. ...":
> https://github.com/hb-slash/aroma.light/commit/a0ee1399c24d36b96d5f737907228e250b5ffcba
> 
> Note that the code changes are identical, but based on different parents.
> 
> Any suggestions?  Are the actions for `git svn rebase` expected?

I think this is a result of the old git-svn bridge being kind of brain dead, which I can say because I wrote it. 

One thing you might want to try is...

- git checkout devel
- do your git svn rebase, make a note of the first and last commits that 
  are pulled down (let's call them FIRST and LAST)
- check out a temporary branch. (git checkout -b temp)
- git cherry-pick FIRST..LAST . You might need to resolve some conflicts here.
  This will basically 'replay' all those commits into a single new commit.
- git checkout master
- git merge temp
- if all looks ok, then push

Not sure if I've totally addressed your actual problem here, but HTH anyway....

Dan



> 
> Thanks
> 
> Henrik
> 
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list