Package: git-aggregator
git-aggregatorManage the aggregation of git branches from different remotes to build a consolidated one.Configuration fileCreate arepos.yamlorrepos.ymlfile:./product_attribute:remotes:oca:https://github.com/OCA/product-attribute.gitacsone:git+ssh://git@github.com/acsone/product-attribute.gitmerges:-oca 8.0-oca refs/pull/105/head-oca refs/pull/106/head./connector-interfaces:remotes:oca:https://github.com/OCA/connector-interfaces.gitacsone:https://github.com/acsone/connector-interfaces.gitmerges:-oca 6054de2c4e669f85cec380da90d746061967dc83-acsone 8.0-connector_flow-acsone 80_connector_flow_ir_cron_able-lmi-acsone 8.0_connector_flow_improve_eval_configtarget:acsone aggregated_branch_namefetch_all:-ocaEnvironment variables inside of this file will be expanded if the proper option is selected.All themergesare combined into a single branch. By default this branch is called_git_aggregatedbut another name may be given in thetargetsection.Fetching only required branchesIf any of your merges refer to a specific commit, you will probably need to
fetch all remotes from the corresponding remote oruse any other strategy to
get that fetch working, but we
recommend to simply add this like in the example above:fetch_all:-oca-other-remoteYou can specify that you want to fetch all references from all remotes you have defined with:fetch_all:trueShallow repositoriesTo save big amounts of bandwidth and disk space, you can use shallow clones.
These download only a restricted amount of commits depending on some criteria.
Available options aredepth,shallow-sinceandshallow-exclude.WarningAvailable options depend on server and client Git version, be sure to use
options available for your environment.You can use those in thedefaultssections to apply them everywhere, or
specifying them in the correspondingmergessection, for which you must use
thedictalternate construction. If you need to disable a default inmerges, set it tofalse:./odoo:defaults:depth:20remotes:odoo:https://github.com/odoo/odoo.gitocb:https://github.com/OCA/OCB.gitacsone:https://github.com/acsone/odoo.gitmerges:-remote:ocbref:"9.0"depth:1000-remote:odooref:refs/pull/14859/headtarget:acsone 9.0Remember that you need to fetch at least the common ancestor of all merges for
it to succeed.TriggersIt’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.gitacsone:git+ssh://git@github.com/acsone/product-attribute.gitmerges:-oca 8.0target:acsone aggregated_branch_nameshell_command_after:echo 'my command'./connector-interfaces:remotes:oca:https://github.com/OCA/connector-interfaces.gitacsone:https://github.com/acsone/connector-interfaces.gitmerges:-oca 9.0target:acsone aggregated_branch_nameshell_command_after:-echo 'a first command'-echo 'a second command'A real life example: applying a patch./odoo:remotes:oca:https://github.com/OCA/OCB.gitacsone:git@github.com/acsone/OCB.gitmerges:-oca 9.0target:acsone aggregated_branch_nameshell_command_after:-git am "$(git format-patch -1 XXXXXX -o ../patches)"Command line UsageFollowing the examplerepos.yamlfile from above, aggregate your
repositories at any time:$gitaggregate-crepos.yamlExpand environment variables inside of the configuration file when loading:$gitaggregate-crepos.yaml--expand-envThe variables in the configuration file can be specified in one of the following ways:$VARIABLE${VARIABLE}For more information, see the Python’s string.Template documentation.Use additional variables from file while expanding:$gitaggregate-crepos.yaml--expand-env--env-file.envThe env file should containVAR=valuelines. Lines starting with # are ignored.You can also aggregate and automatically push the result to the target, if thetargetoption is configured:$gitaggregate-crepos.yaml-pOnly aggregate a specific repository usingfnmatch:$gitaggregate-crepos.yaml-p-dconnector-interfacesShow github pull requestsgitaggregate has a mechanism to identify merges that correpond
to merged or closed Github pull requests.Such merges are of the formrefs/pull/NNN/headwhere NNN is
the pull request number, with ahttps://github.comorgit@github.comremote.To work around API limitation, you must first generate aGithub API token.$exportGITHUB_TOKEN=...$gitaggregate-crepos.yamlshow-all-prs$gitaggregate-crepos.yamlshow-closed-prsChanges4.0 (2023-07-22)[BREAKING] drop support for other configuration file formats than yamlEnsure git pull is always done in fast-forward modeDrop support for python 3.6, test with python 3.11, stop testing with pypy3.0.1 (2022-09-21)Fix git clone issue with git < 2.173.0.0 (2022-09-20)When updating remotes the log message now statesUpdating remoteinstead ofRemote remoteAdd--no-coloroption to disable colored outputUse git clone –filter=blob:none + fetch strategy to improve performance and benefit fromgit-autoshareif installed2.1 (August 26, 2021)Migrate Github API authentication to new spec (https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/)2.0 (August 17, 2021)Drop support for python < 3.6Do not exit with success on KeyboardInterruptMaketargetoptional.1.8.1 (August 28, 2020)Support environment variables in the configuration file.1.7.1 (September 30, 2019)If an error happens, log in which repo it happens. Helpful when running
in parallel.1.7.0 (August 14, 2019)Fix a bug in--show-all-prs, which was printing a wrong PR URL.Display PR labels too in--show-all-prs.1.6.0 (March 04, 2019)Add –show-all-prs command to list all GitHub pull requests used
in merge sections.1.5.0 (December 07, 2018)Add –force. If set, dirty repositories will fail to aggregate.1.4.0 (September 13, 2018)Add –jobs option for multi-process operation.1.3.0 (August 21, 2018)Improve configuration file parsing by mimicing
Kaptan’s behavior of resolving handler by extension (#22)1.2.1 (July, 12, 2018)show-closed-prs now displays merge statussome documentation improvements1.2.0 (May, 17, 2017)support .yml config file extensionadd a show-closed-prs command to display github pull requests
that are not open anymore; github pull requests must be referenced
as refs/pull/NNN/head in the merges section1.1.0 (Feb, 01, 2017)Use setuptools_scm for the release process (https://github.com/acsone/git-aggregator/pull/10)Expand env vars in config. (https://github.com/acsone/git-aggregator/pull/8)Shallow repositories. (https://github.com/acsone/git-aggregator/pull/7)Fetch only required remotes. (https://github.com/acsone/git-aggregator/pull/6)Display readable error if config file not found. (https://github.com/acsone/git-aggregator/pull/2)1.0.0 (Jan, 19, 2016)First releaseCreditsAuthorLaurent Mignon (ACSONE)ContributorsAndrei BoyanovCyril Gaudin (camptocamp)Jairo Llopis (Tecnativa)Stéphane Bidoul (ACSONE)Dave Lasley (LasLabs)Patric TombezCristian MonchoSimone Orsi (camptocamp)Artem KostyukJan VerbeekMaintainerThis project is maintained by ACSONE SA/NV.