From 498e3332329fcb80e456fea2c9940f3a0e78129c Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sat, 13 Aug 2016 20:35:07 +0200 Subject: [PATCH] gitnext: Checkout next revision. Opposite of 'checkout HEAD^'. --- Makefile | 4 ++-- README | 4 +++- gitnext/gitnext | 6 ++++++ neno/neno | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100755 gitnext/gitnext diff --git a/Makefile b/Makefile index a6ebeca..b39a05a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CMD = blink histogram upsidedown tracefile timestamp rand rrm goodpasswd +CMD = blink histogram upsidedown tracefile timestamp rand rrm goodpasswd gitnext all: blink/blink.1 goodpasswd/goodpasswd.1 histogram/histogram.1 rand/rand.1 rrm/rrm.1 timestamp/timestamp.1 tracefile/tracefile.1 upsidedown/upsidedown.1 wssh/wssh.1 @@ -7,6 +7,6 @@ all: blink/blink.1 goodpasswd/goodpasswd.1 histogram/histogram.1 rand/rand.1 rrm install: mkdir -p /usr/local/bin - parallel eval ln -sf `pwd`/*/{} /usr/local/bin/{} ::: blink reniced em field forever neno rn stdout tracefile w4it-for-port-open upsidedown histogram goodpasswd mtrr not summer timestamp transpose wssh aptsearch rand rrm + parallel eval ln -sf `pwd`/*/{} /usr/local/bin/{} ::: blink reniced em field forever neno rn stdout tracefile w4it-for-port-open upsidedown histogram goodpasswd mtrr not summer timestamp transpose wssh aptsearch rand rrm gitnext mkdir -p /usr/local/share/man/man1 parallel ln -sf `pwd`/{} /usr/local/share/man/man1/{/} ::: */*.1 diff --git a/README b/README index 293ddc5..56807aa 100644 --- a/README +++ b/README @@ -4,10 +4,12 @@ Probably not useful for you, but then again you never now. em - Force emacs to run in terminal. Use xemacs if installed. -field - Split on space. Give the given field number. Support syntax 1-3,6- +field - Split on space. Give the given field number. Supports syntax 1-3,6- forever - Run the same command or list of commands every second. +gitnext - Checkout next revision. Opposite of 'checkout HEAD^'. + neno - No error no output. Only print STDERR and STDOUT if the command fails. rand - Generate (pseudo-)random data diff --git a/gitnext/gitnext b/gitnext/gitnext new file mode 100755 index 0000000..dcf9ccd --- /dev/null +++ b/gitnext/gitnext @@ -0,0 +1,6 @@ +#!/bin/bash + +# Checkout next revision +# Opposite of 'checkout HEAD^' + +git checkout $(git log --reverse --ancestry-path HEAD..master|head -n 1|field 2) diff --git a/neno/neno b/neno/neno index 0778f80..9d0d147 100755 --- a/neno/neno +++ b/neno/neno @@ -25,8 +25,8 @@ # to the extent permitted by law. print() { - cat $TMP/stderr >&4 cat $TMP/stdout >&3 + cat $TMP/stderr >&4 } cleanup() {