git-gerrit-bridge


Namegit-gerrit-bridge JSON
Version 1.2.0 PyPI version JSON
download
home_pageNone
SummaryGit subcommand to ease local branch management with gerrit.
upload_time2024-04-29 04:44:42
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords gerrit git
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Git Gerrit Bridge

[![PyPI - Version](https://img.shields.io/pypi/v/git-gerrit-bridge.svg)](https://pypi.org/project/git-gerrit-bridge)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/git-gerrit-bridge.svg)](https://pypi.org/project/git-gerrit-bridge)

-----

**Table of Contents**

- [Motivation](#motivation)
- [Usage](#usage)
- [Installation](#installation)
- [License](#license)

## Motivation
Working with git and gerrit can be done in numerous ways, just to name a few:
* No local branches and purely in detached HEAD mode
* One local branch per remote branch
* One local branch per bug/feature

Feature branches have the downside that there will be many and to keep the overview
they have to be cleaned up/deleted regularly.

Git can do this for fully integrated branches with `git branch -d <branch>`.
The issue is that often changes are purely modified in gerrit (rebase or online edits),
preventing git from detecting if a local branch is fully integrated or not (git hashes differ).

The `git gerrit` script maps local changes to remote changes and can therefore handle such situations.<br>
Let's look at an example usage.

## Usage
* Create a new local branch `topic-1`, tracking the remote `origin/development` branch:<br>
  `git gerrit new development topic-1`
* Do the implementation and commit:<br>
  `touch feature.txt`<br>
  `git add feature.txt`<br>
  `git commit -m "Added feature.txt"`
* Upload changes to gerrit (Commit chains are fine):<br>
  The remote tracking branch is automatically used as target<br>
  `git gerrit push`
* Get an overview of your changes (remote and local):<br>
  `git gerrit status`<br>
```
┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Number  ┃ Subject                                       ┃   Status    ┃ Remote Branch  ┃ Local Branch ┃
┡━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ 1000001 │ 🌐 Change only available in gerrit            │ Only Remote │ development    │              │
│ 1000003 │ 🌐 Change was edited or rebased in gerrit     │  Old Local  │ development    │ stale        │
│ 1000004 │ 🌐 Change was amended locally                 │ Old Remote  │ development    │ active       │
│ 1000009 │ 🌐 Added feature.txt                          │   In Sync   │ development    │ topic-1      │
│ 1000005 │ 🌐 Local and remote change have the same hash │   In Sync   │ feature-1      │ chain        │
│         │ ⚡ Local change not yet pushed to gerrit      │ Only Local  │ hot-fix        │ hacking      │
│ 1000006 │ 🐞 Follow up for 1000005 as commit chain      │   In Sync   │ feature-1      │ chain        │
│ 1000007 │ ❌ Change was merged in gerrit                │   Merged    │ development    │ bug123       │
│ 1000008 │ ❌ Change was abandoned in gerrit             │  Abandoned  │ development    │ bug321       │
└─────────┴───────────────────────────────────────────────┴─────────────┴────────────────┴──────────────┘
 🌐 Remote Change; ⚡ Local Change; 🐞 WIP Change; ❌ To be deleted; Click Number to open in browser
```

* Remove fully integrated branches:<br>
  `git gerrit clean`<br>
```
Cleaning 8 branches:
branch_with_no_remote  ? Commits Skipped (no remote set)
active                 1 Commits Skipped (Not yet merged)
bug123                 1 Commits Deleted
bug321                 1 Commits Deleted
chain                  2 Commits Skipped (Not yet merged)
hacking                1 Commits Skipped (Not yet pushed)
stale                  1 Commits Skipped (Not yet merged)
topic-1                1 Commits Skipped (Not yet merged)
```

Further commands are:
* `git gerrit checkout <number> <branch>`<br>
  to download and checkout a gerrit change in a new local branch
* `git gerrit rebase`<br>
  to start an interactive rebase of the local changes without rebasing on the remote.
* `git gerrit sync`<br>
  to rebase the current branch by picking remote and local changes depending on which is newer.

## Installation

```console
pip install git-gerrit-bridge
```

## License

`git-gerrit` is distributed under the terms of the [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html) license.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "git-gerrit-bridge",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "gerrit, git",
    "author": null,
    "author_email": "Bernhard Scheirle <bernhard@scheirle.de>",
    "download_url": "https://files.pythonhosted.org/packages/0b/85/929f912501fcdadc8e54eadd96b4cb6d336198a24054a92f2a45b15d9071/git_gerrit_bridge-1.2.0.tar.gz",
    "platform": null,
    "description": "# Git Gerrit Bridge\n\n[![PyPI - Version](https://img.shields.io/pypi/v/git-gerrit-bridge.svg)](https://pypi.org/project/git-gerrit-bridge)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/git-gerrit-bridge.svg)](https://pypi.org/project/git-gerrit-bridge)\n\n-----\n\n**Table of Contents**\n\n- [Motivation](#motivation)\n- [Usage](#usage)\n- [Installation](#installation)\n- [License](#license)\n\n## Motivation\nWorking with git and gerrit can be done in numerous ways, just to name a few:\n* No local branches and purely in detached HEAD mode\n* One local branch per remote branch\n* One local branch per bug/feature\n\nFeature branches have the downside that there will be many and to keep the overview\nthey have to be cleaned up/deleted regularly.\n\nGit can do this for fully integrated branches with `git branch -d <branch>`.\nThe issue is that often changes are purely modified in gerrit (rebase or online edits),\npreventing git from detecting if a local branch is fully integrated or not (git hashes differ).\n\nThe `git gerrit` script maps local changes to remote changes and can therefore handle such situations.<br>\nLet's look at an example usage.\n\n## Usage\n* Create a new local branch `topic-1`, tracking the remote `origin/development` branch:<br>\n  `git gerrit new development topic-1`\n* Do the implementation and commit:<br>\n  `touch feature.txt`<br>\n  `git add feature.txt`<br>\n  `git commit -m \"Added feature.txt\"`\n* Upload changes to gerrit (Commit chains are fine):<br>\n  The remote tracking branch is automatically used as target<br>\n  `git gerrit push`\n* Get an overview of your changes (remote and local):<br>\n  `git gerrit status`<br>\n```\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503 Number  \u2503 Subject                                       \u2503   Status    \u2503 Remote Branch  \u2503 Local Branch \u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 1000001 \u2502 \ud83c\udf10 Change only available in gerrit            \u2502 Only Remote \u2502 development    \u2502              \u2502\n\u2502 1000003 \u2502 \ud83c\udf10 Change was edited or rebased in gerrit     \u2502  Old Local  \u2502 development    \u2502 stale        \u2502\n\u2502 1000004 \u2502 \ud83c\udf10 Change was amended locally                 \u2502 Old Remote  \u2502 development    \u2502 active       \u2502\n\u2502 1000009 \u2502 \ud83c\udf10 Added feature.txt                          \u2502   In Sync   \u2502 development    \u2502 topic-1      \u2502\n\u2502 1000005 \u2502 \ud83c\udf10 Local and remote change have the same hash \u2502   In Sync   \u2502 feature-1      \u2502 chain        \u2502\n\u2502         \u2502 \u26a1 Local change not yet pushed to gerrit      \u2502 Only Local  \u2502 hot-fix        \u2502 hacking      \u2502\n\u2502 1000006 \u2502 \ud83d\udc1e Follow up for 1000005 as commit chain      \u2502   In Sync   \u2502 feature-1      \u2502 chain        \u2502\n\u2502 1000007 \u2502 \u274c Change was merged in gerrit                \u2502   Merged    \u2502 development    \u2502 bug123       \u2502\n\u2502 1000008 \u2502 \u274c Change was abandoned in gerrit             \u2502  Abandoned  \u2502 development    \u2502 bug321       \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \ud83c\udf10 Remote Change; \u26a1 Local Change; \ud83d\udc1e WIP Change; \u274c To be deleted; Click Number to open in browser\n```\n\n* Remove fully integrated branches:<br>\n  `git gerrit clean`<br>\n```\nCleaning 8 branches:\nbranch_with_no_remote  ? Commits Skipped (no remote set)\nactive                 1 Commits Skipped (Not yet merged)\nbug123                 1 Commits Deleted\nbug321                 1 Commits Deleted\nchain                  2 Commits Skipped (Not yet merged)\nhacking                1 Commits Skipped (Not yet pushed)\nstale                  1 Commits Skipped (Not yet merged)\ntopic-1                1 Commits Skipped (Not yet merged)\n```\n\nFurther commands are:\n* `git gerrit checkout <number> <branch>`<br>\n  to download and checkout a gerrit change in a new local branch\n* `git gerrit rebase`<br>\n  to start an interactive rebase of the local changes without rebasing on the remote.\n* `git gerrit sync`<br>\n  to rebase the current branch by picking remote and local changes depending on which is newer.\n\n## Installation\n\n```console\npip install git-gerrit-bridge\n```\n\n## License\n\n`git-gerrit` is distributed under the terms of the [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html) license.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Git subcommand to ease local branch management with gerrit.",
    "version": "1.2.0",
    "project_urls": {
        "Documentation": "https://github.com/Scheirle/git-gerrit-bridget#readme",
        "Issues": "https://github.com/Scheirle/git-gerrit-bridge/issues",
        "Source": "https://github.com/Scheirle/git-gerrit-bridge"
    },
    "split_keywords": [
        "gerrit",
        " git"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b64c95c32c8584f5cd8a82373b6ff9414ada001109e2f1fefa29db4a0b7d0fba",
                "md5": "695f6f3c4d310ac8f71405d172116fd9",
                "sha256": "263e7a7210906cf8f4c847b1fee0adb6b25fa51ca9c7b35bf4cedba8398295ba"
            },
            "downloads": -1,
            "filename": "git_gerrit_bridge-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "695f6f3c4d310ac8f71405d172116fd9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 28684,
            "upload_time": "2024-04-29T04:44:40",
            "upload_time_iso_8601": "2024-04-29T04:44:40.963896Z",
            "url": "https://files.pythonhosted.org/packages/b6/4c/95c32c8584f5cd8a82373b6ff9414ada001109e2f1fefa29db4a0b7d0fba/git_gerrit_bridge-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b85929f912501fcdadc8e54eadd96b4cb6d336198a24054a92f2a45b15d9071",
                "md5": "a4350ea8cd7490d106f99198ed04cc68",
                "sha256": "f1bd800464a0f26b37f4a46040b9d161b5076d53900b1eec4eac5c5b988846ea"
            },
            "downloads": -1,
            "filename": "git_gerrit_bridge-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a4350ea8cd7490d106f99198ed04cc68",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 21330,
            "upload_time": "2024-04-29T04:44:42",
            "upload_time_iso_8601": "2024-04-29T04:44:42.807152Z",
            "url": "https://files.pythonhosted.org/packages/0b/85/929f912501fcdadc8e54eadd96b4cb6d336198a24054a92f2a45b15d9071/git_gerrit_bridge-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 04:44:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Scheirle",
    "github_project": "git-gerrit-bridget#readme",
    "github_not_found": true,
    "lcname": "git-gerrit-bridge"
}
        
Elapsed time: 0.24333s