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

Re: [PATCH] Add git-unbundle - unpack objects and references for disconnected transfer

From
Junio C Hamano <junkio@cox.net>
Date
Feb 16, 2007, 07:24 UTC
Message-ID
<7vk5yia7l7.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<45D54DB0.4090300@verizon.net>
Mark Levedahl <mdl123@verizon.net> writes:
> I'm not sure I follow the logic here. Assuming the object is a
> prerequisite of the bundle and exists, it will be reachable from an
> updated reference once the bundle is applied, no?

No. That's not the point. Yes, the object might be reachable, but you haven't proven that everything necessary to complete that object is already in the object store. We never trust existence of an object alone when doing an operation that updates a ref. Having unreferenced objects in the object store is a norm, but refs pointing at an object, some of whose prerequisites are missing, is a crime.

For example, suppose an earlier http-fetch found that the updated master should be at commit 'x', downloaded 'x', and you killed the process with ^C. It died without updating refs/remotes/origin/master, which is good. Then you have a bundle to unpack that has 'x' as a boundary.

You would start with a repository like this:
  ---o---o---o...-...-...-...x
             ^origin.

where 'x' is a dangling commit, '-' are ones that you do not have but you ought to have them in order for 'x' to be complete, and 'o' are complete commits. If the bundle boundary falls on the 'x' commit, you cannot say "I have all that are needed to complete this 'x'". You only have 'x' but still lack its prerequisites. That's what it means never to trust the mere existence of an object.

Linus's suggestion would make rev-list barf when 'x' cannot reach any existing ref, which is a good solution for this problem.

Also as Shawn pointed out, the script too heavily depends on GNU tar. Can we do something about it? Requiring GNU tar is probably fine if the script absolutely needs its extended features, as long as people have ways to tweak the command name in the script to point at their installed GNU tar (remember, some systems have GNU tar under different name such as "gtar").

Although if we require GNU tar we might be better off placing this under contrib/ not at the toplevel. I dunno.

Previous: Mark LevedahlNext: Junio C Hamano
Message 15 of 22 in “Respun - Scripts to use bundles to move data between repos”
  1. Mark LevedahlFeb 16, 2007
  2. Add git-bundle - pack objects and references for disconnected transferMark Levedahl, Feb 16, 2007
  3. Add git-unbundle - unpack objects and references for disconnected transferMark Levedahl, Feb 16, 2007
  4. Include git-bundle and git-unbundle in Makefile.Mark Levedahl, Feb 16, 2007
  5. Create documentation for git-bundle.Mark Levedahl, Feb 16, 2007
  6. Create documentation for git-unbundle.Mark Levedahl, Feb 16, 2007
  7. Link git-bundle and git-unbundle docs from git(7).Mark Levedahl, Feb 16, 2007
  8. Junio C HamanoFeb 16, 2007
  9. Linus TorvaldsFeb 16, 2007
  10. Add git-unbundle - unpack objects and references for disconnected transferMark Levedahl, Feb 16, 2007
  11. Shawn O. PearceFeb 16, 2007
  12. Junio C HamanoFeb 16, 2007
  13. Shawn O. PearceFeb 16, 2007
  14. Mark LevedahlFeb 16, 2007
  15. Junio C HamanoFeb 16, 2007
  16. Junio C HamanoFeb 16, 2007
  17. Shawn O. PearceFeb 16, 2007
  18. Junio C HamanoFeb 16, 2007
  19. Add git-bundle - pack objects and references for disconnected transferMark Levedahl, Feb 16, 2007
  20. Shawn O. PearceFeb 16, 2007
  21. Simon 'corecode' SchubertFeb 16, 2007
  22. Shawn O. PearceFeb 16, 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.