about summary refs log tree commit diff stats
path: root/059stop.subx
Commit message (Expand)AuthorAgeFilesLines
* 5700Kartik Agaram2019-10-171-1/+1
* 5698Kartik Agaram2019-10-151-9/+9
* 5592 - switch register names to lowercaseKartik Agaram2019-08-261-66/+66
* done implementing all variants of 'get'Kartik Agaram2019-08-131-1/+2
* done with get-or-stopKartik Agaram2019-08-131-1/+1
* .Kartik Agaram2019-08-131-1/+2
* 5485 - promote SubX to top-levelKartik Agaram2019-07-271-0/+206
ubalh@iodoru.org> 2019-01-10 14:00:52 +0100 Prepare spec file for 0.6.0 release' href='/danisanti/profani-tty/commit/profanity.spec?id=8a941dafeac8aa0974afa1f6be426d62948bca76'>8a941daf ^
b89f5da2 ^




bf0fdc4d ^
47d00141 ^
b89f5da2 ^





bf0fdc4d ^
47d00141 ^
b89f5da2 ^


















1
2
3
4
5
6
7
8
<
#!/usr/bin/env zsh
# Helper to change the numerical prefixes across the repo, say if you want to
# create room between 023 and 024, and so on.
#
# Assumes there's only ever one file with any numeric prefix. If you move
# 003trace.tests you might need to do some manual patch-up.

setopt extendedglob

if [[ $# -eq 0 && `git diff HEAD |wc -l` -gt 0 ]]
then
  echo "Uncommitted changes"
  exit
fi

if [[ $# -gt 0 ]] # dry run
then
  git() {
    echo $*
  }
fi

#

index=0
ls [0-9]* |grep -v "trace.test" |sort -n |
  while read file
  do
    echo $file >&2
    while [[ $file != `printf "%03d" $index`* ]]
    do
      echo
      index=$(($index+1))
    done
    echo $file
    index=$(($index+1))
  done > .layout

vim -c "set nu" .layout

#

root() {
  echo $1 |perl -pwe 's/^[0-9]*//'
}

index=0
cat .layout |
  while read file
  do
    if [ ! -z $file ]
    then
      newfile=`printf "%03d" $index``root $file`
      if [[ $newfile != $file ]]
      then
        git mv $file $newfile
      fi
    fi
    index=$(($index+1))
  done

#

rm .layout