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 method to check whether a Discord user is using the client or not.

Discord Captcha Method This is an example, of a verification trough a check, if the user loads the picture send with the verification-message. This ma

Julien 2 Jan 19, 2022
A Phyton script working for stream twits from twitter by tweepy to mongoDB

twitter-to-mongo A python script that uses the Tweepy library to pull Tweets with specific keywords from Twitter's Streaming API, and then stores the

3 Feb 03, 2022
Optimus Prime - A modular Telegram group management and drive clone bot running on Python with sqlalchemy database

Optimus Prime Bot . 🤖 A modular Telegram group management and drive clone bot r

9 Jun 01, 2022
Um bot para contar quantas vezes o meu amigo troca de pfp/nick/tag essas coisas ae pq aquele mlk n para quieto

EkiBot Um bot que tem apenas as suas funções de audit log com as PFP's (avatares) dos usuários Pode ser usado para um usuário em específico, ou até me

Samuel 3 Aug 11, 2021
Código que Utiliza Programação Dinâmica para resolver o problema da Moeda

Programação Dinâmica: Modelo baseado em recursão Utiliza a técnica de Memorização Não pode ser aplicada quando existe dependência entre as respostas G

Hemili Beatriz 1 Jan 08, 2022
Built for streamlining development of Google Assistant Actions

Apprentice Apprentice is a framework built for developing Google Actions via Dialogflow and Google Cloud (serverless) Functions. Includes: plug-and-pl

Andrew Graham-Yooll 9 May 16, 2019
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
Github action for automatically determine the version for next release by using repository tags

This action will automatically determine the version for next release by using repository tags

Igor Gov 7 Oct 25, 2022
A client interface for Scrapinghub's API

Client interface for Scrapinghub API The scrapinghub is a Python library for communicating with the Scrapinghub API. Requirements Python 2.7 or above

Scrapinghub 184 Sep 28, 2022
Faster Twitch Alerts is a highly customizable, lightning-fast alternative to Twitch's slow mobile notification system

Faster Twitch Alerts What is "Faster Twitch Alerts"? Faster Twitch Alerts is a highly customizable, lightning-fast alternative to Twitch's slow mobile

6 Dec 22, 2022
Discord Bot written in Python that plays music in your voice channel

Discord Bot that plays music! I decided to create a simple Discord bot using Python in order to advance my coding skills. Please don't ask me for help

Eric Yeung 39 Jan 01, 2023
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
a simple quant trading bot with CLI interface

shepherd a simple quant trading bot with CLI interface CLI shell command docs coming soon after I brush up the code and add more features :) Minimal R

m00n 0 Jun 06, 2022
🚀🔥使用Python连接阿里云盘, 实现了官方大部分功能 👍👍

aligo 🚀 🔥 使用Python连接阿里云盘, 实现了官方大部分功能 👍 👍 为了完善代码提示, 方便大家代码书写, aligo 引入了一些 python 3.8 的新特性, 所以要求 python = 3.8.* pip install aligo 或 pip install ali

455 Jan 08, 2023
Wrapper for Gismeteo.ru.

pygismeteo Обёртка для Gismeteo.ru. Асинхронная версия здесь. Установка python -m pip install -U pygismeteo Документация https://pygismeteo.readthedoc

Almaz 7 Dec 26, 2022
bot for hearthstone mercenaries

Hearthstone-Mercenaries-game-bot - prevention: Bot is not ready and now on the development stage estimated release date - 21.10.21 The main idea of th

Andrew Efimov 59 Dec 12, 2022
Building and deploying AWS Lambda Shared Layers

AWS Lambda Shared Layers This repository is hosting the code from the following blog post: AWS Lambda & Shared layers for Python. The goal of this rep

Flaneer 7 Dec 02, 2021
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
A Telegram Bot written in Python for mirroring files on the Internet to your Google Drive or Telegram

Original Repo mirror-leech-telegram-bot This is a Telegram Bot written in Python for mirroring files on the Internet to your Google Drive or Telegram.

0 Jan 03, 2022
Scheduled Block Checker for Cardano Stakepool Operators

ScheduledBlocks Scheduled Block Checker for Cardano Stakepool Operators Lightweight and Portable Scheduled Blocks Checker for Current Epoch. No cardan

SNAKE (Cardano Stakepool) 4 Oct 18, 2022