From e057c789768c28011996370709c902c2c6d2b7d3 Mon Sep 17 00:00:00 2001 From: "Elf M. Sternberg" Date: Mon, 13 Jan 2014 09:05:35 -0800 Subject: [PATCH] Packaging up. --- .gitignore | 8 ++++++++ LICENSE | 22 ++++++++++++++++++++++ README.md | 18 ++++++++++++++++++ git-wc | 5 +++++ 4 files changed, 53 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100755 git-wc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..22669ba --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +*.pyc +*.pyo +*# +.#* +.DS_Store +*~ +npm-debug.log +node_modules/* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fa52cfa --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2014 Elf M. Sternberg + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4a66e26 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# GIT-WC + +This is a simple extension to GIT that reports the word count +difference between any two commits. It accepts any standard range +arguments, such as HEAD^..HEAD or .., and tells you how +many words you added since your last commit, minus how many words you +have removed. + +Without any arguments, it tells you the difference between your +working tree and the last commit. + +I write stories as well as code, I use Markdown as my writing +environment of choice, I commit to a GIT repository regurlarly, and +this is a stimple and straightforward way of tracking my daily +contributions. + +The LICENSE is standard MIT style. See the LICENSE file for details. + diff --git a/git-wc b/git-wc new file mode 100755 index 0000000..239541d --- /dev/null +++ b/git-wc @@ -0,0 +1,5 @@ +#!/bin/bash +REM=`git diff --word-diff=porcelain -U $* | grep '^-' | sed 's/^-//' | wc -w` +ADD=`git diff --word-diff=porcelain -U $* | grep '^+' | sed 's/^+//' | wc -w` +DIF=`expr $ADD - $REM` +echo "Word count: $DIF"