stack dsl
just realized it doesn't really make sense to use commits at the command level in some cases, for example:
mkdir /tmp/redis
curl -L# http://download.redis.io/releases/redis-stable.tar.gz | tar -zx --strip 1 -C /tmp/redis
cd /tmp/redis && make install
If you were to change the release tarball it would re-execute but make install would not, so what we really need is:
redis {
tmp {
curl -L# http://download.redis.io/releases/redis-stable.tar.gz | tar -zx --strip 1
make install
}
}
where "redis {}" is the stack and "tmp {}" is just an example directive
The alternative way to solve this (if you wanted to avoid the DSL) is to put the redis related lines in a new file, then call/source it from the main script. You'd commit the SHA of the external script contents.
Not saying this is necessarily better; but could potentially be less to maintain.
On the other hand, writing DSLs is always fun, so there's that :)
haha yeah that's just an example, lots of use-cases where a few commands should be considered a single commit
:smile: - Right on.
you could probably treat group of commands as related, without two newlines, example:
# one command, hashed with newlines as block
mkdir /tmp/dir
cd /tmp/dir
echo /hello/world
# command two, could also reset some state, like **pwd**
pwd # /home/user
The group could be executed in sh -c "group of commands" in order to restore EXPORTs and other state..