* Remote git-cat-file?
@ 2006-05-27 22:26 Elrond
2006-05-28 0:29 ` Linus Torvalds
0 siblings, 1 reply; 7+ messages in thread
From: Elrond @ 2006-05-27 22:26 UTC (permalink / raw)
To: git
Hi,
Is it possible via the git: protocol to do a git-cat-file?
To download just one object by its ID?
Thanks for your help.
Elrond
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Remote git-cat-file?
2006-05-27 22:26 Remote git-cat-file? Elrond
@ 2006-05-28 0:29 ` Linus Torvalds
2006-05-28 0:32 ` Linus Torvalds
2006-05-28 10:57 ` Elrond
0 siblings, 2 replies; 7+ messages in thread
From: Linus Torvalds @ 2006-05-28 0:29 UTC (permalink / raw)
To: Elrond; +Cc: git
On Sat, 27 May 2006, Elrond wrote:
>
> Is it possible via the git: protocol to do a git-cat-file?
>
> To download just one object by its ID?
Nope.
Well, depending on just how much you know about the object, you can fake
it. For example, if you already know it's a commit, and you know the
parents, then yes, you can download it by basically saying that you want
that particular object and you already have the parents.
But in the general case, the answer is no. Set up a gitweb thing, and look
up the objects that way. Or just pull the repo, and look at it locally.
Just out of interest, why would you ever want to just look at a single
object?
Linus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Remote git-cat-file?
2006-05-28 0:29 ` Linus Torvalds
@ 2006-05-28 0:32 ` Linus Torvalds
2006-05-28 10:57 ` Elrond
1 sibling, 0 replies; 7+ messages in thread
From: Linus Torvalds @ 2006-05-28 0:32 UTC (permalink / raw)
To: Elrond; +Cc: git
On Sat, 27 May 2006, Linus Torvalds wrote:
>
> Well, depending on just how much you know about the object, you can fake
> it. For example, if you already know it's a commit, and you know the
> parents, then yes, you can download it by basically saying that you want
> that particular object and you already have the parents.
The other (similar) case is for tag objects. When you do "git ls-remote"
on the remote repo, it will tell you both the tag object SHA and the
object SHA of the thing it points to, so you can then do a git protocol
exchange where you do a
for_each_tag
"want <tagsha1>"
for_each_tag
"have <objectitpointstosha1>"
and you'll get just the tag object back.
Linus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Remote git-cat-file?
2006-05-28 0:29 ` Linus Torvalds
2006-05-28 0:32 ` Linus Torvalds
@ 2006-05-28 10:57 ` Elrond
2006-05-28 12:00 ` Jakub Narebski
1 sibling, 1 reply; 7+ messages in thread
From: Elrond @ 2006-05-28 10:57 UTC (permalink / raw)
To: git
Linus Torvalds <torvalds <at> osdl.org> writes:
[...]
> But in the general case, the answer is no. Set up a gitweb thing, and look
> up the objects that way. Or just pull the repo, and look at it locally.
I ended up doing that (clone whole remote repo).
> Just out of interest, why would you ever want to just look at a single
> object?
Well...
I screwed up my local clone of a repo. git-fsck told me what objects I needed.
So I finally ended up downloading the whole repo again to extract 16 objects. ;)
The other possible use for remote git-cat-file:
It might be useful in shallow repos to selectively load objects "on demand".
(In fact, I screwed my repo by trying to make it shallow.)
Elrond
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Remote git-cat-file?
2006-05-28 10:57 ` Elrond
@ 2006-05-28 12:00 ` Jakub Narebski
2006-05-28 17:38 ` Junio C Hamano
0 siblings, 1 reply; 7+ messages in thread
From: Jakub Narebski @ 2006-05-28 12:00 UTC (permalink / raw)
To: git
Elrond wrote:
> Linus Torvalds <torvalds <at> osdl.org> writes:
>>
>> Just out of interest, why would you ever want to just look at a single
>> object?
[...]
>
> The other possible use for remote git-cat-file:
> It might be useful in shallow repos to selectively load objects "on demand".
> (In fact, I screwed my repo by trying to make it shallow.)
It would be nice I think to be able to have remote alternatives, loading
(downloading and saving) objects "on demand" ("lazy alternatives"). Not necessary
only with "shallow repo"/"shallow clone".
--
Jakub Narebski
Warsaw, Poland
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Remote git-cat-file?
2006-05-28 12:00 ` Jakub Narebski
@ 2006-05-28 17:38 ` Junio C Hamano
2006-05-28 18:34 ` Jakub Narebski
0 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2006-05-28 17:38 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
Jakub Narebski <jnareb@gmail.com> writes:
> It would be nice I think to be able to have remote alternatives,...
Yup, I think I've mentioned that one as one of "the mostly
unimplementable but would be very nice to have crazy wishlist
items" some time ago. What people would want is not a "shallow"
clone, but a "lazy" clone, and in the ideal world that would
obviously be a nice thing to have.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Remote git-cat-file?
2006-05-28 17:38 ` Junio C Hamano
@ 2006-05-28 18:34 ` Jakub Narebski
0 siblings, 0 replies; 7+ messages in thread
From: Jakub Narebski @ 2006-05-28 18:34 UTC (permalink / raw)
To: git
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> It would be nice I think to be able to have remote alternatives,...
>
> Yup, I think I've mentioned that one as one of "the mostly
> unimplementable but would be very nice to have crazy wishlist
> items" some time ago. What people would want is not a "shallow"
> clone, but a "lazy" clone, and in the ideal world that would
> obviously be a nice thing to have.
I think that it should be only "commit-lazy", i.e. downloading whole trees,
subtrees, and objects pointed by tags, only not following the parent links
of commits; perhaps also other links to commits (branches, tags, tag
objects).
--
Jakub Narebski
Warsaw, Poland
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-05-28 18:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-27 22:26 Remote git-cat-file? Elrond
2006-05-28 0:29 ` Linus Torvalds
2006-05-28 0:32 ` Linus Torvalds
2006-05-28 10:57 ` Elrond
2006-05-28 12:00 ` Jakub Narebski
2006-05-28 17:38 ` Junio C Hamano
2006-05-28 18:34 ` Jakub Narebski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).