VCS_SUPPORTED="GIT, Subversion or Mercurial"
+GIT_LOG_BASE_OPTS="--oneline"
+HG_LOG_BASE_OPTS="--follow"
+
print_usage()
{
echo "$(basename $0) -- log for version control (${VCS_SUPPORTED})."
NORMAL=$(echo -e '\033[0m')
if git diff 1> /dev/null 2>&1; then
- git log "$@"
+ git log ${GIT_LOG_BASE_OPTS} "$@"
elif svn diff 1> /dev/null 2>&1; then
# Colore les lignes --------- en vert
# Colore en rouge les infos de la révision
svn log "$@" | sed -e "s/^-\+$/${SVN_LOG_SEPARATION_COLOR}\0${NORMAL}/" \
-e "s/^r[0-9]\+.\+$/${SVN_LOG_REV_INFO_COLOR}\0${NORMAL}/" | less -RFX
elif hg status 1> /dev/null 2>&1; then
- hg glog "$@"
+ hg glog ${HG_LOG_BASE_OPTS} "$@"
else
echo "Not a ${VCS_SUPPORTED} repository"
exit 1