Skip to content

LasLabs/git-aggregator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: AGPL-3

image

image

Python support: 2.7, 3.3, 3.4, 3.5

git-aggregator

Manage the aggregation of git branches from different remotes to build a consolidated one.

Configuration file

Create a repos.yaml file:

./product_attribute:
    remotes:
        oca: https://github.com/OCA/product-attribute.git
        acsone: git+ssh://git@github.com/acsone/product-attribute.git
    merges:
        - oca 8.0
        - oca refs/pull/105/head
        - oca refs/pull/106/head
    target: acsone aggregated_branch_name

./connector-interfaces:
    remotes:
        oca:  https://github.com/OCA/connector-interfaces.git
        acsone:  https://github.com/acsone/connector-interfaces.git
    merges:
        - oca 6054de2c4e669f85cec380da90d746061967dc83
        - acsone 8.0-connector_flow
        - acsone 80_connector_flow_ir_cron_able-lmi
        - acsone 8.0_connector_flow_improve_eval_config
    target: acsone aggregated_branch_name
    fetch_all:
        - oca

Fetching only required branches

If any of your merges refer to a specific commit, you will probably need to fetch all remotes from the corresponding remote or use any other strategy to get that fetch working, but we recommend to simply add this like in the example above:

fetch_all:
    - oca
    - other-remote

You can specify that you want to fetch all references from all remotes you have defined with:

fetch_all: true

Triggers

It's also possible to specify a command or a list of shell commands to execute after the aggregation (and before the push). The commands are executed into the aggregated directory.

./product_attribute:
    remotes:
    oca: https://github.com/OCA/product-attribute.git
    acsone: git+ssh://git@github.com/acsone/product-attribute.git
    merges:
        - oca 8.0
    target: acsone aggregated_branch_name
        shell_command_after: echo 'my command'

./connector-interfaces:
    remotes:
    oca:  https://github.com/OCA/connector-interfaces.git
    acsone:  https://github.com/acsone/connector-interfaces.git
    merges:
        - oca 9.0
    target: acsone aggregated_branch_name
        shell_command_after:
            - echo 'a first command'
            - echo 'a second command'

Command line Usage

Following the example repos.yaml file from above, aggregate your repositories at any time:

$ gitaggregate -c repos.yaml

You can also aggregate and automatically push the result to the target:

$ gitaggregate -c repos.yaml -p

Only aggregate a specific repository using fnmatch:

$ gitaggregate -c repos.yaml -p -d connector-interfaces

Credits

Author

  • Laurent Mignon (ACSONE)

Contributors

  • Cyril Gaudin (camptocamp)
  • Jairo Llopis (Tecnativa)

Maintainer

ACSONE SA/NV

This project is maintained by ACSONE SA/NV.

About

Manage the aggregation of git branches from different remotes to build a consolidated one.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%