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
Python Telegram bot api.

pyTelegramBotAPI A simple, but extensible Python implementation for the Telegram Bot API. Getting started. Writing your first bot Prerequisites A simp

FrankWang 6.4k Jan 09, 2023
WBMS automates sending of message to multiple numbers via WhatsApp Web

WhatsApp Bulk Message Sender - WBMS WBMS automates sending of message to multiple numbers via WhatsApp Web. Report Bug · Request Feature Love the proj

Akshay Parakh 3 Jun 26, 2022
Chatbot construido com o framework Rasa para responder dúvidas referentes ao COVID-19.

Racom Chatbot Chatbot construido com o framework Rasa. Como executar Necessário instalar Docker e Docker Compose. Para inicializar a aplicação, basta

Vinícius Souza 4 Jul 28, 2022
Local community telegram bot

Бот на районе Телеграм-бот для поиска адресов и заведений в вашем районе города или в небольшом городке. Требует недели прогулок по району д

Ilya Zverev 32 Jan 19, 2022
Unofficial Python wrapper for official Hacker News API

haxor Unofficial Python wrapper for official Hacker News API. Installation pip install haxor Usage Import and initialization: from hackernews import H

147 Sep 18, 2022
Share your files on local network just by one click.

Share Your Folder This script helps you to share any folder anywhere on your local network. it's possible to use the script on both: Windows (Click he

Mehran Seifalinia 15 Oct 23, 2022
A Rich renderable for viewing Multiple Sequence Alignments in the terminal.

rich-msa A simple module to render colorful Multiple Sequence Alignment with rich in the terminal. 🔧 Installing Install the rich-msa package directly

Martin Larralde 64 Dec 04, 2022
Python client for Arista eAPI

Arista eAPI Python Library The Python library for Arista's eAPI command API implementation provides a client API work using eAPI and communicating wit

Arista Networks EOS+ 124 Nov 23, 2022
Wrapper for shh/rsync for use with OpenFOAM and blue bear

bbsync wrapper for shh/rsync for use with OpenFOAM and blue bear About The Project bbsync is a wrapper for shh/rsync for use with OpenFOAM and blue be

1 Dec 10, 2021
Deep reinforcement learning library built on top of Neural Network Libraries

Deep Reinforcement Learning Library built on top of Neural Network Libraries NNablaRL is a deep reinforcement learning library built on top of Neural

Sony 100 Dec 14, 2022
A solution designed to extract, transform and load Chicago crime data from an RDS instance to other services in AWS.

This project is intended to implement a solution designed to extract, transform and load Chicago crime data from an RDS instance to other services in AWS.

Yesaswi Avula 1 Feb 04, 2022
Google Sheets Python API

Google Spreadsheets Python API v4 Simple interface for working with Google Sheets. Features: Open a spreadsheet by title, key or url. Read, write, and

Anton Burnashev 6.2k Dec 30, 2022
Pdisk Link Converter Telegram Bot, Convert link in a single click

Pdisk Converter Bot Make short link by using Pdisk API key Installation The Easy Way Required Variables BOT_TOKEN: Create a bot using @BotFather, and

Ayush Kumar Jaiswal 6 Jul 28, 2022
My attempt to reverse the Discord nitro token generation function.

discord-theory-I PART: I My attempt to reverse the Discord nitro token generation function. The Nitro generation tools thing is common in Discord now,

Jakom 29 Aug 14, 2022
Fetch torrent links from nyaa, according to releases by smoke index.

Nyaa - Smoke's index torrent fetcher Description This script parses the local (or online) anime release index (csv format) made by Big Smoke. And uses

Dinank 21 Jun 08, 2022
Wrapper for the Swiss Parliament API for Python

swissparlpy This module provides easy access to the data of the OData webservice of the Swiss parliament. Table of Contents Installation Usage Get tab

Stefan Oderbolz 8 Jun 13, 2022
Discord bot for playing blindfold chess.

Albin Discord bot for playing blindfold chess written in Python. Albin takes the moves from chat and pushes them on the board without showing it. TODO

8 Oct 14, 2022
Compares and analyzes GCP IAM roles.

gcp-iam-analyzer I wrote this to help in my day to day working in GCP. A lot of the time I am doing role comparisons to see which role has more permis

Jason Dyke 37 Dec 28, 2022
API para realizar parser de frases

NLP API Simple api to parse and apply some preprocessing steps in portuguses phrases (pt_BR) This api uses the great FastAPI and spaCy packages! Usage

⟠ Rodolfo De Nadai 1 Dec 28, 2021
A collection of tools for managing Jira issues for the RHODS project

RHODS-Jira-Tools A collection of tools for managing Jira issues for the RHODS project move_to_qa.py This script handles transitioning a given Jira iss

Alex Corvin 1 Sep 20, 2022