Arthur Axel "fREW" Schmidt
October 7, 2011
#!/usr/bin/env perl
use strict;
use warnings;
die 'changes in working directory!' if qx(git status -s);
chomp(my $msg = qx(git log --pretty=%s -1));
qx(git reset HEAD^);
my %changed_files = map { m/(..)\s+(.+)/; ($2, $1) }
split /\0/, qx(git status -z);
for (keys %changed_files) {
my $t = $changed_files{$_};
my $action;
$action = 'Added' if $t eq '??';
$action = 'Modified' if $t eq ' M';
$action = 'Deleted' if $t eq ' D';
system(qw(git add), $_);
system(qw(git commit -m), "$msg [$action $_]");
}
#!/bin/bash git show --stat $(git log --pretty=%h $1)
#!/bin/bash gitk $(cat .git/MERGE_HEAD) $(cat .git/ORIG_HEAD) $@ &
#!/bin/bash git diff -w > foo.patch && git co . && git apply foo.patch && rm foo.patch
#!/usr/bin/env perl
use strict;
use warnings;
my %aliases = map { split(/\n/, $_, 2) }
split /\0/,
`git config -z --get-regexp alias\\.`;
my %commit_aliases = (( commit => 1 ),
map { s/alias\.//; $_ => 1 }
grep $aliases{$_} =~ /^commit\b/,
keys %aliases);
my ($command, @args) = @ARGV;
if ($commit_aliases{$command} >> $args[0] =~ /^-a|^--all/) {
my @staged = grep /^M/, split /\0/, `git status -z`;
if (@staged) {
print "There are staged changes, are you sure you want to commit all? (y/N) ";
chomp(my $answer = <STDIN>);
if ($answer =~ /^y/i) {
run_command()
}
} else {
run_command()
}
} else {
run_command()
}
sub run_command {
system 'git', $command, @args;
exit $? >> 8;
}
#!/bin/zsh alias git='noglob wrap-git'
#!/bin/zsh alias gitk='noglob g_tk'
#!/bin/bash
function g_tk() {
/usr/bin/env 'gitk' "$@" &
}
#!/bin/bash alias grr='g_tk ^origin/release HEAD'
#!/bin/zsh alias grr='noglob g_tk ^origin/release HEAD'
alias gre='git rebase --root --onto origin/release -i --autosquash'
alias gosu='git submodule update --init'
autostash ACK_OPTIONS PERL5LIB LYNX_DEBUG export ACK_OPTIONS='-i --ignore-dirs=cgi/lib' export PERL5LIB="App/lib:cgi/My:cgi" export LYNX_DEBUG=1 alias plackup='plackup -R App/lib,cgi/My'
host gh
user git
hostname github.com
port 22
identityfile ~/.ssh/keys/frew_gh
host irc
user frew
hostname warpedreality.org
port 22
identityfile ~/.ssh/keys/frew_irc
ssh irc git clone gh:frioux/Foo-Repo
/
#