summaryrefslogtreecommitdiffstats
path: root/.bashrc-work
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-10-14 19:03:03 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-10-14 19:35:03 +0200
commitdfa324280f621a287d146282ad3c32edc30648ff (patch)
treeba01eb92018eeb80198bbf1fad0c82d77245c791 /.bashrc-work
parentac8ad37e9cec7b05f0f466ea10a2a052b9eb3d17 (diff)
downloaddotfiles-dfa324280f621a287d146282ad3c32edc30648ff.tar.gz
dotfiles-dfa324280f621a287d146282ad3c32edc30648ff.tar.xz
dotfiles-dfa324280f621a287d146282ad3c32edc30648ff.zip
bash: even " [+-]" at subdiff has a use case: patch-suggested-changes
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to '.bashrc-work')
-rw-r--r--.bashrc-work20
1 files changed, 20 insertions, 0 deletions
diff --git a/.bashrc-work b/.bashrc-work
new file mode 100644
index 0000000..3fc6b75
--- /dev/null
+++ b/.bashrc-work
@@ -0,0 +1,20 @@
+# .bashrc-work
+
+patch-suggested-change() {
+ [ $# -ne 1 ] && int-usage "rej-file" && return
+ local origfile=${1%.rej}
+ { echo "diff ${origfile}.patch ${origfile}.patch.orig"; colordiff -du \
+ <(diff -du \
+ "${origfile}" \
+ <(wiggle --merge "${origfile}" "${origfile}.rej") \
+ | tail -n+3) \
+ <(tail -n+3 "${origfile}.rej")
+ } | sed '2,4d;' | subdiff
+ #} | subdiff | tail -n+5
+}
+
+patch-suggested-changes() {
+ for f in $(find -name '*.rej'); do
+ patch-suggested-change "${f}"
+ done
+}