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
This repository contains free labs for setting up an entire workflow and DevOps environment from a real-world perspective in AWS

DevOps-The-Hard-Way-AWS This tutorial contains a full, real-world solution for setting up an environment that is using DevOps technologies and practic

Mike Levan 1.6k Jan 5, 2023
SaltConf21: Adding Workflow Approval to Salt

SaltConf21: Adding Workflow Approval to Salt Running To run the example, install Docker and docker-compose and run the following commands: docker-comp

SSYS Sistemas 4 Nov 24, 2021
ClearML - Auto-Magical Suite of tools to streamline your ML workflow. Experiment Manager, MLOps and Data-Management

ClearML - Auto-Magical Suite of tools to streamline your ML workflow Experiment Manager, MLOps and Data-Management ClearML Formerly known as Allegro T

ClearML 3.9k Jan 1, 2023
Build a better understanding of your data in PostgreSQL.

Data Fluent for PostgreSQL Build a better understanding of your data in PostgreSQL. The following shows an example report generated by this tool. It g

Mark Litwintschik 28 Aug 30, 2022
A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

Aran 1 Oct 13, 2021
A multipurpose bot designed to make Discord better for everyone, written in Python.

Hadum A multipurpose bot that makes Discord better for everyone Features A Fully Functional Moderation component: manage your staff, members and permi

null 1 Jan 25, 2022
Build better AWS infrastructure

Sceptre About Sceptre is a tool to drive AWS CloudFormation. It automates the mundane, repetitive and error-prone tasks, enabling you to concentrate o

sceptre 1.4k Jan 4, 2023
A better rename and convert bot with upload mode option and Auto detection

A better rename and convert bot with upload mode option and Auto detection

Code X Mania 2 Nov 9, 2021
iso6.9 is a Discord bot written in Python and is used to make your Discord experience better

iso6.9-2.6stable (debloated) iso.bot is originally made by notsniped#4573. This is a remix of iso.bot by αrchιshα#5518. iso6.9 is a Discord bot writte

Kamilla Youver 2 Jun 10, 2022
GitPython is a python library used to interact with Git repositories.

Gitoxide: A peek into the future… I started working on GitPython in 2009, back in the days when Python was 'my thing' and I had great plans with it. O

null 3.8k Jan 3, 2023
A Git Alert Bot - Github Integration for Pyrogram & Telethon

Yet Another GitAlertBot Inspired From @Pokurt's GitGram Run Bot: Local Host Git Clone Repo : For Telethon Version : git clone https://github.com/DevsE

DevsExpo 23 Oct 21, 2022
Adds a new git subcommand named "ranch".

Git Ranch This script adds ranch, a new subcommand for git that makes it easier to order 1 Gallon of Kraft Ranch Salad Dressing from Amazon. Installat

Austin T Schaffer 8 Jul 6, 2022
Sends messages to a Discord webhook whenever you make a new commit to your local git repository.

Git-Notif Sends messages to a Discord webhook whenever you make a new commit to your local git repository. Usage Just drop notifier.py into your git h

null 1 May 29, 2022
Desafio de projeto sobre Git/Github

Maçã ou Laranja? ?? Desafio Projeto Dio para Git/Github ?? Para esse primeiro repositório, decidir adicionar o primeiro algoritmo de inteligência arti

José Filipe 2 Oct 23, 2022
Official source for spanish Language Models and resources made @ BSC-TEMU within the "Plan de las Tecnologías del Lenguaje" (Plan-TL).

Spanish Language Models ???? Corpora ?? Corpora Number of documents Size (GB) BNE 201,080,084 570GB Models ?? RoBERTa-base BNE: https://huggingface.co

PlanTL-SANIDAD 203 Dec 20, 2022
Tiny Git is a simplified version of Git with only the basic functionalities to gain better understanding of git internals.

Tiny Git is a simplified version of Git with only the basic functionalities to gain better understanding of git internals. Implemented Functi

Ahmed Ayman 2 Oct 15, 2021
This is a fork of the BakeTool with some improvements that I did to have better workflow.

blender-bake-tool This is a fork of the BakeTool with some improvements that I did to have better workflow. 99.99% of work was done by BakeTool team.

Acvarium 3 Oct 4, 2022
Abandoned plan for a clone of the old Flash game Star Relic

space-grid When I was in middle school, I was a fan of the Flash game Star Relic (no longer playable in modern browsers, but it works alright in Flash

Radon Rosborough 3 Aug 23, 2021
Related resources for our EMNLP 2021 paper

Plan-then-Generate: Controlled Data-to-Text Generation via Planning Authors: Yixuan Su, David Vandyke, Sihui Wang, Yimai Fang, and Nigel Collier Code

Yixuan Su 61 Jan 3, 2023
The Ultimate FREE Machine Learning Study Plan

The Ultimate FREE Machine Learning Study Plan

Patrick Loeber (Python Engineer) 2.5k Jan 5, 2023