Giter Site home page Giter Site logo

git-powercommit's Introduction

Git Powercommit

This repo contains the end-user shell script implementing git powercommit command for committing and pushing the changes to your Git repository. The script uses meaningless commit messages, performs pulls/stashes as required and supports git submodules. Thus we try to automate a typical work scenario of a lazy developer.

Disclaimer: Author tried to make this script clean and simple and even provided a test. But you know, Git is a complex thing, something may not work as expected. Use this script at your own risk.

The Powercommit algorithm in a nutshell:

  1. Check for changes, exit if there are none.
  2. Mark the current head with a branch powercommit. Exit if the branch already exists.
  3. Call git stash
  4. Call git pull --rebase
  5. Apply the stash
  6. Call itself recursively for every git-submodule, unless --no-recursive is given
  7. Commit every changed submodule
  8. Commit every changed regular file or folder, aggregating the files that share a folder into a single commit.
  9. Push the repo upstream
  10. Remove the powercommit marker branch.
  11. Print a summary of untracked files. Highlight files which look like source codes.

Usage

  1. Drop this git-powercommit script into one of your PATH folders.
  2. cd your-git-repo
  3. Make some changes
  4. git powercommit

Screencast

If something goes wrong

If the automation magic fails for some reason, you are advised to review the /tmp/git_powercommit_$UID.log logfile and recover to the starting state manually:

  1. As one of its first steps, powercommit script pins the current state of the repo with the powercommit branch. On the tip of this branch, it creates the stash capturing the currently modified files. Here is how to revert repo to the state just before git powercommit was called:
    git reset --hard "powercommit"; git stash pop; git branch -D "powercommit"

You may need to repeat the above sequence for all submodules (recursive abort is still in the TODO list). The script will refuse to run if the powercommit branch already exists.

Also it is recommended to run the test script to check the script compatibility on mock repos.

TODO

  • Hide verbose logging into the logfile.
  • Nix-expression.
  • A Screencast.
  • Notify about suspicious untracked files.
  • A recursive dry-run mode of execution.
  • Commit added/removed files based on patterns.
  • Make recursive recovering from failures.
  • A Manpage.
  • Neural network generating commit messages ๐Ÿท

Related links

git-powercommit's People

Contributors

sergei-mironov avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

allanlaal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.