Skip to content

Conversation

@foutoucour
Copy link

Put the merges keyword as optional in the config file.
It allows the case where we want to only fetch a repository without to merge anything.

I don't know if it is by design though

PS: I need to work on the tests..

case where we want to use the aggregator just to fetch a git repo.
@coveralls
Copy link

coveralls commented Feb 1, 2018

Coverage Status

Coverage increased (+0.05%) to 82.006% when pulling 2c6025f on foutoucour:optional_merges into ba24986 on acsone:master.

@sbidoul
Copy link
Member

sbidoul commented Feb 1, 2018

@foutoucour thanks for contributing!

I'm not sure what you want to happen if there is no merge section. If there is only one item in the merge section, it will simply clone the associated remote and switch to the chosen branch.

@foutoucour
Copy link
Author

Actually, I started to use git-aggregator today and it seems it will be very useful for us as we don't want to use buildout. We started something on our side but as you have already something pretty neat.

Here an example of how I set up an entry for a no-merges add-on:

  remotes:
    oca: https://github.com/OCA/web
  target: oca 663e88a130add6f9fba4b8476abb68802dd9b291

Should I operate otherwise?

@sbidoul
Copy link
Member

sbidoul commented Feb 1, 2018

@foutoucour this is the simplest gitaggregate you can do to clone a single branch;

parts/web:                                                                                                              
    remotes:                                                                                                            
        oca: https://github.com/OCA/web                                                                                 
        acsone: https://github.com/acsone/web                                                                           
    merges:                                                                                                             
        - oca 10.0                                                                                                      
    target: acsone mybranch                                                                                             

Does that do what you want?

edit: replace "acsone" by a remote where you can push (although gitaggregate does push only when you ask it to do so)

@foutoucour
Copy link
Author

I see.
I didn't see the tool from this angle actually. It is not only used to pull the repo but also to update your repos with a given state.
Do you have a case where you use git-aggregator on odoo itself?

@lmignon
Copy link
Member

lmignon commented Feb 2, 2018

@foutoucour here it's how we use it to build a patched Odoo version with all the fixes not yet merged into odoo but required for one of our project....

./src/odoo:
    remotes:
        odoo: git@github.com:odoo/odoo.git
        origin: git@github.com:acsone/odoo.git
    merges:
        - odoo 10.0
        - origin 10.0-with-setup
        - odoo refs/pull/17519/head # [10.0][FIX] add missing multi-company security rule for stock_location_route
        - odoo refs/pull/19198/head # [FIX] preserve prefetch for sudo switch in name_get compute on product_product
        - odoo refs/pull/19447/head # [FIX] related fields should be readonly to avoid recompute
        - origin 10.0-models_improve_read_translation_rco-dro
        - origin 10.0-pos_order_new_hooks_fix_conflicts-bwi # Fix conflicts between PRs 17580 and 17596
        - odoo refs/pull/18147/head # [10.0][FIX] stock: Wrong move picking assignation
        - odoo refs/pull/20430/head # [10.0][FIX] stock: Forecasted stock report is not multi-company compliant
        - odoo refs/pull/20971/head # [FIX] purchase: reset to draft
        - odoo refs/pull/21207/head # [10.0] members of group_erp_manager must be able to update base.user_groups_view
        - origin 10.0-account_chart_template_fix_conflicts-fho
    shell_command_after:
        - git rm -r addons/l10n_es
        - git commit -m "remove l10n_es, we'll use OCA/l10n-spain"
    target: origin 10.0-my_project_branch

@foutoucour
Copy link
Author

thank you for the details @lmignon!

@foutoucour foutoucour closed this Feb 4, 2018
@foutoucour foutoucour deleted the optional_merges branch February 4, 2018 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants