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
A plugin for modmail-bot for stealing,making ,etc emojis

EmojiPlugin for the Modmail-bot My first plugin .. its very Basic I will make more and better too Only 3 commands for now emojiadd-supports .jpg, .png

1 Dec 28, 2021
Prisma Cloud utility scripts, and a Python SDK for Prisma Cloud APIs.

pcs-toolbox Prisma Cloud utility scripts, and a Python SDK for Prisma Cloud APIs. Table of Contents Support Setup Configuration Script Usage CSPM Scri

Palo Alto Networks 34 Dec 15, 2022
🚧 finCLI's own News API. No more limited API calls. Unlimited credible and latest information on BTC, Ethereum, Indian and Global Finance.

🚧 finCLI's own News API. No more limited API calls. Unlimited credible and latest information on BTC, Ethereum, Indian and Global Finance.

finCLI 5 Jun 16, 2022
A discord webhook client written in Python.

DiscordWebhook A discord webhook client written in Python. Installation pip install webhook-client Example from webhook_client import WebhookClient, E

Elijah 4 Nov 28, 2022
Telegram Vc Video Player Bot

Telegram Video Player Bot Telegram bot project for streaming video on telegram video chat, powered by tgcalls and pyrogram Deploy to Heroku 👨‍🔧 The

Dihan Official 11 Dec 25, 2022
Role Based Access Control for Slack-Bolt Applications

Role Based Access Control for Slack-Bolt Apps Role Based Access Control (RBAC) is a term applied to limiting the authorization for a specific operatio

Jeremy Schulman 7 Jan 06, 2022
Kakatua discord music bot

Donate Ayo donasi! Lokal Internasional Ucapan Terima Kasih Tentu saja, donatur Bunga dan talent-talent h!mawari. Semoga rezeki teman-teman semakin lan

1 Oct 30, 2021
A Telegram bot that searches for the original source of anime, manga, and art

A Telegram bot that searches for the original source of anime, manga, and art How to use the bot Just send a screenshot of the anime, manga or art or

Kira Kormak 9 Dec 28, 2022
A Powerful, Smart And Advance Group Manager ... Written with AioGram , Pyrogram and Telethon...

❤️ Shadow ❤️ A Powerful, Smart And Advance Group Manager ... Written with AioGram , Pyrogram and Telethon... ⭐️ Thanks to everyone who starred Shadow,

TeamShadow 17 Oct 21, 2022
Open Resource Calculator Module for Python

Calculator Module for Python By White Night Install #

White_Night_awa 4 Aug 22, 2022
Clippin n grafting Backend

Clipping' n Grafting Presenting you, 🎉 Clippin' n Grafting 🎉 , your very own ecommerce website displaying all your artsy-craftsy stuff. Not only the

Google-Developer-Student-Club-ISquareIT (GDSC I²IT) 2 Oct 22, 2021
A Discord Token Grabber/Stealer But It's in One Line of Coding

Discord-Token-Grabber-But-In-One-Line That's a Discord Token Grabber/Stealer But It's in One Line of Coding! The Name Says All 3

YoSoyAngi 2 Jan 11, 2022
Grade Notifyer Bot

A bot that automatically crawl the submission platform of montefiore to notify the student when a project has been graded.

Julien Gustin 2 Jun 02, 2022
Lambda-function - Python codes that allow notification of changes made to some services using the AWS Lambda Function

AWS Lambda Function This repository contains python codes that allow notificatio

Elif Apaydın 3 Feb 11, 2022
Manage Proxmox KVM Virtual Machines via Slack bot.

proxmox-slack-bot Create KVM Virtual Machines on Proxmox, the easy way. Not much works works here yet... Setup dev environment Setup fully editable st

Plenus Pyramis 3 Mar 20, 2022
Este programa tem como objetivo o cadastro dos usuários. Assim, caso a autenticação seja feita, permitir que o usuário entre em determinado sistema ou programa.

LoginPy Este programa tem como objetivo o cadastro dos usuários. Assim, caso a autenticação seja feita, permitir que o usuário entre em determinado si

Jonas Carvalho 4 Dec 23, 2021
Userbot Telegram dengan Telethon

FLICKS - UBOT Repo FLICKS UBOT Repo Yang Dibuat Oleh Rizzz Dari beberapa Repo Yang Ada Di Github. Generate String Using Replit ⤵️ DEPLOY TO HEROKU Sup

FJ_GAMING 14 May 16, 2022
An advanced QR Code telegram bot with more features.

QR Code Bot A telegram qr code encode and decode bot Advanced Features 1. Database ( MongoDB ) Support 2. Broadcast Support 3. Status Command 4. Setti

Fayas Noushad 16 Nov 12, 2022
Streaming Finance Data with AWS Lambda

A data pipeline consisting of an AWS lambda function reading data from yfinance API, an AWS Kinesis stream to receive & store data in S3 buckets and AWS Glue crawler & Athena to run SQL queries.

Aarif Munwar Jahan 4 Aug 30, 2022
An async-ready Python wrapper around FerrisChat's API.

FerrisWheel An async-ready Python wrapper around FerrisChat's API. Installation Instructions Linux: $ python3.9 -m pip install -U ferriswheel Python 3

FerrisChat 8 Feb 08, 2022