Git Plan - a better workflow for git

Overview

git plan

A better workflow for git.

Git plan inverts the git workflow so that you can write your commit message first, before you start writing code. This makes it easier to plan your work and stay on-track.

To use the tool, run git plan init (or simply gp [command]) to initialize, and then git plan add to plan a new commit. Then when you have finished writing the code, use git plan commit to use the plan as a template for your commit message.

This tool is in early alpha stage, so be careful and please make an issue or let me know if anything breaks.

Installation

python3.8 is required for now.

  1. git clone https://github.com/synek/git-plan
  2. cd git-plan
  3. make install

If you have trouble with the install, check what the Makefile is doing. Get in touch with me if you need help.

To uninstall, run make uninstall

Usage

  • git plan init - initialize git plan in the current .git/ directory
  • git plan [--long] - plan your first commit, or list existing plans
  • git plan help - show the help message
  • git plan list [--long] - list existing plans
  • git plan add - plan a new commit
  • git plan edit - edit an existing plan
  • git plan delete - delete an existing plan
  • git plan commit - commit one of your plans (launches git commit with your plan as a template)

Background

Here is an interesting blog post about pre-emptive commit comments.

Contributing

Give me a shout - [email protected] or @ryrobyrne

Comments
  • Prints error message when not in git repository

    Prints error message when not in git repository

    What does this PR do? Prints the default git message when not in a git repository: fatal: not a git repository (or any of the parent directories): .git

    Why are we doing this? To solve issue #79 and to make it more user-friendly.

    Testing performed

    • Ran the toxcommand and also the pre-commit tests. All passed ✅
    • Ran the git plan --version command which is now printing the default git error.
    • Ran the gp --version which was already printing the default message.

    Known issues

    • Had to add sys.exit() because the git plan --version command was still printing the version even if not inside a git repository.
    • I couldn't figure it out why the gp --version was not raising the RuntimeError exeception.
    opened by JBizarri 9
  • Consider using git config editor rather than a separate environment variable named EDITOR

    Consider using git config editor rather than a separate environment variable named EDITOR

    Current Situation

    git-plan looks for the user's choice of editor through an environment variable named EDITOR and if such a variable doesn't exist, it defaults to vim.

    Enhancement

    git users have their choice of editor pre-configured which can be found by running git config --global core.editor. Consider using this configuration.

    Reasoning

    Reduces the effort for users in having to setup a new environment variable when one already exists in the git domain.

    Implementation

    Look up the result of git config --global core.editor and default to vim if variable is not set.

    enhancement 
    opened by akashRindhe 3
  • What should a git plan actually look like?

    What should a git plan actually look like?

    The current template is:

    ########### PLAN SUMMARY ##################################
    
    ########### FILES #########################################
    
    ########### END ###########################################
    # Put a filename on each line
    # We'll let you know if you edit any other files
    ###########################################################
    
    discussion 
    opened by synek 3
  • The root `git plan` command should show help, instead of running a subcommand

    The root `git plan` command should show help, instead of running a subcommand

    This may be controversial, but I think that running git plan should simply trigger the help output (like git). This forces users to be explicit and type git plan list or git plan add. We could offer advice in the README on how to useful aliases for git-plan.

    discussion 
    opened by synek 2
  • Cleanly fail installation

    Cleanly fail installation

    Initial install failed...

    git-plan$ make install
    Installing to .../.local/bin
    install -d .../.local/bin
    install -m 0755 scripts/* .../.local/bin
    ln -s .../.local/bin/git-plan .../.local/bin/gp
    install -d .../.local/share/git-plan
    install -m 0644 assets/share/* .../.local/share/git-plan
    #install -d .../.local/share/systemd/user
    #install -m 0644 assets/gitplan-oracle.service .../.local/share/systemd/user
    python3.8 -m venv .../.local/share/git-plan/venv
    The virtual environment was not created successfully because ensurepip is not
    available.  On Debian/Ubuntu systems, you need to install the python3-venv
    package using the following command.
    
        apt-get install python3-venv
    
    You may need to use sudo with that command.  After installing the python3-venv
    package, recreate your virtual environment.
    
    Failing command: ['.../git-plan/venv/bin/python3.8', '-Im', 'ensurepip', '--upgrade', '--default-pip']
    

    Installed dependencies...

    git-plan$ sudo apt install python3-venv

    Subsequent install failed...

    git-plan$ make install
    ...
    .../.local/bin/gp': File exists 
    make: *** [Makefile:29: install] Error 1
    

    To resolve...

    $ make uninstall
    $ make install
    

    Installation should be simpler/rollback if fails.

    enhancement 
    opened by Stedders 2
  • feat: support python 3.10

    feat: support python 3.10

    Current Situation

    Maybe it works, but it's not being tested for.

    Enhancement

    Support python 3.10

    Reasoning

    Get the project back on it's feet

    Implementation

    Hopefully just add it to tox. Will probably also bump dependencies.

    enhancement 
    opened by synek 1
  • bug: PyPi release is broken due to a poetry error

    bug: PyPi release is broken due to a poetry error

    Describe the bug

    Can't cut a release due to CI/CD error (https://github.com/synek/git-plan/runs/7802209163?check_suite_focus=true)

    To Reproduce

    Expected behavior

    Screenshots

    Additional context

    bug 
    opened by synek 1
  • [Bug] `RuntimeError` is raised when not in a git repository

    [Bug] `RuntimeError` is raised when not in a git repository

    Describe the bug

    When running git-plan or gp outside of a git repository, a RuntimeError is shown with a stack trace.

    To Reproduce

    Steps to reproduce the behavior:

    1. pip install git-plan
    2. git-plan list (in a directory without a .git/ directory)

    Expected behavior

    A useful error message should be shown.

    There is already a NotAGitRepository Exception in the stack trace, so we should just catch that in the right place and display an error message.

    bug good first issue 
    opened by synek 1
  • [#72] Switch to poetry and add PyPi publishing

    [#72] Switch to poetry and add PyPi publishing

    What does this PR do?

    • Removes setup.py, Makefile, requirements_dev.txt, scripts/
    • Updates pyproject.toml with full info
    • Adds a new version() implementation via pkg_resources
    • Adds a new CI/CD workflow for publishing to PyPi

    Why are we doing this?

    • A better install path

    Testing performed

    • Installed locally and ran various commands (incl. --version)

    Known issues

    Notes

    Closes #72 Closes #39

    opened by synek 1
  • The installer should check for pip before starting

    The installer should check for pip before starting

    When performing a fresh install, the installer may fail on python -m pip because pip is not available.

    image

    Installation completes, but the version is empty:

    image

    bug 
    opened by synek 1
  • [#37] Simplifies installation and makes it more resilient to failure

    [#37] Simplifies installation and makes it more resilient to failure

    Installation no longer requires non-python files, and has a rollback mechanism. There are also some refactorings in the services/models, and removals of dead code.

    Closes #37, for now

    opened by synek 1
  • feat: use SQLite to store plans

    feat: use SQLite to store plans

    Current Situation

    Plans are stored as JSON files in .plan/plans/

    Enhancement

    Run an SQLite database in .plan/ which stores plans

    Reasoning

    We can benefit from SQL and potentially an ORM for managing plans

    Implementation

    Build some sort of persistence layer which executes SQL queries against the SQLite database and returns instances of Plan. The persistence layer should implement a few methods like get_by_id, get_all, update_by_id, delete_by_id, etc..

    enhancement 
    opened by synek 0
  • feat: generate IDs which can be used to reference plans

    feat: generate IDs which can be used to reference plans

    What does this PR do?

    Broadly, this PR introduces IDs/labels for plans, so that they can be referenced easily (e.g. git-plan commit --id GP-123)

    Some highlights:

    • changes the word "commit" to be "plan", across the codebase
    • updates "plan_service" to reference plans instead of commits
    • fixes a bug where plans would be filtered using the wrong variable

    Why are we doing this?

    • so that we can easily reference individual plans

    Testing performed

    Known issues

    opened by synek 0
  • feat: git plan should be able to output data in JSON to make it easier to integrate with other tools

    feat: git plan should be able to output data in JSON to make it easier to integrate with other tools

    Current Situation

    Output from git plan is in natural language.

    Enhancement

    Add --json flags to relevant commands so that output can be produced in machine-readable format.

    Reasoning

    This would make it easier for other tools to integrate with git plan. For example, Magit.

    Implementation

    Maybe the interface of the UIService could be changed to only accept some type like ResponseData. Then the UIService can render that ResponseData as either natural language or JSON output depending on whether or not --json is set.

    enhancement 
    opened by synek 0
  • feat: swappable plan providers

    feat: swappable plan providers

    I understand you probably won't develop this yourself, but wanted to put it on your/this community's radar anyway: support for this workflow in magit would be great for emacs users.

    I'm very excited that this tool exists: a few weeks ago I was looking to scratch a similar itch. I plan on trying to see how I can integrate git plan into a dev-journal-driven git work flow (which isn't so different than a github or linear-driven flow #33, #24) - hopefully this can be designed with the ability to swap in different plan providers and templates.

    discussion 
    opened by indigoviolet 3
  • feat: it should be possible to create a plan with a single command, without opening the editor

    feat: it should be possible to create a plan with a single command, without opening the editor

    Current Situation

    To create a plan, you run git plan add and then type some text into your editor.

    Enhancement

    There should be flags like git plan add -h "headline" -b "body" that you can use to create a plan instantly.

    Reasoning

    This would make it easier to quickly jot down your thoughts in the form of planned commits.

    Implementation

    It should be a simple extension of the add command to process the two new flags.

    enhancement good first issue 
    opened by synek 0
Releases(v0.2.4)
Owner
Rory Byrne
Currently @Symopsio, previously @Syze
Rory Byrne
The official Pushy SDK for Python apps.

pushy-python The official Pushy SDK for Python apps. Pushy is the most reliable push notification gateway, perfect for real-time, mission-critical app

Pushy 1 Dec 21, 2021
A telegram bot to download mega.nz links. (made with pyrogram).

Mega Link Downloader Bot This is a telegram bot to download mega.nz links and return them as files/videos - Made by a 100% noob! (When I mean noob I r

171 Dec 27, 2022
A component of BuzzUtilityBot that allows for inter-server communication

A component of BuzzUtilityBot that allows for inter-server communication! Separated due to privacy and ease of inspection concerns

OHaiiBuzzle 2 Oct 11, 2022
QR-Code-Grabber - A python script that allows a person to create a qr code token grabber

Qr Code Grabber Description Un script python qui permet a une personne de creer

5 Jun 28, 2022
Python Script to download hundreds of images from 'Google Images'. It is a ready-to-run code!

Google Images Download Python Script for 'searching' and 'downloading' hundreds of Google images to the local hard disk! Documentation Documentation H

Hardik Vasa 8.2k Jan 05, 2023
How to add reaction on message discord.py

BA / HR / RS: Python (discord.py) skripta pomocu koje dodajete reakciju na vasu poruku putem komande !v ili da se dodaje samo u nekoj odredjenoj sobi.

Seekii 3 Dec 23, 2021
Unofficial python api for MicroBT Whatsminer ASICs

whatsminer-api Unofficial python api for MicroBT Whatsminer ASICs Code adapted from a python file found in the Whatsminer Telegram group that is credi

Satoshi Anonymoto 16 Dec 23, 2022
Python written Rule34 API

Python written Rule34 API

1 Nov 11, 2021
Tiktok-bot - A Simple Tiktok bot With Python

Install the requirements pip install selenium pip install pyfiglet==0.7.5 How ca

Muchlis Faroqi 5 Aug 23, 2022
Telegram Group Chat Statistics With Python

Telegram Group Chat Statistics How to Run First add PYTHONPATH in repository root directory enviroment variable by running: export PYTHONPATH=${PWD}

Sina Nazem 3 Apr 18, 2022
Solves bombcrypto newest captcha

Solves Bombcrypto newest captcha A very compact implementation using just cv2 and ctypes, ready to be deployed to your own project. How does it work I

19 May 06, 2022
Info gathering | API hacketarget.com

InfoFetch Info gathering | API hackertarget.com set-up: apt-get install python3 pip3 install requests apt-get install git git clone https://github.com

Muhammed Rizad 4 Nov 22, 2021
Kodi script for proper Australian weather data

Kodi Oz Weather weather.ozweather Script for Kodi for high quality Australian weather data sourced directly from the BOM. Available from the Kodi offi

Jeremy Daalder 5 Nov 24, 2022
A simple library for interacting with Amazon S3.

BucketStore is a very simple Amazon S3 client, written in Python. It aims to be much more straight-forward to use than boto3, and specializes only in

Jacobi Petrucciani 219 Oct 03, 2022
Unirest in Python: Simplified, lightweight HTTP client library.

Unirest for Python Unirest is a set of lightweight HTTP libraries available in multiple languages, built and maintained by Mashape, who also maintain

Kong 432 Dec 21, 2022
Crypto Signal Provider - A web application that allows users to select a cryptocurrency

Crypto_Signal_Provider This is a web application that allows users to select a c

Raul 2 Dec 11, 2022
ARKHAM X GOD MULTISPAM BOT

ARKHAM-X-GOD-MULTISPAM-BOT 𝗗𝗘𝗣𝗟𝗢𝗬 𝗨𝗣𝗧𝗢 30 𝗕𝗢𝗧𝗦 𝗜𝗡 𝗔 𝗦𝗜𝗡𝗚𝗟?

ArkhamXGod 2 Jan 08, 2022
:cloud: Python API for ThePirateBay.

Unofficial Python API for ThePirateBay. Build Status Test Coverage Version Downloads (30 days) Installation $ pip install ThePirateBay Note that ThePi

Karan Goel 334 Oct 21, 2022
A Telegram Bot written in Python for mirroring files on the Internet to your Google Drive

No support is going to be provided of any kind, only maintaining this for vps user on request. This is a Telegram Bot written in Python for mirroring

Sunil Kumar 42 Oct 28, 2022
A Telegram bot that can stream Telegram files to users over HTTP.

T.ME_FILE_TO_LINK Hi iam a file to link bot....best Bot telegram Telegram File To Link Generation Bot A Telegram bot that can stream Telegram files to

1 Oct 24, 2021