git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] doc: set actual revdate for manpages

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 14, 2023, 18:59 UTC
Message-ID
<6439a28c34fe7_5f77329440@chronos.notmuch>
In-Reply-To
<xmqqv8hyqsc6.fsf@gitster.g>
Junio C Hamano wrote:
Show 11 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> 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
Previous: Junio C Hamano
Message 14 of 14 in “doc: set actual revdate for manpages”
  1. doc: set actual revdate for manpagesFelipe Contreras, Apr 13, 2023
  2. Jeff KingApr 14, 2023
  3. Felipe ContrerasApr 14, 2023
  4. Junio C HamanoApr 14, 2023
  5. Junio C HamanoApr 14, 2023
  6. Felipe ContrerasApr 14, 2023
  7. Felipe ContrerasApr 14, 2023
  8. Jeff KingApr 14, 2023
  9. Junio C HamanoApr 14, 2023
  10. Jeff KingApr 14, 2023
  11. Junio C HamanoApr 14, 2023
  12. Felipe ContrerasApr 14, 2023
  13. Junio C HamanoApr 14, 2023
  14. Felipe ContrerasApr 14, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.