Junio C Hamano wrote: > Felipe Contreras <felipe.contreras@xxxxxxxxx> writes: > > >> Are we sure historical GIT_VERSION strings never had a SP in it? > >> I would be very surprised if we did, but the correctness of the > >> approach depends on that assumption. > > > > Why would that matter? > > Ah, that is true. What I should have worried more about was the > distribution package maintainers who may set their own version by > writing it in the "version" file themselves. In reality they don't do that. I checked Arch Linux, Fedora, and Debian, and all of them leave the version alone. It does make sense becasue for example in Arch Linux `2.40.0-1` means version `2.40.0`, release `1`. I believe all packaging systems use the same semantical distinction. I asked ChatGPT, and this is what it said about `-1`: -1 is the package release number. This number is used by the package maintainers to indicate how many times the package has been built and released. This number is typically incremented each time a new build of the package is released, even if the underlying software has not changed. So it makes sense for `git --version` to return the upstream version, not the package release number, and that's why packagers don't mess with that. Either way, even though I don't think it matters in practice, I generally prefer to separate fields with tabs, or even newlines. If you consider this an issue, we could do: printf '%s\n' $(GIT_VERSION) $(GIT_DATE) >version read -d'' VN DN <version Cheers. -- Felipe Contreras