Skip to main content

GitHub entities made available as lazyload classes

Project description

gh-tt

This utility is desinged as a GitHub Command Line extension.

Install:

gh extension install thetechcollective/gh-tt

The extension requires that you have write access to projects too

Run gh tt -h to learn the syntax

The extension has three subcommands workon, wrapup and deliver.

usage: gh tt [-h] [-v] {workon,wrapup,deliver} ...

positional arguments:
  {workon,wrapup,deliver}
    workon              Set the issue number context to work on
    wrapup              Collapse dev branch into one commit, check or set the commit message
    deliver             Create the pull request for the current issue. Rebase and push the branch

options:
  -h, --help       show this help message and exit
  -v, --verbose    Enable verbose output

--help

You can always use the switch --help to learn details about a specific syntax

--verbose

You can always use the switch --verbose to have the extensions print out all underlying calls to the OS.

gh workon

workon takes an --issue switch. you can use if you want to work on a specific issue in the current repo

E.g. gh workon --issue 13

Or you can use the --title switch if you want to work on an issue that doesn't yet exist, you apply the title for the issue you want created.

e.g. gh workon --title "Some new issue"

usage: gh tt workon [-h] [-v] [-i ISSUE | -t TITLE]

options:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose output
  -i ISSUE, --issue ISSUE
                        Issue number
  -t TITLE, --title TITLE
                        Title for the new issue

In either case you will end up on a development branch referencing the issue. If a branch already exist either locally or remote, you'll reuse that if not a new branch will be created on the issue.

Workon will set the Status in the GitHub Project to In Progress and the Start date to today.

gh wrapup

usage: gh tt wrapup [-h] [-v] 
options:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose output

wrapup will collapse you current branch into just one commit, and make sure that the commit message contains one of the closing keywords (e.g. "resolves #") so the issue will be closed when the commit arrives at the default branch (main).

In order to deliver you should be aware that a rebase against the default branch (main) is also needed, but it's not included in the automated wrapup process, simply because this is potentially an operation that will change the content of your branch. For that reason you should take full responsibility of that process yourself. In other words make it a habit to run rebase before the wrapup:

git rebase main
gh tt wrapup

gh deliver

usage: gh tt deliver [-h] [-v] [--title TITLE]

options:
  -h, --help     show this help message and exit
  -v, --verbose  Enable verbose output
  --title TITLE  Title for the pull request - default is the issue title

deliver will try to rebase your branch and push it to origin if it succeeds it will create a pull request on the branch - if it doesnt exist already.

Feature request and discussions

The Issues are open on the repo: thetechcollective.gh-tt. If you experiencve any erros, misbekaviour or if you have feature requests, feel free to join the discussion.

Note

It's written in Python and runs in a pipenv so it doesn't leave any footprint or alterization to your own, current Python setup. All requirements besides python3 are managed independenly by the script itself.

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

ghobjects-0.0.2.dev1.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ghobjects-0.0.2.dev1-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file ghobjects-0.0.2.dev1.tar.gz.

File metadata

  • Download URL: ghobjects-0.0.2.dev1.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.10

File hashes

Hashes for ghobjects-0.0.2.dev1.tar.gz
Algorithm Hash digest
SHA256 cb42227735c796af4bc374d9af9891c0274cee2016d2880e16d20adafc2c8b2d
MD5 4ebfd7d99a3928b9eee9aa3e64b9eb1e
BLAKE2b-256 0497ca17bb96cfdfa0e7a128510db331a826056275cdda0e76e296342075ad94

See more details on using hashes here.

File details

Details for the file ghobjects-0.0.2.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for ghobjects-0.0.2.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 3264831a01bfea02d61d594e602654735e4b9f02a4e72b3d0667ec7d295b774a
MD5 e115352eaf5904e76af0f68f6d490872
BLAKE2b-256 db2d989756db5600471efd0f0d414d0a5bf4e5f694b407e76aae0aa493297e07

See more details on using hashes here.

Supported by

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