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

Re: Please undo "Use git-merge instead of git-resolve in

From
Junio C Hamano <junkio@cox.net>
Date
Sep 24, 2005, 06:19 UTC
Message-ID
<7virwr2dka.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050923095742.GC10255@pasky.or.cz>
Petr Baudis <pasky@suse.cz> writes:
Show 11 quoted lines
> Dear diary, on Fri, Sep 23, 2005 at 11:34:16AM CEST, I got a letter
> where Junio C Hamano <junkio@cox.net> told me that...
>> Petr Baudis <pasky@suse.cz> writes:
>> 
>> > 	* cg-fetch can do with symlinked object database
>> 
>> Do you mean ".git/object" in the repository you are fetching
>> into is a symlink to somewhere, or something else?
>
> Yes, exactly that. You get it by doing cg-clone -l
> /local/path.

git-clone -l -s does optimization similar to that in spirit, but it does not create a repository with symlinked .git/object pointing at /some/where/original/repo/.git/object. Instead it uses alternates to borrow from the other; newly created objects are always stored locally.

But I thought you were talking about fetch. git-fetch should be able to pull into a repository whose .git/object happens to be a symlink pointing at somewhere else just fine.

> Just that if the reference pointer did not change, you don't try to pull
> any objects.

Both git-aware protocol and commit walker peek at the remote ref and stop without downloading objects if it is known to us, so I think we are OK.

Show 5 quoted lines
>>     $ git-init-db && git fetch http://kernel.org/pub/scm/git/git.git
>> 
>> should work.
>
> Good.

Of course, the above 'git fetch' only fetches remote HEAD and stores it in .git/FETCH_HEAD; if you truly want to 'clone', you could first run git-ls-remote to peek the remote refs and then give them as storing refspecs to git fetch, doing something like this (modulo renaming 'master' over there to 'origin' here):

	mkdir foo && cd foo && git-init-db
	refspec=$(git-ls-remote $repo | \
	        sed -n -e 's/^[0-9a-f]*	//' -e 's|refs/.*|&:&|p')
	git fetch $repo $refspec
Previous: Daniel Barkalow
Message 11 of 11 in “Re: Please undo "Use git-merge instead of git-resolve in”
  1. Jon LoeligerSep 22, 2005
  2. Petr BaudisSep 22, 2005
  3. SeanSep 22, 2005
  4. Junio C HamanoSep 22, 2005
  5. SeanSep 22, 2005
  6. Linus TorvaldsSep 22, 2005
  7. Petr BaudisSep 23, 2005
  8. Junio C HamanoSep 23, 2005
  9. Petr BaudisSep 23, 2005
  10. Daniel BarkalowSep 23, 2005
  11. Junio C HamanoSep 24, 2005

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.