Skip to main content

No project description provided

Project description

GitRange

Git is confusing. Most of us know the basics, but we all have to Google for specific incantations from time to time. If you haven't used a different VCS, like Mercurial, then you may not realize that this Googling for these somewhat common things isn't normal or necessary--that it's a consequence of Git's inconsistent UI.

GitRange (gr) attempts to bring some of that consistency to git by providing a common syntax for specifying git commit ranges and passing those ranges to a git subcommand.

Usage

USAGE: gr <selector> [<git-command>] [<git-command-args>]

  Invoke a git command with a more sane range-selection syntax.

SELECTORS

  -b, --branch <commit-id>  A range of commits from <commit-id> to the common
                            ancestor of <commit-id> and `master`.

  -c, --commit <commit-id>  Exactly the commit identified by <commit-id>.

COMMIT ID SYNTAX

  `.`, `0`                  The current commit.

  <branch-name>             The name of the git branch. Resolves to the
                            branch's tip.

  <commit-sha>              A git commit sha.

  <tag>                     A git tag.

  (nonpositive integers)    A relative number of parent commits from `.`.
                            Positive integers are an error.

OTHER ARGUMENTS

  git-command               The git command to invoke with the range resulting
                            from the provided selector. If this is missing, the
                            range will be printed directly (useful for
                            debugging). This should not include the "git"
                            (e.g., "log", not "git log").

  git-command-args          The arguments to the git command. These will be
                            passed to <git-command> before the range.

EXAMPLES

  Log all changes in a branch:

    $ gr -b my-feature-branch log

  Log all changes in the current branch

    $ gr -b . log

  Diff a single changeset (against its parent):

    $ gr -c <git-sha1> diff

  Diff the current changeset (against its parent):

    $ gr -c . diff

  Diff an entire branch

    $ gr -b my-feature-branch diff

  Diff the current branch up to the parent commit

    $ gr -b -1 diff
    diff --git a/bar b/bar
    new file mode 100644
    index 0000000000..e69de29bb2
    diff --git a/foo b/foo
    new file mode 100644
    index 0000000000..e69de29bb2

  Pass other arguments

    $ gr -b . log --oneline --graph --decorate
    * dd6e2ccff4 (HEAD -> my-feature-branch) Removed foo and bar
    * 357bc24de5 Added bar
    * 8dd48a84d0 Added foo

  Debug a range

    $ gr -c .
    HEAD~1..HEAD

Contributing

All pull requests must pass the CI checks. These include mypy --strict and black --check for all Python files. Further, this README.md is generated by gen/mkreadme.py. Instead of editing it directly, edit gen/README.md (the template file used to generate it).

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

gitrange-0.0.4.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

gitrange-0.0.4-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file gitrange-0.0.4.tar.gz.

File metadata

  • Download URL: gitrange-0.0.4.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

File hashes

Hashes for gitrange-0.0.4.tar.gz
Algorithm Hash digest
SHA256 80c23c4baadeee43a8ccf00fb20abf6ba90bdf95c3a5846012cce00e09740178
MD5 27142b1cdd07dbd21c98bcde2b0397ac
BLAKE2b-256 49176e48d1513451e123af539ab80707385760f62df97090407e6d3be8f3b41f

See more details on using hashes here.

File details

Details for the file gitrange-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: gitrange-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

File hashes

Hashes for gitrange-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 da21a85d906660b9b453f95635d7983bf4aba7c98c91a50034015b31a1bd7958
MD5 4496bedfe48683f0f8b54b50621ab53d
BLAKE2b-256 c1e68f6df2b7b5c427ca68ed94ebee05e3771133df889efe0e67a27cb94d12b7

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