git-dummy


Namegit-dummy JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://initialcommit.com/tools/git-dummy
SummaryGenerate dummy Git repositories populated with the desired number of commits, branches, and structure.
upload_time2023-09-15 22:43:42
maintainer
docs_urlNone
authorJacob Stopak
requires_python>=3.7
license
keywords git dummy generate populate repo repository
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # git-dummy
[![GitHub license](https://img.shields.io/github/license/initialcommit-com/git-dummy)](https://github.com/initialcommit-com/git-dummy/blob/main/LICENSE)
[![GitHub tag](https://img.shields.io/github/v/release/initialcommit-com/git-dummy)](https://img.shields.io/github/v/release/initialcommit-com/git-dummy)
[![Downloads](https://static.pepy.tech/badge/git-dummy)](https://pepy.tech/project/git-dummy)
[![Contributors](https://img.shields.io/github/contributors/initialcommit-com/git-dummy)](https://github.com/initialcommit-com/git-dummy/graphs/contributors)
[![Share](https://img.shields.io/twitter/url?label=Share&url=https%3A%2F%2Ftwitter.com%2Finitcommit)](https://twitter.com/intent/tweet?text=Check%20out%20git%2Ddummy%20%2D%20a%20tool%20to%20generate%20dummy%20Git%20repos%20populated%20with%20the%20desired%20number%20of%20commits,%20branches,%20and%20structure,%20by%20%40initcommit!%20https%3A%2F%2Fgithub%2Ecom%2Finitialcommit%2Dcom%2Fgit%2Ddummy)

Generate dummy Git repositories and populate them with the desired number of commits, branches, merges, and structure.

Example: `$ git-dummy --commits=10 --branches=4 --merge=1`

This will initialize a new Git repo in the current directory with 4 branches, each containing 10 commits, 1 of which is merged back into `main`.

Note: All generated dummy repos have at minimum 1 branch called `main`. For dummies with multiple branches, branches are named `branch1, branch2, ..., branchN`. Each branch currently branches off of `main` at `--diverge-at` if supplied, or else a randomly chosen commit. The length of each branch is capped at the number of commits specified by `--commits`. Use `--merge=x,y,...,n` to select which branches get merged back into `main`. 

## Use cases
- Programatically generate Git repos for functional testing of Git tools
- Decide how many commits and branches are generated
- Select which branches get merged back into `main`
- Mimic scenarios in real Git repos to practice on without touching real data
- Generate Git demo repos to teach or learn from

## Features
- Run a one-liner git-dummy command in the terminal to generate a dummy Git repo based on your parameters
- Customize the repo name, path, number of commits, branches, merges, and structure

## Quickstart

1) Install `git-dummy`:

```console
$ pip install git-dummy
```

2) Browse to the directory you want to create your dummy Git repo in:

```console
$ cd path/to/dummy/parent
```

3) Run the program:

```console
$ git-dummy [options]
```

4) A new Git repo called `dummy` will be initialized and populated based on the supplied parameters.

5) See global help for list of global options/flags and subcommands:

```console
$ git-dummy -h
```

## Requirements
* Python 3.7 or greater
* Pip (Package manager for Python)

## Command options and flags
Available options and flags include:

`--name`: The name of the dummy Git repo, defaults to "dummy".  
`--commits`: The number of commits to populate in the dummy Git repo, defaults to 5.  
`--branches`: The number of branches to generate in the dummy Git repo, defaults to 1.  
`--diverge-at`: The commit number at which branches diverge from `main`.  
`--merge`: A comma separated list of branch postfix ids to merge back into `main`.  
`--git-dir`: The path at which to store the dummy Git repo, defaults to current directory.  
`--no-subdir`: Initialize the dummy Git repo in the current directory instead of in a subdirectory.  
`--constant_sha`: Use constant values for commit author, email, and commit date parameters to yield consistent sha1 values across git-dummy runs.  
`--allow-nested`: Allow dummy repo creation within an existing Git repo, as long as it's not at the level of an existing .git/ folder.

## Command examples
Generate a dummy Git repo called "cheese" on your Desktop, with 2 branches and 10 commits on each branch:

```console
$ git-dummy --name=cheese --branches=2 --commits=10 --git-dir=~/Desktop
```

Generate a dummy repo with 4 branches `main`, `branch1`, `branch2`, and `branch3`. Branches diverge from `main` after the 2nd commit:

```console
$ git-dummy --branches=4 --diverge-at=2
```

Generate a dummy repo with 4 branches, so that `branch1` and `branch3` are merged back into `main`:

```console
$ git-dummy --branches=4 --merge=1,3
```

For convenience, environment variables can be set for any command-line option available in git-dummy. All environment variables start with `git_dummy_` followed by the name of the option.

For example, the `--git-dir` option can be set as an environment variable like:

```console
$ export git_dummy_git_dir=~/Desktop
```

Similarly, the `--name` option can be set like:

```console
$ export git_dummy_name=cheese
```

In general:

```console
$ export git_dummy_option_name=option_value
```

Explicitly specifying options at the command-line takes precedence over the corresponding environment variable values.

## Learn More
Learn more about this tool on the [git-dummy project page](https://initialcommit.com/tools/git-dummy).

## Authors
**Jacob Stopak** - on behalf of [Initial Commit](https://initialcommit.com)

            

Raw data

            {
    "_id": null,
    "home_page": "https://initialcommit.com/tools/git-dummy",
    "name": "git-dummy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "git dummy generate populate repo repository",
    "author": "Jacob Stopak",
    "author_email": "jacob@initialcommit.io",
    "download_url": "https://files.pythonhosted.org/packages/37/dc/65bf27e9e6e157847e7a664b1d89a4948282a38bc1be5b5228f9c60629ae/git-dummy-0.1.2.tar.gz",
    "platform": null,
    "description": "# git-dummy\r\n[![GitHub license](https://img.shields.io/github/license/initialcommit-com/git-dummy)](https://github.com/initialcommit-com/git-dummy/blob/main/LICENSE)\r\n[![GitHub tag](https://img.shields.io/github/v/release/initialcommit-com/git-dummy)](https://img.shields.io/github/v/release/initialcommit-com/git-dummy)\r\n[![Downloads](https://static.pepy.tech/badge/git-dummy)](https://pepy.tech/project/git-dummy)\r\n[![Contributors](https://img.shields.io/github/contributors/initialcommit-com/git-dummy)](https://github.com/initialcommit-com/git-dummy/graphs/contributors)\r\n[![Share](https://img.shields.io/twitter/url?label=Share&url=https%3A%2F%2Ftwitter.com%2Finitcommit)](https://twitter.com/intent/tweet?text=Check%20out%20git%2Ddummy%20%2D%20a%20tool%20to%20generate%20dummy%20Git%20repos%20populated%20with%20the%20desired%20number%20of%20commits,%20branches,%20and%20structure,%20by%20%40initcommit!%20https%3A%2F%2Fgithub%2Ecom%2Finitialcommit%2Dcom%2Fgit%2Ddummy)\r\n\r\nGenerate dummy Git repositories and populate them with the desired number of commits, branches, merges, and structure.\r\n\r\nExample: `$ git-dummy --commits=10 --branches=4 --merge=1`\r\n\r\nThis will initialize a new Git repo in the current directory with 4 branches, each containing 10 commits, 1 of which is merged back into `main`.\r\n\r\nNote: All generated dummy repos have at minimum 1 branch called `main`. For dummies with multiple branches, branches are named `branch1, branch2, ..., branchN`. Each branch currently branches off of `main` at `--diverge-at` if supplied, or else a randomly chosen commit. The length of each branch is capped at the number of commits specified by `--commits`. Use `--merge=x,y,...,n` to select which branches get merged back into `main`. \r\n\r\n## Use cases\r\n- Programatically generate Git repos for functional testing of Git tools\r\n- Decide how many commits and branches are generated\r\n- Select which branches get merged back into `main`\r\n- Mimic scenarios in real Git repos to practice on without touching real data\r\n- Generate Git demo repos to teach or learn from\r\n\r\n## Features\r\n- Run a one-liner git-dummy command in the terminal to generate a dummy Git repo based on your parameters\r\n- Customize the repo name, path, number of commits, branches, merges, and structure\r\n\r\n## Quickstart\r\n\r\n1) Install `git-dummy`:\r\n\r\n```console\r\n$ pip install git-dummy\r\n```\r\n\r\n2) Browse to the directory you want to create your dummy Git repo in:\r\n\r\n```console\r\n$ cd path/to/dummy/parent\r\n```\r\n\r\n3) Run the program:\r\n\r\n```console\r\n$ git-dummy [options]\r\n```\r\n\r\n4) A new Git repo called `dummy` will be initialized and populated based on the supplied parameters.\r\n\r\n5) See global help for list of global options/flags and subcommands:\r\n\r\n```console\r\n$ git-dummy -h\r\n```\r\n\r\n## Requirements\r\n* Python 3.7 or greater\r\n* Pip (Package manager for Python)\r\n\r\n## Command options and flags\r\nAvailable options and flags include:\r\n\r\n`--name`: The name of the dummy Git repo, defaults to \"dummy\".  \r\n`--commits`: The number of commits to populate in the dummy Git repo, defaults to 5.  \r\n`--branches`: The number of branches to generate in the dummy Git repo, defaults to 1.  \r\n`--diverge-at`: The commit number at which branches diverge from `main`.  \r\n`--merge`: A comma separated list of branch postfix ids to merge back into `main`.  \r\n`--git-dir`: The path at which to store the dummy Git repo, defaults to current directory.  \r\n`--no-subdir`: Initialize the dummy Git repo in the current directory instead of in a subdirectory.  \r\n`--constant_sha`: Use constant values for commit author, email, and commit date parameters to yield consistent sha1 values across git-dummy runs.  \r\n`--allow-nested`: Allow dummy repo creation within an existing Git repo, as long as it's not at the level of an existing .git/ folder.\r\n\r\n## Command examples\r\nGenerate a dummy Git repo called \"cheese\" on your Desktop, with 2 branches and 10 commits on each branch:\r\n\r\n```console\r\n$ git-dummy --name=cheese --branches=2 --commits=10 --git-dir=~/Desktop\r\n```\r\n\r\nGenerate a dummy repo with 4 branches `main`, `branch1`, `branch2`, and `branch3`. Branches diverge from `main` after the 2nd commit:\r\n\r\n```console\r\n$ git-dummy --branches=4 --diverge-at=2\r\n```\r\n\r\nGenerate a dummy repo with 4 branches, so that `branch1` and `branch3` are merged back into `main`:\r\n\r\n```console\r\n$ git-dummy --branches=4 --merge=1,3\r\n```\r\n\r\nFor convenience, environment variables can be set for any command-line option available in git-dummy. All environment variables start with `git_dummy_` followed by the name of the option.\r\n\r\nFor example, the `--git-dir` option can be set as an environment variable like:\r\n\r\n```console\r\n$ export git_dummy_git_dir=~/Desktop\r\n```\r\n\r\nSimilarly, the `--name` option can be set like:\r\n\r\n```console\r\n$ export git_dummy_name=cheese\r\n```\r\n\r\nIn general:\r\n\r\n```console\r\n$ export git_dummy_option_name=option_value\r\n```\r\n\r\nExplicitly specifying options at the command-line takes precedence over the corresponding environment variable values.\r\n\r\n## Learn More\r\nLearn more about this tool on the [git-dummy project page](https://initialcommit.com/tools/git-dummy).\r\n\r\n## Authors\r\n**Jacob Stopak** - on behalf of [Initial Commit](https://initialcommit.com)\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Generate dummy Git repositories populated with the desired number of commits, branches, and structure.",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://initialcommit.com/tools/git-dummy",
        "Source": "https://github.com/initialcommit-com/git-dummy"
    },
    "split_keywords": [
        "git",
        "dummy",
        "generate",
        "populate",
        "repo",
        "repository"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a8700a3806df49bcebf3e2878f64dac1b421ffd2c31589506b7a8ad422f01aa8",
                "md5": "42c54d8e1ff1575da050757c9a472dc6",
                "sha256": "2b484ff3f5b9fb6b2906fa939d53afa2a9295e8d8f71e3e1243f2e70e4ed7491"
            },
            "downloads": -1,
            "filename": "git_dummy-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "42c54d8e1ff1575da050757c9a472dc6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 13392,
            "upload_time": "2023-09-15T22:43:41",
            "upload_time_iso_8601": "2023-09-15T22:43:41.242744Z",
            "url": "https://files.pythonhosted.org/packages/a8/70/0a3806df49bcebf3e2878f64dac1b421ffd2c31589506b7a8ad422f01aa8/git_dummy-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "37dc65bf27e9e6e157847e7a664b1d89a4948282a38bc1be5b5228f9c60629ae",
                "md5": "25e9372705b548127d3e100bfe7c4650",
                "sha256": "1948ccc8725f11689a3eefddfd1917df1ed6f199290906bf1d1246cd38c03765"
            },
            "downloads": -1,
            "filename": "git-dummy-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "25e9372705b548127d3e100bfe7c4650",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12342,
            "upload_time": "2023-09-15T22:43:42",
            "upload_time_iso_8601": "2023-09-15T22:43:42.604513Z",
            "url": "https://files.pythonhosted.org/packages/37/dc/65bf27e9e6e157847e7a664b1d89a4948282a38bc1be5b5228f9c60629ae/git-dummy-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-15 22:43:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "initialcommit-com",
    "github_project": "git-dummy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "git-dummy"
}
        
Elapsed time: 0.11867s