Skip to main content

Git subcommand to ease local branch management with gerrit.

Project description

Git Gerrit Bridge

PyPI - Version PyPI - Python Version


Table of Contents

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 with this 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.
Let's look at an example usage.

Usage

  • Create a new local branch feature-123, tracking the remote origin/development branch:
    git gerrit new development feature-123
  • Do the implementation and commit:
    touch feature.txt
    git add feature.txt
    git commit -m "Added feature.txt"
  • Upload changes to gerrit (Commit chains are fine):
    The remote tracking branch is automatically used as target
    git gerrit push
  • Get an overview of your changes (remote and local):
    git gerrit status
    [TODO add output]
  • Remove fully integrated branches:
    git gerrit clean
    [TODO add output]

Further commands are:

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

Installation

pip install git-gerrit-bridge

License

git-gerrit is distributed under the terms of the GPL-3.0-or-later license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_gerrit_bridge-1.0.1.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

git_gerrit_bridge-1.0.1-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file git_gerrit_bridge-1.0.1.tar.gz.

File metadata

  • Download URL: git_gerrit_bridge-1.0.1.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for git_gerrit_bridge-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9e563d7883713b3a0574d9ce4e60e202fd6c7f55698675e5cbbf9c978a3d5a54
MD5 3addeb2750f89a6490f2a6822ff81197
BLAKE2b-256 223b909048fdcf311efbaa0f4b5b234e673e15dc7e2d37942aa3c706542548ae

See more details on using hashes here.

File details

Details for the file git_gerrit_bridge-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for git_gerrit_bridge-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 696e61379540f1e7c6b5551cfde0d5de7a1ef230d513afcb390792b43bca2fb4
MD5 32a9cc862a30402d1025a13311a7595c
BLAKE2b-256 571aef068e030f6238df6c796424e838829635c374d9184ada650004de704596

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page