forked from jwiegley/git-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,7 @@ class Commit < GitObject | |
if @names.include?(name) | ||
return | ||
end | ||
puts name | ||
add_name(name) | ||
|
||
offset = 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |