ome / scc

OME tools for managing the Git(Hub) workflow
https://pypi.org/project/scc/
GNU General Public License v2.0
0 stars 15 forks source link

Improve tracking branch filter for repository with submodules #196

Closed sbesson closed 9 years ago

sbesson commented 9 years ago

Closes #194

Recent changes added support for mismatching repository names. With this commit, submodule tracking branches are now excluded from the top-level repository find_candidate_branches() call and only submodule branches are considered in submodule repositories.

Tested with openmicroscopy.git and the following command

python ../snoopycrimecop/scc/main.py merge --info develop -Dnone -Isbesson/bioformats:test -Isbesson/openmicroscopy:test2 -Isbesson/snoopys-sandbox:test3 -Ipr:3295 -Isbesson/ome-documentation:test4

The test2, test3 branches and the PR 3295 should be candidates for merging in the top-level repository while the test and test4 branches should only be candidates branches for the appropriate submodule.

/cc @manics

manics commented 9 years ago

Note I tried an alternative fix in https://github.com/openmicroscopy/snoopycrimecop/pull/195

sbesson commented 9 years ago

@manics: which commit has the alternative?

manics commented 9 years ago

https://github.com/openmicroscopy/snoopycrimecop/commit/f516594ec568c387225222ce258350d33b77090c#diff-5923d02f836bb9ceb6fe33b828303de5R1557

sbesson commented 9 years ago

@manics: I think both fixes are complementary. Your fix will prevent a branch with an inconsistent base to be merged. With the top-level filter, I also want to prevent inappropriate fetching, e.g. prevent a valid bioformats remote to be fetched in an openmicroscopy repository.

manics commented 9 years ago

Agreed.

Without:

snoopys-sandbox$ scc merge --info master -D none -I manics/snoopys-sandbox-2:hello
2015-01-07 13:50:39,352 [   scc.merge] INFO  Listing Pull Request(s) based on master
2015-01-07 13:50:39,353 [   scc.merge] INFO  Including manics/snoopys-sandbox-2 Branches(s)/Pull Request(s) hello
2015-01-07 13:50:41,386 [   scc.merge] INFO  Repository: manics/snoopys-sandbox
2015-01-07 13:50:41,386 [   scc.merge] INFO  Candidate Branches:
2015-01-07 13:50:41,386 [   scc.merge] INFO    # manics/snoopys-sandbox-2:hello
2015-01-07 13:50:41,386 [   scc.merge] INFO
2015-01-07 13:50:41,386 [   scc.merge] INFO  Repository: openmicroscopy/snoopys-sandbox-2
2015-01-07 13:50:41,386 [   scc.merge] INFO  Candidate Branches:
2015-01-07 13:50:41,386 [   scc.merge] INFO    # manics:hello
2015-01-07 13:50:41,386 [   scc.merge] INFO

With:

snoopys-sandbox$ scc merge --info master -D none -I manics/snoopys-sandbox-2:hello
2015-01-07 13:52:02,087 [   scc.merge] INFO  Listing Pull Request(s) based on master
2015-01-07 13:52:02,087 [   scc.merge] INFO  Including manics/snoopys-sandbox-2 Branches(s)/Pull Request(s) hello
2015-01-07 13:52:04,014 [   scc.merge] INFO  Repository: manics/snoopys-sandbox
2015-01-07 13:52:04,015 [   scc.merge] INFO
2015-01-07 13:52:04,015 [   scc.merge] INFO  Repository: openmicroscopy/snoopys-sandbox-2
2015-01-07 13:52:04,015 [   scc.merge] INFO  Candidate Branches:
2015-01-07 13:52:04,015 [   scc.merge] INFO    # manics:hello
2015-01-07 13:52:04,015 [   scc.merge] INFO

Good to merge.