diff --git a/bin/markdown-format-wdiff b/bin/markdown-format-wdiff deleted file mode 100644 index 28d045e..0000000 --- a/bin/markdown-format-wdiff +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# Markdown-wdiff -- format diff of Markdown files with decoration -# Usage: -# wdiff old.md new.md | markdown-format-wdiff -# git diff --word-diff origin/master -- README.md docs/tutorial/README.md | markdown-format-wdiff -# -# Author: Jaeho Shin -# Created: 2013-11-18 -set -eu - -# word diff the given unified diff as input, and format it by hunks -sed ' -# format ins/del of words -s|\[-||g; s|-]||g -s|{+||g; s|+}||g -' - -# attach a small stylesheet -#echo ' -# -#' diff --git a/bin/markdown-git-changes b/bin/markdown-git-changes deleted file mode 100644 index 0d8d92c..0000000 --- a/bin/markdown-git-changes +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env bash -# Summarize commit history and diff of Markdown files in the current Git repo -# Usage: -# markdown-git-changes [COMMIT [MARKDOWN_FILE]...] -# -# You can specify COMMIT as `--' to automatically see changes of given files -# against the upstream branch, HEAD^, or HEAD. -# -# Author: Jaeho Shin -# Created: 2013-11-18 -set -eu - -Here=$(dirname "$0") -PATH="$Here:$PATH" # add this directory to PATH for markdown-format-wdiff - -# TODO passthru any diff options - -# how to find markdown files in the current git repo -files=() -find_markdown_files() { - local IFS=$'\n' - set -- $(git ls-files | grep '\.\(md\|mkd\|markdn\|markdown\)$') - files=("$@") -} - -# diff against given commit, or upstream branch, or HEAD^ if no local changes, or HEAD -since=--; [ $# -eq 0 ] || { since=$1; shift; } -if [ x"$since" = x"--" ]; then - find_markdown_files - since=` - git rev-parse --abbrev-ref HEAD@{upstream} 2>/dev/null || - case $(git status --porcelain --untracked-files=no "${files[@]}" | wc -l) in - 0) echo 'HEAD^' ;; - *) echo 'HEAD' - esac - ` -fi -# unless list of files are given, find Markdown documents in the Git repo -if [ $# -gt 0 ]; then - files=("$@") -elif [ ${#files[@]} -eq 0 ]; then - find_markdown_files -fi - -# make sure ${files[@]} isn't empty -[ ${#files[@]} -gt 0 ] || files+=(.) - - -# summarize commit history -{ - echo "\$ git log --oneline "$since"..HEAD $*" - git log --oneline "$since"..HEAD "${files[@]}" -} | -sed 's/^/ /' -echo - -# and embed the overall word diff -git diff ${GIT_DIFF_OPTS:-} --word-diff --patch-with-stat \ - --minimal --patience \ - "$since" -- "${files[@]}" | -sed ' - # format prologue - 1,/^diff /{ - /^diff/! s/^/ / - } - - # format file headers - /^diff /,/^+++ /{ - /^diff /{ - s|^diff .* \([^/]/\)\(.*\)|
\2
| - a\ - \ - - } - /^
/! s/^/ / - } - - # format hunks - /^@@ -.* +.* @@/{ - s| @@.*| @@| - s|^|
| - s|$|
| - } -' | -markdown-format-wdiff -echo ' - -' diff --git a/bin/wdiff b/bin/wdiff deleted file mode 120000 index 0845663..0000000 --- a/bin/wdiff +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/wdiff \ No newline at end of file