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

Intoducing the .git file (again)

From
LHLars Hjemli <hjemli@gmail.com>
Date
Feb 17, 2008, 22:14 UTC
Message-ID
<1203286456-26033-1-git-send-email-hjemli@gmail.com>

These patches enables .git to be a textfile containing the path to the git directory proper. It passes all the tests so hopefully there are no regressions, but there may be bugs and omissions lurking when this feature is actually used; I've exercised it in my git, cgit and dayjob repos but git is big and has many codepaths so I wouldn't be suprised if there still are some git commands left which fails to obey the .git file.

PS: These patches could certainly be squashed into a single patch, but I've
left them as is to make each one easier to review.
PPS: If included, the .git file should probably be used by git-submodule to
clone submodule repositories into something like $GIT_DIR/submodules/<name>,
as that would make local submodule changes more resistant to dataloss due to
checkout/reset in the containing repository.
Shortlog:
 Add platform-independent .git "symlink"
 Fix setup of $GIT_DIR in git-sh-setup.sh
 Teach resolve_gitlink_ref() about the .git file
 git-submodule: prepare for the .git-file
 Teach GIT-VERSION-GEN about the .git file
Diffstat:
 Documentation/repository-layout.txt |    5 ++-
 GIT-VERSION-GEN                     |    2 +-
 cache.h                             |    1 +
 environment.c                       |   38 ++++++++++++++++++
 git-sh-setup.sh                     |   12 ++---
 git-submodule.sh                    |    4 +-
 refs.c                              |   17 +++++++-
 setup.c                             |    9 ++++
 t/t0002-gitfile.sh                  |   74 +++++++++++++++++++++++++++++++++++
 9 files changed, 148 insertions(+), 14 deletions(-)
Next: Lars Hjemli
Message 1 of 17 in “Intoducing the .git file (again)”
  1. Lars HjemliFeb 17, 2008
  2. 1/5 Add platform-independent .git "symlink"Lars Hjemli, Feb 17, 2008
  3. 2/5 Fix setup of $GIT_DIR in git-sh-setup.shLars Hjemli, Feb 17, 2008
  4. 3/5 Teach resolve_gitlink_ref() about the .git fileLars Hjemli, Feb 17, 2008
  5. 4/5 git-submodule: prepare for the .git-fileLars Hjemli, Feb 17, 2008
  6. 5/5 Teach GIT-VERSION-GEN about the .git fileLars Hjemli, Feb 17, 2008
  7. Junio C HamanoFeb 18, 2008
  8. Lars HjemliFeb 18, 2008
  9. Johannes SchindelinFeb 17, 2008
  10. Lars HjemliFeb 17, 2008
  11. 1/5 Add platform-independent .git "symlink"Lars Hjemli, Feb 17, 2008
  12. Junio C HamanoFeb 18, 2008
  13. Lars HjemliFeb 18, 2008
  14. Johannes SchindelinFeb 18, 2008
  15. Johannes SchindelinFeb 17, 2008
  16. Lars HjemliFeb 17, 2008
  17. Johannes SchindelinFeb 17, 2008

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.