Commit 3c4c54bb authored by Martin's avatar Martin

initial commit with basic setup

parents
dist/
*.log
FPM=fpm
PKG_NAME=fb-git-tools
VERSION=$(shell cat VERSION)
PKG_FILE=$(PKG_NAME)-$(VERSION).deb
.PHONY: clean dist
dist: src/* debian/*
test -d dist || mkdir dist
test -f 'dist/$(PKG_FILE)' && rm 'dist/$(PKG_FILE)'
$(FPM) -t deb --package 'dist/$(PKG_FILE)' --version $(VERSION) --name $(PKG_NAME) --depends 'git' --depends 'bash' --after-install 'debian/postinstall' --before-remove 'debian/preremove' -s dir ./src/=/usr/bin/
clean:
rm -rf dist
FreakyBytes Git Tools
=====================
This is a selection of useful scripts to extend the normal git functionalities.
`git done`
----------
Lists all commits by the current git user in the current git repository of the last week
`git lg`
--------
Fancy one-line log
`git stat`
----------
Fancy one-line log, also showing what was changed and the stats of those changes
Simple Aliases
--------------
* `d` -> `diff`
#!/bin/bash
# Register the more basic commands as aliases
git config --system alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
git config --system alias.stat "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --stat"
git config --system alias.d diff
#!/bin/bash
# remove the aliases again, which were set in postinstall
git config --system --unset alias.lg
git config --system --unset alias.stat
git config --system --unset alias.d
#!/bin/bash
last_week=$(date -Iseconds --date='7 days ago')
author_name=$(git config --get user.name || getent passwd $(id -u) | cut -d":" -f 5 | cut -d"," -f 1)
git log --pretty=format:'%ci %s' --date=short --since='$last_week' --reverse --author='$author_name' | cat
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment