gimera


Namegimera JSON
Version 0.7.84 PyPI version JSON
download
home_pagehttps://github.com/marcwimmer/gimera
SummaryHandling git submodules and patches per yml
upload_time2024-11-07 20:03:14
maintainerNone
docs_urlNone
authorMarc-Christian Wimmer
requires_python>=3.6.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Welcome to GIMERA

Advanced handling of submodules by integrating them or handling as submodules as you know
but provide auto merge functions of hotfixes from other repositories or inside.

Rule of thumb:

 * no data is lost, it is safe to call gimera.
If there are staged files, gimera wont continue.

During run of gimera commits are done for example after pulling submodules or updating
local paths.


## How to install:

```bash
pipx install gimera
gimera completion  (Follow instructions)
```



## How to use:

Put gimera.yml into your root folder of your project:

```yaml
common:
  vars:
    VERSION: '15.0'
repos:
    # make ordinary git submodule:
    - url: "https://github.com/foo/bar"
      branch: branch1_${VERSION}
      path: roles/sub1
      patches: []
      type: submodule

      # default True
      enabled: True
      # if true, then on gimera apply -u the SHA is not updated
      freeze_sha: False


    # instead of submodule put the content directly in the repository;
    # apply patches from local git repository
    - url: "https://github.com/foo/bar"
      branch: branch1
      path: roles2/sub1
      patches:
          - 'roles2/sub1_patches'
      type: integrated
      ignored_patchfiles:
        - file1.patch
        - roles2/sub1_patches/file1.patch

    # apply patches from another remote repository
    #
    - url: "https://github.com/foo/bar"
      branch: branch1
      path: roles2/sub1
      remotes:
          remote2: https://github.com/foo2/bar2
      merges:
          - remote2 main
          - origin refs/pull/1/head
      type: integrated

```

Patches and remote merges may be combined.

Then execute:

```bash
gimera apply
```

## How to make a patchfile:

From the example above:

  * edit roles2/sub1/file1.txt

```bash
gimera apply
```

Then a patch file is created as suggestion in roles2/sub1_patches which you may commit and push.

### Re-Edit patch file:

```bash
gimera edit-patch file1.patch file2.patch
```

  * by this, you can combine several patch files into one again


## How to fetch only one or more repo:

```bash
gimera apply repo_path repo_path2 repo_path3`
```
## How to fetch latest versions:

```bash
gimera apply --update
```

Latest versions are pulled and patches are applied.

## Force Integrated or Submodule mode for repo and subrepositories

Use Case: you have an integrated repository. Now you want to turn it into submodule,
to easily commit and push changes. Then you do:

```bash
gimera apply <path> -S
```

Now although it is configured as integrated, it is now a submodule.

After that you can go back to default settings or force integrated mode.
You should call update to pull the latest version.

```bash
gimera apply <path> -I --update
```

## Deliver Patches with reused submodules.

In the submodule:
```yaml
gimera.yml

common:
  patches:
    - patches/${VERSION}

```

The main gimera which integrates the submodule should be:
```yaml
common:
  vars:
    VERSION: 15.0
repos:
  type: integrated
  url: .....
  path: sub1
```

After that a recursive gimera is required.
```
gimera apply -r
```

### Note:

This way is ok for small sized patches. If patches grow and grow one useful recommendation is to use
github workflows to rebase version branches from main automatically again and apply all changes.

This is a sample workflow github:
```
name: Deploy fixes to other versions with rebase main

on:
  push:
    branches:
      - main

permissions: write-all

jobs:
  deploy-subversions:
    uses: Odoo-Ninjas/git-workflows/.github/workflows/deploy_to_subversions.yml@v1
    with:
      branches: "11.0 12.0 13.0 14.0 15.0 16.0"
```


# Demo Videos

## Edit existing patch file and update it

[![Patching Gimera]](https://youtu.be/WQU9db5z9IY)


## gimera commit command

Case: you change code inside an integrated submodule and want to easily commit this.
Just do

```
git commit path branch message
```

How it works:
  * a patch file is created
  * the repo is cloned
  * patch file is applied
  * if something conflicts, then it is reported and you have to decide what to do

## Some environment variables

  * GIMERA_NON_THREADED=1 - non threaded fetch
  * GIMERA_IGNORE_FETCH_ERRORS=1 - ignore any fetch error at fetch
  * GIMERA_NO_SHA_UPDATE=1 - no shas updated in gimera file

## Authors:
  * Marc Wimmer (marc@zebroo.de)

## Contributors
  * Michael Tietz (mtietz@mt-software.de)
  * Walter Saltzmann


## install directly

```bash
pip install git+https://github.com/marcwimmer/gimera
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/marcwimmer/gimera",
    "name": "gimera",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6.0",
    "maintainer_email": null,
    "keywords": null,
    "author": "Marc-Christian Wimmer",
    "author_email": "marc@zebroo.de",
    "download_url": "https://files.pythonhosted.org/packages/bd/d5/9328ee0e6069d5b827fe1b67bc9d57316b39d6e57cbdcf33120332916b77/gimera-0.7.84.tar.gz",
    "platform": null,
    "description": "\n# Welcome to GIMERA\n\nAdvanced handling of submodules by integrating them or handling as submodules as you know\nbut provide auto merge functions of hotfixes from other repositories or inside.\n\nRule of thumb:\n\n * no data is lost, it is safe to call gimera.\nIf there are staged files, gimera wont continue.\n\nDuring run of gimera commits are done for example after pulling submodules or updating\nlocal paths.\n\n\n## How to install:\n\n```bash\npipx install gimera\ngimera completion  (Follow instructions)\n```\n\n\n\n## How to use:\n\nPut gimera.yml into your root folder of your project:\n\n```yaml\ncommon:\n  vars:\n    VERSION: '15.0'\nrepos:\n    # make ordinary git submodule:\n    - url: \"https://github.com/foo/bar\"\n      branch: branch1_${VERSION}\n      path: roles/sub1\n      patches: []\n      type: submodule\n\n      # default True\n      enabled: True\n      # if true, then on gimera apply -u the SHA is not updated\n      freeze_sha: False\n\n\n    # instead of submodule put the content directly in the repository;\n    # apply patches from local git repository\n    - url: \"https://github.com/foo/bar\"\n      branch: branch1\n      path: roles2/sub1\n      patches:\n          - 'roles2/sub1_patches'\n      type: integrated\n      ignored_patchfiles:\n        - file1.patch\n        - roles2/sub1_patches/file1.patch\n\n    # apply patches from another remote repository\n    #\n    - url: \"https://github.com/foo/bar\"\n      branch: branch1\n      path: roles2/sub1\n      remotes:\n          remote2: https://github.com/foo2/bar2\n      merges:\n          - remote2 main\n          - origin refs/pull/1/head\n      type: integrated\n\n```\n\nPatches and remote merges may be combined.\n\nThen execute:\n\n```bash\ngimera apply\n```\n\n## How to make a patchfile:\n\nFrom the example above:\n\n  * edit roles2/sub1/file1.txt\n\n```bash\ngimera apply\n```\n\nThen a patch file is created as suggestion in roles2/sub1_patches which you may commit and push.\n\n### Re-Edit patch file:\n\n```bash\ngimera edit-patch file1.patch file2.patch\n```\n\n  * by this, you can combine several patch files into one again\n\n\n## How to fetch only one or more repo:\n\n```bash\ngimera apply repo_path repo_path2 repo_path3`\n```\n## How to fetch latest versions:\n\n```bash\ngimera apply --update\n```\n\nLatest versions are pulled and patches are applied.\n\n## Force Integrated or Submodule mode for repo and subrepositories\n\nUse Case: you have an integrated repository. Now you want to turn it into submodule,\nto easily commit and push changes. Then you do:\n\n```bash\ngimera apply <path> -S\n```\n\nNow although it is configured as integrated, it is now a submodule.\n\nAfter that you can go back to default settings or force integrated mode.\nYou should call update to pull the latest version.\n\n```bash\ngimera apply <path> -I --update\n```\n\n## Deliver Patches with reused submodules.\n\nIn the submodule:\n```yaml\ngimera.yml\n\ncommon:\n  patches:\n    - patches/${VERSION}\n\n```\n\nThe main gimera which integrates the submodule should be:\n```yaml\ncommon:\n  vars:\n    VERSION: 15.0\nrepos:\n  type: integrated\n  url: .....\n  path: sub1\n```\n\nAfter that a recursive gimera is required.\n```\ngimera apply -r\n```\n\n### Note:\n\nThis way is ok for small sized patches. If patches grow and grow one useful recommendation is to use\ngithub workflows to rebase version branches from main automatically again and apply all changes.\n\nThis is a sample workflow github:\n```\nname: Deploy fixes to other versions with rebase main\n\non:\n  push:\n    branches:\n      - main\n\npermissions: write-all\n\njobs:\n  deploy-subversions:\n    uses: Odoo-Ninjas/git-workflows/.github/workflows/deploy_to_subversions.yml@v1\n    with:\n      branches: \"11.0 12.0 13.0 14.0 15.0 16.0\"\n```\n\n\n# Demo Videos\n\n## Edit existing patch file and update it\n\n[![Patching Gimera]](https://youtu.be/WQU9db5z9IY)\n\n\n## gimera commit command\n\nCase: you change code inside an integrated submodule and want to easily commit this.\nJust do\n\n```\ngit commit path branch message\n```\n\nHow it works:\n  * a patch file is created\n  * the repo is cloned\n  * patch file is applied\n  * if something conflicts, then it is reported and you have to decide what to do\n\n## Some environment variables\n\n  * GIMERA_NON_THREADED=1 - non threaded fetch\n  * GIMERA_IGNORE_FETCH_ERRORS=1 - ignore any fetch error at fetch\n  * GIMERA_NO_SHA_UPDATE=1 - no shas updated in gimera file\n\n## Authors:\n  * Marc Wimmer (marc@zebroo.de)\n\n## Contributors\n  * Michael Tietz (mtietz@mt-software.de)\n  * Walter Saltzmann\n\n\n## install directly\n\n```bash\npip install git+https://github.com/marcwimmer/gimera\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Handling git submodules and patches per yml",
    "version": "0.7.84",
    "project_urls": {
        "Homepage": "https://github.com/marcwimmer/gimera"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bdd59328ee0e6069d5b827fe1b67bc9d57316b39d6e57cbdcf33120332916b77",
                "md5": "4a4a5a509ca4957af97c0a5c57f1cc2b",
                "sha256": "0a5090bb6c50a2e1fafba2e2ec7d8a947ffcc43814839369323c671afc6d2c89"
            },
            "downloads": -1,
            "filename": "gimera-0.7.84.tar.gz",
            "has_sig": false,
            "md5_digest": "4a4a5a509ca4957af97c0a5c57f1cc2b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6.0",
            "size": 36280,
            "upload_time": "2024-11-07T20:03:14",
            "upload_time_iso_8601": "2024-11-07T20:03:14.695027Z",
            "url": "https://files.pythonhosted.org/packages/bd/d5/9328ee0e6069d5b827fe1b67bc9d57316b39d6e57cbdcf33120332916b77/gimera-0.7.84.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-07 20:03:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "marcwimmer",
    "github_project": "gimera",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gimera"
}
        
Elapsed time: 0.51421s