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

Re: [PATCH] Add .git/version

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Nov 17, 2005, 15:44 UTC
Message-ID
<200511171644.48438.Josef.Weidendorfer@gmx.de>
In-Reply-To
<11322339372137-git-send-email-matlads@dsmagic.com>
On Thursday 17 November 2005 14:25, Martin Atukunda wrote:
> This patch series attempts to add .git/version support to init-db.c. THis
> is an overview of the patches.

As .git/version is part of the repository, it should contain the version of the repository format used. Do you really want to link the version of the repository format with the version of git which created the repository? It think it is better to detach a repository version from version of git.

Why? Ideally, the git commands first should check if they can handle the repository format. If they can not handle the version, they should bail out with an error [*] Now suppose we want to release Git 2 without change the repository format at all. Thus, even if Git 1 tool *would* work with repositories created by Git 2, they will fail in the version check!

If this is meant to be used in scripts (as your commit comment mentions): a script should never touch any files in the repository directly, but go via commands supplied with git. So these scripts should actually check against the version of installed git. Thus, such a version string should go into git-var or better simply use the existing "git --version"?

Josef

[*] Junio: This should be done before Git 1.0 - it is needed to be able to change the repository format in the future without taking the risk that old git commands possibly corrupt a repo in the new format. This has nothing to do with backwards compatibility. Without a version, we are forced to be forwards compatible ;-) Needed in init-db.c is a "echo 1 >.git/version"; and the mentioned check in the tools against this version.

Previous: Josef WeidendorferNext: Andreas Ericsson
Message 8 of 16 in “Add .git/version”
  1. Add .git/versionMartin Atukunda, Nov 17, 2005
  2. 1/2 Build GIT_VERSION from VERSION, PATCHLEVEL, and SUBLEVEL variables.Martin Atukunda, Nov 17, 2005
  3. 2/2 Make init-db record the version in $GIT_DIR/version when creating repo.Martin Atukunda, Nov 17, 2005
  4. Johannes SchindelinNov 17, 2005
  5. Martin AtukundaNov 17, 2005
  6. Johannes SchindelinNov 17, 2005
  7. Josef WeidendorferNov 17, 2005
  8. Josef WeidendorferNov 17, 2005
  9. Andreas EricssonNov 17, 2005
  10. Josef WeidendorferNov 17, 2005
  11. Martin AtukundaNov 17, 2005
  12. Add .git/version (Take 2)Martin Atukunda, Nov 17, 2005
  13. Junio C HamanoNov 17, 2005
  14. Linus TorvaldsNov 17, 2005
  15. Johannes SchindelinNov 17, 2005
  16. Junio C HamanoNov 18, 2005

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.