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

Re: [PATCH] Introduce core.keepHardLinks

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 13, 2008, 18:06 UTC
Message-ID
<7v63nw9xor.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.1.00.0810131950140.22125@pacific.mpi-cbg.de.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 24 quoted lines
> On Mon, 13 Oct 2008, Junio C Hamano wrote:
>
>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>> 
>> > - all the editors that this guy tested keep the hard links, so it was 
>> >   kinda hard to understand why Git insists on behaving differently,
>> >
>> > - if the user asked for hard links, it is not Git's place to question 
>> >   that decision,
>> 
>> These are non-arguments,
>
> Actually, they are arguments.
>
> The thing is: these editors do what they do for a reason.  Which is 
> exactly the second reason.
>
> When a user makes hard links, it is not just for fun and bullocks.  It is 
> not for copy-on-write either, that's not what hard links are supposed to 
> do.  It is for cases when you need the _same_ information in two places.
>
> I am not that big a user of hard links myself, but when I do, I know 
> exactly what I am doing.  And with my patch and that config variable set 
> to true, Git will not interfer with that.

Ok, such a possible benefit should be described and defended better then. I only thought of the scenario Shawn has brought up, which is a downside of using this option without any conceivable upside, when I read your patch and your rationale you repeated in a few messages that followed.

You could have said something like "The users may want to have a checkout, and keep the same contents always appear elsewhere i.e. 'installing by hardlinking'. In such a setup, editing the source with an editor configured not to break hardlinks would still work fine, but git-checkout will unconditionally break such links, which is undesirable. Such a setup would want a configuration variable like this."

"It is not for fun and bullocks" is not a description any clearer than what you kept repeating, but if you stated it like the above, then I would not have had trouble understanding what you wanted to say.

The documentation update needs to warn about the Shawn's scenario. I also do not know what this should do when you have two tracked paths with identical contents hardlinked to each other. Because we do not track hardlinks, I _think_ breaking links would be the right thing to do for such paths regardless of this configuration variable.

It also raises another question. Don't you want this to be an attribute for paths, not all-or-nothing configuration per repository?

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 11 of 14 in “Introduce core.keepHardLinks”
  1. Introduce core.keepHardLinksJohannes Schindelin, Oct 11, 2008
  2. Shawn O. PearceOct 12, 2008
  3. Johannes SchindelinOct 13, 2008
  4. Junio C HamanoOct 13, 2008
  5. Johannes SchindelinOct 13, 2008
  6. Stephan BeyerOct 13, 2008
  7. Shawn O. PearceOct 13, 2008
  8. Johannes SchindelinOct 13, 2008
  9. Junio C HamanoOct 13, 2008
  10. Johannes SchindelinOct 13, 2008
  11. Junio C HamanoOct 13, 2008
  12. Johannes SchindelinOct 15, 2008
  13. Junio C HamanoOct 13, 2008
  14. Johannes SchindelinOct 13, 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.