Skip to content

Loading…

Prefer local settings for user.name and user.email, use mirror for git docs, document outline fixed #56

Open
wants to merge 6 commits into from

2 participants

@nikcorg

Replaced git config --global ... with git config --get ... to prefer local settings over global, in order to enable an easy override for the user.name and user.email used in generating the HTML.

Replaced link to kernel.org with link to mirror schacon.github.com. (Kernel.org docs still offline.)

Fixed document outline.

@Hagith

Hi,

Git official docs are now at: http://git-scm.com/docs/

Cheers,
R

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 14, 2012
  1. Whitespace

    Niklas Lindgren committed
  2. Replace kernel.org manual links with mirror

    Niklas Lindgren committed
  3. Fixed document outline

    Niklas Lindgren committed
  4. Prefer local config over global

    Niklas Lindgren committed
  5. @nikcorg

    Made docs link protocol agnostic

    nikcorg committed
Commits on Sep 14, 2012
  1. @nikcorg

    Link docs to git-scm.com

    nikcorg committed
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 6 deletions.
  1. +6 −6 git-achievements
View
12 git-achievements
@@ -51,7 +51,7 @@ function git_achievements_command
function log_action
{
local expansion=$(unalias_command "$1")
-
+
if [[ $expansion ]] ; then
shift
echo "$expansion $@" >> "${ACTIONLOGFILE}"
@@ -168,7 +168,7 @@ function check_for_achievements
if [[ $expansion ]] ; then
# not a real inventor
unlock_achievement "Garage Inventor" "Used a custom alias for a Git command"
-
+
# get actual command, removing any additional parameters from the command
command=$(echo "$expansion" | awk '{ print $1; }')
fi
@@ -360,7 +360,7 @@ function check_for_achievements
function link_to_git_docs
{
- sed -e 's_git \([a-z0-9-]*\)_<a href="http://www.kernel.org/pub/software/scm/git/docs/git-\1.html">git-\1</a>_g' | sed -e 's/\/git-hooks/\/githooks/g'
+ sed -e 's_git \([a-z0-9-]*\)_<a href="//git-scm.com/docs/git-\1.html">git-\1</a>_g' | sed -e 's/\/git-hooks/\/githooks/g'
}
function clean_logged_achievements() {
@@ -384,7 +384,7 @@ function publish_achievements
cd "${git_achievements_dir}"
- user=`git config --global user.name`
+ user=`git config --get user.name`
echo "
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -397,8 +397,8 @@ echo "
</head>
<body>
" > index.html
- mailhash=`git config --global user.email | xargs echo -n | tr '[A-Z]' '[a-z]' | openssl md5 | sed -e 's/.* //'`
- echo "<h2>${user}'s Git Achievements <img src='http://www.gravatar.com/avatar/${mailhash}'/></h2>" >> index.html
+ mailhash=`git config --get user.email | xargs echo -n | tr '[A-Z]' '[a-z]' | openssl md5 | sed -e 's/.* //'`
+ echo "<h1>${user}'s Git Achievements <img src='http://www.gravatar.com/avatar/${mailhash}'/></h1>" >> index.html
# STATS
cat git-achievements | grep 'unlock_achievement ' | grep -v ' sed ' | grep -v '\${' | sed -e 's/.*unlock_achievement //g' -e 's/^"//g' -e 's/"$//g' -e 's/\$power/X/g' -e 's/\$count/X/g' -e 's/\$hooks/X/g' | sort | awk -F"\" \"" '{ print "<li><div class=\"title\">" $1 "</div><div class=\"info\">" $2 "</div></li>" }' | link_to_git_docs > all.html
Something went wrong with that request. Please try again.