Skip to content

Commit

Permalink
Added new files
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegley committed Jan 23, 2012
1 parent 362e307 commit 34b86bd
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 0 deletions.
20 changes: 20 additions & 0 deletions git-amend-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

## Copyright (C) 2006-2011 Daniel Baumann <[email protected]>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.


set -e

# User is not in git repository
if ! git branch > /dev/null 2>&1
then
echo "E: '$(basename ${PWD})' - Not a Git repository."
exit 1
fi

git add .
git commit -a --amend -C HEAD
42 changes: 42 additions & 0 deletions git-checkout-branches
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh

## Copyright (C) 2006-2011 Daniel Baumann <[email protected]>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.


set -e

# User is not in git repository
if ! git branch > /dev/null 2>&1
then
echo "E: '$(basename ${PWD})' - Not a Git repository."
exit 1
fi

echo "P: Checking out all remote branches..."

# Rememeber current branch
_CURRENT_BRANCH="$(git branch | awk '/^\* / { print $2 }')"

# Checkout all remote branches
for _REMOTE_BRANCH in $(git branch -r | awk '{ print $1 }')
do
_BRANCH_NAME="$(echo ${_REMOTE_BRANCH} | cut -d/ -f 2-)"

if [ "${_BRANCH_NAME}" != "HEAD" ]
then
if ! git branch | grep -q "${_BRANCH_NAME}$"
then
git checkout -b ${_BRANCH_NAME} ${_REMOTE_BRANCH}
fi
fi
done

# Switch back to current branch
if [ "$(git branch | awk '/^\* / { print $2 }')" != "${_CURRENT_BRANCH}" ]
then
git checkout ${_CURRENT_BRANCH}
fi
2 changes: 2 additions & 0 deletions git-diff-dw
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
/Applications/Misc/DeltaWalker.app/Contents/MacOS/DeltaWalker -nosplash "$PWD/$1" "$2"
1 change: 1 addition & 0 deletions git-find
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class Commit < GitObject
if @names.include?(name)
return
end
puts name
add_name(name)

offset = 0
Expand Down
2 changes: 2 additions & 0 deletions git-merge-dw
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
/Applications/Misc/DeltaWalker.app/Contents/MacOS/DeltaWalker -nosplash "$PWD/$1" "$2" "$3" -merged="$4"
33 changes: 33 additions & 0 deletions git-whoami
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

# git-whoami
# Author: Peter Eisentraut <[email protected]>
# Created: 2011-10-27
# License: WTFPL; see http://sam.zoy.org/wtfpl/

# exact logic in ident.c in git source tree

set -e

get_email() {
git config user.email || ( [ -n "$EMAIL" ] && echo "$EMAIL" ) || echo "$(id -nu)@$(hostname --fqdn)"
}

get_name() {
git config user.name || getent passwd $(id -un) | cut -d : -f 5 | cut -d , -f 1
}

: ${GIT_AUTHOR_NAME=$(get_name)}
: ${GIT_COMMITTER_NAME=$(get_name)}
: ${GIT_AUTHOR_EMAIL=$(get_email)}
: ${GIT_COMMITTER_EMAIL=$(get_email)}

author="$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>"
commit="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"

if [ "$author" = "$commit" ]; then
echo "$author"
else
echo "Author: $author"
echo "Commit: $commit"
fi

0 comments on commit 34b86bd

Please sign in to comment.