project-everest / everest

https://project-everest.github.io/
Apache License 2.0
193 stars 29 forks source link

snapshot: keep hashes.sh in sorted order #69

Closed mtzguido closed 4 years ago

mtzguido commented 4 years ago

The output of ${!arr[@]} seems to vary between versions, and the bash manual does not specify any order to it.

e.g.:

$ bash --version
GNU bash, version 5.0.16(1)-release (x86_64-pc-linux-gnu)
...
$ declare -A arr ; arr[a]=1; arr[A]=2; arr[b]=3; arr[B]=4; echo ${!arr[@]}
B A b a
$ bash --version
GNU bash, version 4.3.30(1)-release (x86_64-pc-linux-gnu)
...
$ declare -A arr ; arr[a]=1; arr[A]=2; arr[b]=3; arr[B]=4; echo ${!arr[@]}
A B a b

So sort them manually, to reduce noise on the file. I've previously never used ./everest snapshot and instead edited by hand to not get spurious diffs.