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

Re: git clone, hardlinks and multiple users?

From
MHMarc Herbert <marc.herbert+news@gmail.com>
Date
Jan 23, 2012, 17:55 UTC
Message-ID
<jfk6up$3dj$1@dough.gmane.org>
In-Reply-To
<jfc8eh$ck5$1@dough.gmane.org>
On 20/01/2012 17:31, Marc Herbert wrote:
Show 7 quoted lines
> "git clone" is using hardlinks by default, even when cloning from a
> different user. In such a case the clone ends up with a number of files
> owned by someone else.
>
> Since only immutable objects are cloned this seems to work fine. However
> I would like to know if this "multiple users" case works by chance or by
> specification.

Sorry I meant: "since only immutable objects are HARDLINKED this seems to work fine".

A few other clarifications following Neal's long answer:
- Yes we are using Linux. But the question is about any filesystem 
supporting hardlinks and user permissions.
- My question is only about hardlinks in .git/objects/. Whatever happens 
in the checkout is irrelevant.
- I know how to clone with no hardlink and completely avoid the whole 
issue. Unfortunately people have this strange habit of using the 
simplest/default option, and it does hardlinks.

I guess my rephrased question is: while there is no obvious reason for git to attempt to touch files in .git/objects/, is there a promise that this will never, ever happen? Because it would fail in a multi-users config.

The "core.sharedRepository" option is good example. When set to a new value will it ever try to fix existing objects? That would fail.

Previous: Neal Kreitzinger
Message 3 of 3 in “git clone, hardlinks and multiple users?”
  1. Marc HerbertJan 20, 2012
  2. Neal KreitzingerJan 21, 2012
  3. Marc HerbertJan 23, 2012

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.