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

Re: Git benchmark - comparison with Bazaar, Darcs, Git and Mercurial

From
Johan Herland <johan@herland.net>
Date
Aug 3, 2007, 08:20 UTC
Message-ID
<200708031020.43492.johan@herland.net>
In-Reply-To
<7v3az1samx.fsf@assigned-by-dhcp.cox.net>
On Friday 03 August 2007, Junio C Hamano wrote:
Show 13 quoted lines
> David Kastrup <dak@gnu.org> writes:
> 
> > Junio C Hamano <gitster@pobox.com> writes:
> >
> >>  * With -l, as long as the source repository is healthy, it is
> >>    very likely that the recipient would be, too.  Also it is
> >>    very cheap.  You do not get any back-up benefit.
> >
> > Oh, but one does: an overzealous prune or rm -oopswrongoption in one
> > repo does not hurt the other.
> 
> That's not "back-up" benefit I was thinking about.  It is more
> about protecting your data from hardware failure.

If one is serious about backing up ones repo to protect it from hardware failure, there is not much use at all in cloning (by copy, hardlink, or otherwise) to a different location on the _same_ filesystem. In order for a backup to be at least marginally useful, it should be on a different disk drive (which you hint at below), or even better; on a different continent...

My point is as follows: One has to clone a repo onto (at least) a different filesystem if one is serious about backup. But if one is cloning to a different filesystem, hardlinking is no longer an option; git _has_ to make a copy of some sort. Therefore we might as well hardlink as long as we're on a single filesystem (since the extra copy would not be worth much, backup-wise).

> You physically have bits in two places, preferrably on separate disk
> drives.
> And that is what you do not get from hardlinked clone.

If the two copies are on separate disk drives (i.e. separate filesystems), you cannot make a hardlink in the first place. If the two copies are on the same filesystem, they're not much more worth than a single copy (backup-wise).

Given the clone-to-same-filesystem(-with-hardlink-capability) scenario (which is the only scenario where we have the option of using hardlinks), we have the following pros and cons when using hardlinks instead of copying:

Pros:
- Hardlink is _much_ faster (for big repos, we're talking orders of 
magnitude faster)
Cons:
- Hardlink will not leave two copies on the disk. But I'm arguing that the 
additional copy will have pretty much _no_ value from a redundancy POV, 
since the copy is still left on the _same_ filesystem. Some would even go 
as far as to say that the second copy provides a false sense of security as 
long as it is located on the same filesystem.
Have fun!
...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: David KastrupNext: Theodore Tso
Message 18 of 29 in “Git benchmark - comparison with Bazaar, Darcs, Git and Mercurial”
  1. Jakub NarebskiAug 1, 2007
  2. Linus TorvaldsAug 1, 2007
  3. Junio C HamanoAug 1, 2007
  4. David KastrupAug 1, 2007
  5. Theodore TsoAug 1, 2007
  6. Junio C HamanoAug 1, 2007
  7. Alex RiesenAug 1, 2007
  8. Alex RiesenAug 1, 2007
  9. Alex RiesenAug 1, 2007
  10. Carl WorthAug 1, 2007
  11. Linus TorvaldsAug 1, 2007
  12. David KastrupAug 1, 2007
  13. Florian WeimerAug 1, 2007
  14. Junio C HamanoAug 2, 2007
  15. David KastrupAug 2, 2007
  16. Junio C HamanoAug 3, 2007
  17. David KastrupAug 3, 2007
  18. Johan HerlandAug 3, 2007
  19. Theodore TsoAug 1, 2007
  20. Brandon CaseyAug 1, 2007
  21. Allan WindAug 2, 2007
  22. Linus TorvaldsAug 2, 2007
  23. Jakub NarebskiAug 1, 2007
  24. Jakub NarebskiAug 2, 2007
  25. Ramsay JonesAug 2, 2007
  26. Jakub NarebskiAug 1, 2007
  27. Junio C HamanoAug 1, 2007
  28. Jakub NarebskiAug 1, 2007
  29. Shawn O. PearceAug 1, 2007

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.