Configuration for my NixOS based systems and Home Manager
1#!/usr/bin/env rc
2
3flag e +
4
5current_ref=`{
6 git symbolic-ref --short -q HEAD \
7 || git describe --tags --exact-match >[2]/dev/null \
8 || git rev-parse --short HEAD
9}
10
11root=`{git rev-parse --show-toplevel}
12
13fn log {
14 echo $"* >[1=2] #"
15}
16
17log Preserving current symbolic ref to return to later: $current_ref
18
19rev_range=$1
20shift
21
22revlist=`{git rev-list $rev_range --reverse}
23
24for (rev in $revlist) {
25 echo Checking out $rev
26 # Checkout the ref
27 git checkout $rev
28 # Execute the argument
29 for (command in $*) {
30 eval $command
31 }
32 git restore $root
33}
34
35log Done!
36git checkout $current_ref