| 1 |
#!/usr/bin/env bash |
| 2 |
#============================================================================= |
| 3 |
# Copyright 2010-2012 Kitware, Inc. |
| 4 |
# |
| 5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 |
# you may not use this file except in compliance with the License. |
| 7 |
# You may obtain a copy of the License at |
| 8 |
# |
| 9 |
# https://www.apache.org/licenses/LICENSE-2.0 |
| 10 |
# |
| 11 |
# Unless required by applicable law or agreed to in writing, software |
| 12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 |
# See the License for the specific language governing permissions and |
| 15 |
# limitations under the License. |
| 16 |
#============================================================================= |
| 17 |
|
| 18 |
# This script makes optional suggestions for working with Git. |
| 19 |
|
| 20 |
# Project configuration instructions: NONE |
| 21 |
|
| 22 |
egrep-q() { |
| 23 |
egrep "$@" >/dev/null 2>/dev/null |
| 24 |
} |
| 25 |
|
| 26 |
# Suggest color configuration. |
| 27 |
if test -z "$(git config --get color.ui)"; then |
| 28 |
echo ' |
| 29 |
One may enable color output from Git commands with |
| 30 |
|
| 31 |
git config --global color.ui auto |
| 32 |
' |
| 33 |
fi |
| 34 |
|
| 35 |
# Suggest bash completion. |
| 36 |
if ! bash -i -c 'echo $PS1' | egrep-q '__git_ps1'; then |
| 37 |
echo ' |
| 38 |
A dynamic, informative Git shell prompt can be obtained by sourcing |
| 39 |
the git bash-completion script in your "~/.bashrc". Set the PS1 |
| 40 |
environmental variable as suggested in the comments at the top of the |
| 41 |
bash-completion script. You may need to install the bash-completion |
| 42 |
package from your distribution to obtain it. |
| 43 |
' |
| 44 |
fi |
| 45 |
|
| 46 |
# Suggest merge tool. |
| 47 |
if test -z "$(git config --get merge.tool)"; then |
| 48 |
echo ' |
| 49 |
One may configure Git to load a merge tool with |
| 50 |
|
| 51 |
git config merge.tool <toolname> |
| 52 |
|
| 53 |
See "git help mergetool" for more information. |
| 54 |
' |
| 55 |
fi |