Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions git-sh.bash
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,16 @@ done
# Create aliases for everything defined in the gitconfig [alias] section.
_git_import_aliases () {
eval "$(
git config --get-regexp 'alias\..*' |
sed 's/^alias\.//' |
while read key command
git config --list --name-only |
sed -n 's/^alias\.//p' |
while read key
do
command=$(git config --get "alias.$key")
if expr -- "$command" : '!' >/dev/null
then echo "alias $key='git $key'"
else echo "gitalias $key=\"git $command\""
else echo "gitalias $key=\"git $(set -f; printf '%s ' $command)\""
# Newlines in aliases that are not shell commands will be
# considered whitespace (as git itself would do).
fi
done
)"
Expand Down