Add commit hash to cmdstan csv output

To improve reproducibility (especially development & debugging) it make sense to add commit hash to the output. I’m thinking

# stan_version_major = 2
# stan_version_minor = 25
# stan_version_patch = 0
# cmdstan build: xxxx
# stan build: xxxx
# math build: xxxx
# ...

It amounts to print out what the .git/HEAD points to in the refs. Unfortunately it’ll mess up downstream interfaces’ reading. @rok_cesnovar @mitzimorris @jonah

1 Like

Agreed. We have recently added the stanc3 hash and I think it makes sense to add this. Do we ignore it for releases or just add the release hash? I am fine either way.

It’ll probably be easier to maintain the csv reading functions if we keep only one version.

1 Like

fine by me.

if folks have extremely brittle header scraping, yes this could be problematic.
reasonably general header parser routines should be OK.

How should this be done? Maybe using the existing stan::model_compile_info() but append additional strings to its output? To get hash we can either git rev-parse in makefile or use boost::regex + filesystem to grep. The 2nd option is for platforms user do not / cannot install or access git.