Re: What's the ".git/gitdir" file?
Mike Rappazzowrites: > On Tue, Oct 27, 2015 at 6:54 PM, Junio C Hamano wrote: >> Kyle Meyer writes: >> >>> When a ".git" file points to another repo, a ".git/gitdir" file is >>> created in that repo. >>> >>> For example, running >>> >>> $ mkdir repo-a repo-b >>> $ cd repo-a >>> $ git init >>> $ cd ../repo-b >>> $ echo "gitdir: ../repo-a/.git" > .git >>> $ git status >>> >>> results in a file "repo-a/.git/gitdir" that contains >>> >>> $ cat repo-a/.git/gitdir >>> .git >> >> Sounds like a bug in the recently added "worktree" stuff. Perhaps >> update_linked_gitdir() tweaked by 82fde87f (setup: update the right >> file in multiple checkouts, 2015-08-25) is misbehaving? > > I noticed that as I was working on the worktree list command that my > linked worktree gitdir files were being clobbered to '.git'. I > attributed it to my work, but now that you mention it, I think it has > happened with the 2.6.1 release as well. Thanks; I trust those who worked on the worktree feature in 2.6 timeframe would first take a look, OK? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: What's the ".git/gitdir" file?
-Original Message- On Tue, October-27-15 6:23 PM, Stefan Beller wrote: >On Tue, Oct 27, 2015 at 3:04 PM, Kyle Meyerwrote: >> When a ".git" file points to another repo, a ".git/gitdir" file is >> created in that repo. >> >> For example, running >> >> $ mkdir repo-a repo-b >> $ cd repo-a >> $ git init >> $ cd ../repo-b >> $ echo "gitdir: ../repo-a/.git" > .git >> $ git status >> >> results in a file "repo-a/.git/gitdir" that contains >> >> $ cat repo-a/.git/gitdir >> .git >> >> I don't see this file mentioned in the gitrepository-layout manpage, >> and my searches haven't turned up any information on it. What's the >> purpose of ".git/gitdir"? Are there cases where it will contain >> something other than ".git"? > >It's designed for submodules to work IIUC. > >Back in the day each git submodule had its own .git directory keeping its >local >objects. >Nowadays the repository of submodule is kept in the superprojects >>.git/modules/ directory. Slightly OT: Is there any way of avoiding having that file in the first place? I'm hoping to have a git repository in a normal file system (Posix) and a working area in a rather less-than-normal one where dots in file names are bad (actually a dot is a separator). Cheers, Randall -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: What's the ".git/gitdir" file?
On Tue, Oct 27, 2015 at 3:04 PM, Kyle Meyerwrote: > Hello, > > When a ".git" file points to another repo, a ".git/gitdir" file is > created in that repo. > > For example, running > > $ mkdir repo-a repo-b > $ cd repo-a > $ git init > $ cd ../repo-b > $ echo "gitdir: ../repo-a/.git" > .git > $ git status > > results in a file "repo-a/.git/gitdir" that contains > > $ cat repo-a/.git/gitdir > .git > > I don't see this file mentioned in the gitrepository-layout manpage, > and my searches haven't turned up any information on it. What's the > purpose of ".git/gitdir"? Are there cases where it will contain > something other than ".git"? > > Thanks. It's designed for submodules to work IIUC. Back in the day each git submodule had its own .git directory keeping its local objects. Nowadays the repository of submodule is kept in the superprojects .git/modules/ directory. If you are in the submodule however you need to know where the repository is, so we have a file pointing at ..//.git/modules/ directory. If not using submodules, I'd expect that file to not be there. If you have a file .git/gitdir which points to plain .git, this is technically correct, indicating where to find the repository (containing objects etc). > > -- > Kyle > git version 2.6.1 > -- > To unsubscribe from this list: send the line "unsubscribe git" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: What's the ".git/gitdir" file?
Kyle Meyerwrites: > When a ".git" file points to another repo, a ".git/gitdir" file is > created in that repo. > > For example, running > > $ mkdir repo-a repo-b > $ cd repo-a > $ git init > $ cd ../repo-b > $ echo "gitdir: ../repo-a/.git" > .git > $ git status > > results in a file "repo-a/.git/gitdir" that contains > > $ cat repo-a/.git/gitdir > .git Sounds like a bug in the recently added "worktree" stuff. Perhaps update_linked_gitdir() tweaked by 82fde87f (setup: update the right file in multiple checkouts, 2015-08-25) is misbehaving? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: What's the ".git/gitdir" file?
On Tue, Oct 27, 2015 at 3:42 PM, Randall S. Beckerwrote: > Slightly OT: Is there any way of avoiding having that file in the first > place? I'm hoping to have a git repository in a normal file system (Posix) > and a working area in a rather less-than-normal one where dots in file names > are bad (actually a dot is a separator). As said before, I would not expect a file .git/gitdir to be there if not using submodules. For your OT question, I'd presume you'd have environment variables setup export GIT_DIR=path_with_no_dots_and_git_repo_in_it # you mention that is in your posix FS export GIT_WORK_TREE=/some.place.with.dot.separators and you'd be good to go. > > Cheers, > Randall > -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: What's the ".git/gitdir" file?
On Tue, Oct 27, 2015 at 6:54 PM, Junio C Hamanowrote: > Kyle Meyer writes: > >> When a ".git" file points to another repo, a ".git/gitdir" file is >> created in that repo. >> >> For example, running >> >> $ mkdir repo-a repo-b >> $ cd repo-a >> $ git init >> $ cd ../repo-b >> $ echo "gitdir: ../repo-a/.git" > .git >> $ git status >> >> results in a file "repo-a/.git/gitdir" that contains >> >> $ cat repo-a/.git/gitdir >> .git > > Sounds like a bug in the recently added "worktree" stuff. Perhaps > update_linked_gitdir() tweaked by 82fde87f (setup: update the right > file in multiple checkouts, 2015-08-25) is misbehaving? I noticed that as I was working on the worktree list command that my linked worktree gitdir files were being clobbered to '.git'. I attributed it to my work, but now that you mention it, I think it has happened with the 2.6.1 release as well. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html