summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/git/git-re-edit25
-rwxr-xr-xbin/git/git-treehash27
-rw-r--r--gitconfig58
3 files changed, 21 insertions, 89 deletions
diff --git a/bin/git/git-re-edit b/bin/git/git-re-edit
deleted file mode 100755
index 7172acd..0000000
--- a/bin/git/git-re-edit
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/perl
-#
-# Still fails when files may contain spaces
-#
-# Run the editor on all the files that have been modified from the
-# current index. Useful to resume work when you left the working tree
-# dirty. Useful following a "git reset HEAD^" to continue work on the
-# stuff you were working on before. Useful following a failed merge.
-#
-
-chomp(my @changed = qx{git status --porcelain});
-exit 1 unless $? == 0;
-s/^.. // or die "<$_>???\n" for @changed;
-die "Fucking shell, how does it work?\n"
- if grep / /, @changed;
-
-@changed = qw(.) unless @changed;
-chomp(my @lines = qx{find @changed -type f });
-exit 1 unless $? == 0;
-
-# maybe should use output of "git var GIT_EDITOR" here?
-# But then I have to involve the !@&*!@*(&!@ shell
-my $ed = $ENV{VISUAL} || $ENV{EDITOR} || "emacs";
-exec $ed, @lines;
-die "exec $ed: $!\n";
diff --git a/bin/git/git-treehash b/bin/git/git-treehash
deleted file mode 100755
index 8b2d1a4..0000000
--- a/bin/git/git-treehash
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/perl
-
-my %opt;
-use Getopt::Std;
-getopts("q", \%opt);
-
-@ARGV = qw(HEAD ORIG_HEAD) unless @ARGV;
-
-for my $rev (@ARGV) {
- chomp(my $res = qx{git rev-parse $rev^{tree}});
- if ($?) { $BAD++ }
- else { push @{$hash{$res}}, $rev }
-}
-
-exit 2 if $BAD;
-if (keys(%hash) == 1) {
- my ($res) = keys %hash;
- print "$res\n" unless $opt{"q"};
- exit 0;
-} else {
- unless ($opt{"q"}) {
- for my $res (keys %hash) {
- print $res, " ", join(" ", @{$hash{$res}}), "\n";
- }
- }
- exit 1;
-}
diff --git a/gitconfig b/gitconfig
index 3c22b26..4b7ce8d 100644
--- a/gitconfig
+++ b/gitconfig
@@ -2,66 +2,50 @@
email = doy@tozt.net
name = Jesse Luehrs
[alias]
- pushall = "!f() { for repo in origin github; do git push $repo \"$@\"; done; }; f"
- amend = !git add -p && git commit --amend
- record = !git add -p && git commit --verbose
- rebase-branch = !git rebase -i $(git merge-base master HEAD)
- diff-branch = "!f() { local branch=${1:-HEAD}; git diff $(git merge-base master $branch) $branch; }; f"
- log-branch = !git log master..HEAD
- review-branch = !git review master..HEAD
- review = "!f() { for rev in $(git rev-list --reverse \"$@\"); do git show $rev; done; }; f"
- info = remote show -n origin
- graph = log --all --graph --color=always --pretty='[%C(cyan)%h%Creset]%C(bold cyan)%d%Creset %s'
- prune-all = !git remote | xargs -n 1 git remote prune
+ a = !git amend
+ aliases = !git config --get-regexp 'alias.*' | perl -nle'/^alias\\.([^ ]*) (.*)/ && printf \"%-15s = %s\\n\", $1, $2'
alias = "!f() { local name=$1; shift; git config --global alias.$name \"$*\"; }; f"
- aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
- lg = log --graph --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %C(bold blue)%aN %Cgreen(%ar)%Creset%n%s%n' --abbrev-commit --date=relative --stat=72
- lgs = log --graph --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %C(bold blue)%aN %Cgreen(%ar)%Creset%n%s%n' --abbrev-commit --date=relative
- st = status -sb
- ch = "!f() { git cherry \"$@\" | grep -v '^-' | sed 's/^..//' | xargs -n1 git log --oneline -1 | cat | perl -ple 's/([^ ]+)/\\e[33m$1\\e[m/'; }; f"
- ff = merge --ff-only
+ amend = !git add -p && git commit --amend
+ blame-stats = !~/.bin/git/git-blame-stats
+ br = for-each-ref --sort=committerdate refs/heads/ --format='%(align:30,left)%(HEAD) %(refname:short)%(end) %(color:green)(%(committerdate:relative))'
cc = cherry-pick
- rv = checkout -p
- re = rebase -i @{u}
- git = "!f() { git \"$@\"; }; f"
- vim = "!f() { vim \"$@\"; }; f"
- up = !git remote update && git pull && git prune-all
co = checkout
- r = !git add -p && git commit --verbose
- br = for-each-ref --sort=committerdate refs/heads/ --format='%(align:30,left)%(HEAD) %(refname:short)%(end) %(color:green)(%(committerdate:relative))'
- ri = rebase -i
+ diff-branch = "!f() { local branch=${1:-HEAD}; git diff $(git merge-base master $branch) $branch; }; f"
+ ff = merge --ff-only
+ file-size = !~/.bin/git/git-file-size
fixup = "!f() { git record --fixup \"$@\"; }; f"
- track = "!f() { local name=$(git name-rev --name-only @); git branch --set-upstream-to=origin/$name $name; }; f"
- stashed = stash list --pretty=format:'%gd: %Cred%h%Creset %Cgreen[%ar]%Creset %s'
- refix = "!f() { env EDITOR=true git rebase -i \"$@\"; }; f"
gc-aggressive = "!f() { git repack -Abd --window=250 --depth=250 --window-memory=1g && git prune --expire \"1 day ago\" && rm -f .git/gc.log && git gc; }; f"
- blame-stats = !~/.bin/git/git-blame-stats
- file-size = !~/.bin/git/git-file-size
imerge = !~/.bin/git/git-imerge
+ info = remote show -n origin
+ lg = log --graph --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %C(bold blue)%aN%Creset %Cgreen(%ar)%Creset%n%s%n' --abbrev-commit --date=relative --stat=72
+ prune-all = !git remote | xargs -n 1 git remote prune
+ pushall = "!f() { for repo in origin github; do git push $repo \"$@\"; done; }; f"
rebase-under = !~/.bin/git/git-rebase-under
- re-edit = !~/.bin/git/git-re-edit
- treehash = !~/.bin/git/git-treehash
+ record = !git add -p && git commit --verbose
+ refix = "!f() { env EDITOR=true git rebase -i \"$@\"; }; f"
+ re = rebase -i @{u}
+ r = !git record
+ ri = rebase -i
+ rv = checkout -p
+ stashed = stash list --pretty=format:'%<(10)%gd: %Cred%h%Creset %Cgreen(%ar)%Creset%n %s'
+ st = status -sb
+ track = "!f() { local name=$(git name-rev --name-only @); git branch --set-upstream-to=origin/$name $name; }; f"
[github]
user = doy
[color]
ui = auto
[core]
excludesfile = /home/doy/.gitignore
-[push]
- default = current
[branch]
autosetuprebase = always
[merge]
- tool = vimdiff
conflictstyle = diff3
[rebase]
- stat = true
autosquash = true
autostash = true
[help]
autocorrect = 5
[diff]
- renames = true
mnemonicprefix = true
[advice]
pushUpdateRejected = false