Skip to contentSkip to conversation

when does git start caring about symlinks?

DISCUSSION Neal Kreitzinger 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

I have a question on how symlinks work and at what point git starts caring about them. If dirA/repoA/.git has no symlinks and I copy it to dirB/repoB/.git (ie. cp -rp /dirA/repoA/.git /dirB/repoB/.git), but /dirB is a symlink to /x/dirB does that mean that repoB contains symlinks (I suspect that repoB may be made up of all symlinks at this point)? In other words, if I parallel test repoA and repoB am I running a true parallel test or are the repos different because repoA has no symlinks and repoB has symlinks?

v/r,
Neal

#1 lore raw
Quoted 7 lines · Neal Kreitzinger

I have a question on how symlinks work and at what point git starts caring about them.  If dirA/repoA/.git has no symlinks and I copy it to dirB/repoB/.git (ie. cp -rp /dirA/repoA/.git /dirB/repoB/.git), but /dirB is a symlink to /x/dirB does that mean that repoB contains symlinks (I suspect that repoB may be made up of all symlinks at this point)?  In other words, if I parallel test repoA and repoB am I running a true parallel test or are the repos different because repoA has no symlinks and repoB has symlinks?

There should be no difference between repoA and repoB until you make changes. Symlinks outside worktree do not matter. Symlinks inside .git dir may cause problems when you start updating repos. But I don't think recent git creates symlinks. There are other forms of symlinks in .git dir though: .git as a file that points to real .git dir, or .git/info/alternates comes to mind.

Signature · 1 line
Duy
#2 lore raw
Quoted 16 lines

"Nguyen Thai Ngoc Duy" <[email protected]> wrote in message

Quoted 1 line

news:[email protected]...

Quoted 11 lines · Neal Kreitzinger

I have a question on how symlinks work and at what point git starts caring
about them. If dirA/repoA/.git has no symlinks and I copy it to dirB/repoB/.git (ie. cp -rp /dirA/repoA/.git /dirB/repoB/.git), but /dirB is
a symlink to /x/dirB does that mean that repoB contains symlinks (I suspect
that repoB may be made up of all symlinks at this point)? In other words, if I parallel test repoA and repoB am I running a true parallel test or are
the repos different because repoA has no symlinks and repoB has symlinks?

Quoted 8 lines

There should be no difference between repoA and repoB until you make changes. Symlinks outside worktree do not matter. Symlinks inside .git dir may cause problems when you start updating repos. But I don't think recent git creates symlinks. There are other forms of symlinks in .git dir though: .git as a file that points to real .git dir, or .git/info/alternates comes to mind.

Signature · 1 line
Duy

Thank you for clarifying this for me. I see that I mistyped my copy command. It's actually "cp -rp /dirA/repoA /dirB/repoB", but you understood what I meant anyway when you stated "Symlinks outside worktree do not matter". :)

v/r,
Neal