git: minor tweaks to my git commands
This commit is contained in:
parent
0f85776d14
commit
3fc86cf7c6
2 changed files with 21 additions and 13 deletions
|
@ -1,10 +1,8 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
#
|
||||
# Written by Corey Haines
|
||||
# Scriptified by Gary Bernhardt
|
||||
# List files with commit count.
|
||||
#
|
||||
# Put this anywhere on your $PATH (~/bin is recommended). Then git will see it
|
||||
# and you'll be able to do `git churn`.
|
||||
# Based on: https://github.com/garybernhardt/dotfiles/blob/main/bin/git-churn
|
||||
#
|
||||
# Show churn for whole repo:
|
||||
# $ git churn
|
||||
|
@ -16,8 +14,16 @@
|
|||
# $ git churn --since='1 month ago'
|
||||
#
|
||||
# (These are all standard arguments to `git log`.)
|
||||
|
||||
set -e
|
||||
git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort -n | awk 'BEGIN {print "count\tfile"} {print $1 "\t" $2}'
|
||||
|
||||
#
|
||||
exec git log --all \
|
||||
--find-copies \
|
||||
--find-renames \
|
||||
--name-only \
|
||||
--format='format:' \
|
||||
"$@" \
|
||||
| sort \
|
||||
| grep -v '^$' \
|
||||
| uniq -c \
|
||||
| sort -n \
|
||||
| awk 'BEGIN {print "count\tfile"} {print $1 "\t" $2}'
|
||||
|
||||
|
|
10
bin/git-new
10
bin/git-new
|
@ -1,7 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Initialize a git repository and automatically create an empty root commit.
|
||||
# NOTE: requires the `l` alias to be defined (see .gitconfig)
|
||||
|
||||
git init && git commit --allow-empty -m "Initial commit" && git l
|
||||
#
|
||||
set -e
|
||||
git init
|
||||
git commit --allow-empty -m "Initial commit"
|
||||
git log --graph --pretty='%C(auto)%h%d %s %C(8) %ad'
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue