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

Re: git-relink status (or bug?)

From
MZmarc zonzon <marc.zonzon+git@gmail.com>
Date
Jun 21, 2008, 20:23 UTC
Message-ID
<71295b5a0806211323s24d58004m21721a2c878c8737@mail.gmail.com>
In-Reply-To
<7v4p7ma90e.fsf@gitster.siamese.dyndns.org>
Thank you for your answer
On Sat, Jun 21, 2008 at 9:22 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> I do not think anybody uses it these days.  Instead either they clone with
> reference (or -s), or perhaps use new-workdir.
The goal of git-relink is analogous to the default local clone,
hardlinks can be safer than
 sharing because you don't loose anything when the origin directory
reset a branch.
I remark that git-clone(1) warn about -s use, but not --reference, but
they seems identical on these aspects.

In numerous cases you cannot suppose your alternate will keep your objects forever. I have posted recently such a case study http://thread.gmane.org/gmane.comp.version-control.git/85407 and when trying hardlinks, i found this bug. It happens that sharing was a better solution (but only with the help of Shawn answer I could set it up!)

This new-workdir seems also a nice script, that I never looked at before (But why is there no documentation on these contrib?)

Show 6 quoted lines
>
> Here is a totally untested fix.
>
> The "careful" part can be made much more clever and efficient by learning
> implementation details about the .idx file (it has the checksum for itself
> and the checksum for its .pack file at the end) but I did not bother.

Thank you I see that you only take the safe way, don't hardlink if something is different, but there would be a more efficient one, to link when the packs have the same name, and link also the idx. If they have the same name they have the same content (with a fair probability!)

I cannot provide a patch for that, because I'm not a perl programmer, and I'm too lazy to rewrite it in C or python!

> I do not think this in its current shape is committable, without
> improvements and success reports from the list.  Hint, hint...

Being "perl challenged" I cannot readproof the script, but at least I can test it but only on trivial test cases which make git-relink fail! (I have only tried once to use it to solve the previously cited problem)

Marc
Previous: Junio C Hamano
Message 3 of 3 in “git-relink status (or bug?)”
  1. Marc ZonzonJun 21, 2008
  2. Junio C HamanoJun 21, 2008
  3. marc zonzonJun 21, 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.