quicker way to use git(1) written in POSIX shell and awk

Kevin Bloom d14c2439c6 fixed issue where .gt-temp.txt wouldn't get removed 7 ay önce
LICENSE 8e43edb486 Initial commit 1 yıl önce
README.md c54b350724 added a "what works" section 7 ay önce
makefile 007ba7cb0d removed random echo 11 ay önce
qg d14c2439c6 fixed issue where .gt-temp.txt wouldn't get removed 7 ay önce

README.md

Quick Git (qg)

Quick git is a git(1) frontend written in POSIX shell and awk.

Goals:

  • 100% POSIX compliance
  • provide a quick-to-type interface to git(1)
  • be as powerful as possible
  • allow unknown commands to pass through to git(1)
  • don't suck

Works:

  • add (a)
  • branch (b s), where s is the branch name
  • diff (d)
  • checkout (C s), where s is the branch name
  • commit (c)
  • grep (g, s), where s is the query
  • log (l)
  • merge (M s), where s is the branch name
  • pull (p)
  • push (P)
  • restore (r) via row numbers
  • rm (R)
  • stash (S)
    • (where x is the stash number)
    • stash branch (Sb x)
    • stash clear (Sc x)
    • stash drop (Sd x)
    • stash list (Sl x)
    • stash pop (Sp x)
    • stash save (Ss x)
    • stash show (Ss x)

Doesn't Work:

  • anything I didn't mention above :)

Quick Syntax Guide

qg attempts to keep it's commands as the first letter of the git(1) command: commit is c, pull is p, status is s, diff is d, etc. There are some many commands with the same starting letter: push and pull, commit and checkout, etc. In that case, qg will attempt to keep commands that effect the remote with a capital letter and local commands with a lower case: P for push, C for checkout, etc. There are some exceptions such as S for stash.

qg commands are always singular letters and their arguments are as well -- unless the command excepts numbers such as the a (add) command. qg commands are also always concatenated together without any spaces such as a1-2cP (add files 1 through 2, commit, and push) or Sp (stash pop). Note that any indicator that isn't qg's should have a space such as b ${branch} (branch ${branch}) or Sp 0 (stash pop 0). The stash commands use their own ids and are not related to the numbers listed by the s command and accepted by the a command.

Examples:

Want to run git status

$ qg s
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
1.	modified:   qg

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
2.	modified:   README.md
3.	modified:   qg

Untracked files:
  (use "git add <file>..." to include in what will be committed)

Note the numbers on the left side of the output on the lines that contain files.

Want to add certain files, commit, and then push all in 1 command:

$ qg a1-3cP

Type the commit message and boom, it's pushed.

Want to pop a stash:

$ qg Sp 0

Where 0 is the stash id.