Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 617fe9646a3e62c8d983f49352e29aa18d185a9d 0 parents
@mjdominus authored
Showing with 75 additions and 0 deletions.
  1. +1 −0  git-command
  2. +17 −0 git-re-edit
  3. +57 −0 git-vee
1  git-command
@@ -0,0 +1 @@
+exec git "$(basename "$0")" "$@"
17 git-re-edit
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+#
+# Still fails when files may contain spaces
+
+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;
+
+my $ed = $ENV{VISUAL} || $ENV{EDITOR} || "emacs";
+exec $ed, @lines;
+die "exec $ed: $!\n";
57 git-vee
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+DIE=false;
+
+equal_commits () {
+ [ $(git rev-parse $A) = $(git rev-parse $B) ]
+}
+
+valid_ref () {
+ git rev-parse -q --verify $1 >/dev/null
+}
+
+is_remote () {
+ git remote | grep -q "^$1"'$'
+}
+
+die_later () {
+ echo $* 1>&2;
+ DIE=true
+}
+
+die_now () {
+ $DIE && exit 1
+}
+
+usage () {
+ echo "Usage: $0 remote [branch]" 1>&2
+ echo " $0 branch-a [branch-b]" 1>&2
+ exit 2
+}
+
+case $# in
+ 1) X=$1 Y=HEAD;;
+ 2) X=$1 Y=$2;;
+ *) usage ;;
+esac
+
+if is_remote $X; then
+ if [ $Y = HEAD ]; then
+ Y=$(git name-rev --name-only HEAD | sed -e 's/~[0-9]+$//')
+ fi
+ A=$Y B="$X/$Y"
+else
+ A=$X; B=$Y;
+fi
+
+valid_ref $A || die_later "$A: unknown commit"
+valid_ref $B || die_later "$B: unknown commit"
+die_now
+
+if equal_commits $A $B ; then
+ echo "$A and $B are identical"
+ exit 0;
+fi
+
+git log --decorate --cherry-mark --oneline --graph --boundary $A"..."$B
+
Please sign in to comment.
Something went wrong with that request. Please try again.