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

Re: What's cooking in git.git (topics)

From
LHLars Hjemli <hjemli@gmail.com>
Date
Feb 7, 2008, 09:43 UTC
Message-ID
<8c5c35580802070143g697d82b7s3b04019664892f74@mail.gmail.com>
In-Reply-To
<20080207050548.GA32242@sigill.intra.peff.net>
On Feb 7, 2008 6:05 AM, Jeff King <peff@peff.net> wrote:
Show 14 quoted lines
> On Wed, Feb 06, 2008 at 06:03:51PM -0800, Junio C Hamano wrote:
>
> > * lh/gitdir (Mon Feb 4 21:59:21 2008 +0100) 4 commits
> >  - git-submodule: prepare for the .git-file
> >  - Add tests for .git file
> >  - Document the .git-file
> >  - Add platform-independent .git "symlink"
> >
> > Seems to have funny interaction with Jeff King's test script
> > updates.
>
> I think this is a bug in Lars' code. The problem is that even though we
> set GIT_DIR to the contents of the '.git' file, we may already have run
> setup_git_env, which creates and remembers paths like '.git/objects'.
Yeah, we need to run set_git_dir() to get all the paths set correctly:
diff --git a/setup.c b/setup.c
index 2cbda91..64b069f 100644
--- a/setup.c
+++ b/setup.c
@@ -339,7 +339,8 @@ const char *setup_git_directory_gently(int *nongit_ok)
        for (;;) {
                gitfile_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);
                if (gitfile_dir) {
-                       setenv(GIT_DIR_ENVIRONMENT, gitfile_dir, 1);
+                       if (set_git_dir(gitfile_dir))
+                               return NULL;
                        break;
                }
                if (is_git_directory(DEFAULT_GIT_DIR_ENVIRONMENT))

But this isn't enough either, git-sh-setup.sh needs a patch when
setting GIT_DIR and I just noticed merge-recursive failing (it needs
to call setup_git_directory() in it's main()).

I'll work on this tonight.
-- 
larsh
Previous: Jeff KingNext: Jakub Narebski
Message 8 of 50 in “What's cooking in git.git (topics)”
  1. Junio C HamanoFeb 3, 2008
  2. Johannes SchindelinFeb 3, 2008
  3. Junio C HamanoFeb 5, 2008
  4. Jakub NarebskiFeb 5, 2008
  5. Junio C HamanoFeb 6, 2008
  6. Junio C HamanoFeb 7, 2008
  7. Jeff KingFeb 7, 2008
  8. Lars HjemliFeb 7, 2008
  9. Jakub NarebskiFeb 7, 2008
  10. Junio C HamanoFeb 10, 2008
  11. Jakub NarebskiFeb 10, 2008
  12. Johannes SchindelinFeb 10, 2008
  13. Junio C HamanoFeb 10, 2008
  14. Junio C HamanoFeb 10, 2008
  15. Junio C HamanoFeb 12, 2008
  16. reflog-delete, was Re: What's cooking in git.git (topics)Johannes Schindelin, Feb 12, 2008
  17. Junio C HamanoFeb 17, 2008
  18. Jeff KingFeb 17, 2008
  19. Jakub NarebskiFeb 17, 2008
  20. Junio C HamanoFeb 17, 2008
  21. Jakub NarebskiFeb 17, 2008
  22. Junio C HamanoFeb 18, 2008
  23. Jakub NarebskiFeb 18, 2008
  24. Matthias KestenholzFeb 17, 2008
  25. Junio C HamanoFeb 17, 2008
  26. Jeff KingFeb 17, 2008
  27. [Announce] 'next' rewound and rebasedJunio C Hamano, Feb 17, 2008
  28. Junio C HamanoFeb 21, 2008
  29. Johannes SchindelinFeb 21, 2008
  30. Junio C HamanoFeb 21, 2008
  31. Brandon CaseyFeb 22, 2008
  32. 1/4 git-reflog: add option --rewrite to update reflog entries while expiringBrandon Casey, Feb 22, 2008
  33. reflog-delete: parse standard reflog optionsBrandon Casey, Feb 22, 2008
  34. Junio C HamanoFeb 22, 2008
  35. Brandon CaseyFeb 23, 2008
  36. Junio C HamanoFeb 23, 2008
  37. Junio C HamanoFeb 23, 2008
  38. Brandon CaseyFeb 23, 2008
  39. Junio C HamanoFeb 25, 2008
  40. Junio C HamanoFeb 28, 2008
  41. Junio C HamanoMar 1, 2008
  42. Shawn O. PearceMar 2, 2008
  43. Junio C HamanoMar 3, 2008
  44. Junio C HamanoMar 6, 2008
  45. Johannes SchindelinMar 6, 2008
  46. Junio C HamanoMar 8, 2008
  47. 2/4 refs.c: make close_ref() and commit_ref() non-staticBrandon Casey, Feb 22, 2008
  48. 3/4 git-reflog: add option --updateref to write the last reflog sha1 into the refBrandon Casey, Feb 22, 2008
  49. 4/4 git-stash: add new 'drop' subcommandBrandon Casey, Feb 22, 2008
  50. git-stash: add new 'pop' subcommandBrandon Casey, Feb 22, 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.