Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » info/refs and ^{}
info/refs and ^{} [message #6786] Sat, 09 May 2009 23:23 Go to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.nospam.yahoo.com

I'm working on reproducing the info/refs from a test git repository, and I am
missing some ^{} entries:

6db9c2ebf75590eef973081736730a9ea169a0c4 refs/tags/A
17768080a2318cd89bba4c8b87834401e2095703 refs/tags/B
d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864 refs/tags/B^{} <- missing this
032c063ce34486359e3ee3d4f9e5c225b9e1a4c2 refs/tags/B10th
d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864 refs/tags/B10th^{} <- missing this

I can see these come from lines in the packed-refs file, but when using
Repository.getAllRefs() these aren't listed. Is there anything I can do to get
these from Repository, or do I have to parse the contents of packed-refs to
find out?

Alex
Re: info/refs and ^{} [message #6793 is a reply to message #6786] Sat, 09 May 2009 23:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.nospam.yahoo.com

Alex Blewitt wrote:
> I can see these come from lines in the packed-refs file, but when using
> Repository.getAllRefs() these aren't listed. Is there anything I can do to
get
> these from Repository, or do I have to parse the contents of packed-refs to
> find out?

As a follow-up, if I use Repository.getAllRefsByPeeledObjectId, I can find
some entries like this:

AnyObjectId[d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864]=[Ref[r efs/tags/B5th=efee
904c794b943a06931c76c576dd552212e8bc],
Ref[refs/tags/B7th=a773cd2d9dbca00d08793dac0d7002a49f0428c0] ,

However, I don't understand if this is the right one to use to generate out
(say) B5th^{} with the parent reference. In addition, there are some entries
(like fd608fbe625a2b456d9f15c2b1dc41f252057dd7
refs/tags/spearce-gpg-pub^{}) which might be from a single reference in this
map:

AnyObjectId[fd608fbe625a2b456d9f15c2b1dc41f252057dd7]=[Ref[r efs/tags/spearce-g
pg-pub=8bbde7aacf771a9afb6992434f1ae413e010c6d8]]


However, I don't understand why I don't see other entries in there, like:

AnyObjectId[d0114ab8ac326bab30e3a657a0397578c5a1af88]=[Ref[r efs/heads/e=d0114a
b8ac326bab30e3a657a0397578c5a1af88]]


If there were a rule, like 'only print it out for those which have two or
more' then I could understand how to generate them; but given I don't know why
I see spearce-gpg-pub^{} but not e^{} in the info/refs file.

Alex
Re: info/refs and ^{} [message #6800 is a reply to message #6786] Sun, 10 May 2009 10:46 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Alex Blewitt wrote:

> I'm working on reproducing the info/refs from a test git repository, and I
> am missing some ^{} entries:
>
> 6db9c2ebf75590eef973081736730a9ea169a0c4 refs/tags/A
> 17768080a2318cd89bba4c8b87834401e2095703 refs/tags/B
> d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864 refs/tags/B^{} <- missing this
> 032c063ce34486359e3ee3d4f9e5c225b9e1a4c2 refs/tags/B10th
> d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864 refs/tags/B10th^{} <- missing
> this
>
> I can see these come from lines in the packed-refs file, but when using
> Repository.getAllRefs() these aren't listed. Is there anything I can do to
B^{} is the peeled refs, i.e. the object a tag refers to

> get these from Repository, or do I have to parse the contents of
> packed-refs to find out?

Repository has a peel method.

peeledref = repo.peel(ref); // null if problem. May be same as ref
peeledid = peeled.getPeeledObjectId(); // null if not a tag

A ref may be peeled or not, when you get it from getAllRefs

-- robin
Re: info/refs and ^{} [message #6807 is a reply to message #6800] Sun, 10 May 2009 11:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alex_blewitt.nospam.yahoo.com

>Robin Rosenberg wrote:
>> Alex Blewitt wrote:
>>
>> I can see these come from lines in the packed-refs file, but when using
>> Repository.getAllRefs() these aren't listed. Is there anything I can do to
> B^{} is the peeled refs, i.e. the object a tag refers to
>
>> get these from Repository, or do I have to parse the contents of
>> packed-refs to find out?
>
> Repository has a peel method.
>
> peeledref = repo.peel(ref); // null if problem. May be same as ref
> peeledid = peeled.getPeeledObjectId(); // null if not a tag

Excellent! I can now dump out the same format for the info/refs, with the
possible exception of HEAD. If I generate the list myself for egit, I get:

baca4a2e2ed5fd2a19a7136baba3d8b05cc15d31 HEAD
baca4a2e2ed5fd2a19a7136baba3d8b05cc15d31 refs/heads/master
9f0e280a3bada33978b2c0766886a25cd16994b4 refs/remotes/origin/master
3c064161d4568dd9cf3d76c0921a19ef1bc280b6 refs/remotes/origin/stable
8bbde7aacf771a9afb6992434f1ae413e010c6d8 refs/tags/spearce-gpg-pub
fd608fbe625a2b456d9f15c2b1dc41f252057dd7 refs/tags/spearce-gpg-pub^{}

(that has local commits in my HEAD, of course). If I look at the entries
generated by git update-server-info, I get:

baca4a2e2ed5fd2a19a7136baba3d8b05cc15d31 refs/heads/master
9f0e280a3bada33978b2c0766886a25cd16994b4 refs/remotes/origin/HEAD
9f0e280a3bada33978b2c0766886a25cd16994b4 refs/remotes/origin/master
3c064161d4568dd9cf3d76c0921a19ef1bc280b6 refs/remotes/origin/stable
8bbde7aacf771a9afb6992434f1ae413e010c6d8 refs/tags/spearce-gpg-pub
fd608fbe625a2b456d9f15c2b1dc41f252057dd7 refs/tags/spearce-gpg-pub^{}

I can filter out the HEAD (which seems to be put in there manaully by
readRefs())

try {
final Ref r = readRefBasic(Constants.HEAD, 0);
if (r != null && r.getObjectId() != null)
avail.put(Constants.HEAD, r);
} catch (IOException e) {

But I don't know where/how the refs/remotes/origin/HEAD is being put in (or,
if it's something that is to be concerned about). Obviously I'd like to be
equivalent to what server-update-info is doing if possible; but it's
measurable progress, at least.

Alex
Re: info/refs and ^{} [message #6813 is a reply to message #6807] Sun, 10 May 2009 13:22 Go to previous message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Alex Blewitt wrote:
> (that has local commits in my HEAD, of course). If I look at the entries
> generated by git update-server-info, I get:
>
> baca4a2e2ed5fd2a19a7136baba3d8b05cc15d31 refs/heads/master
> 9f0e280a3bada33978b2c0766886a25cd16994b4 refs/remotes/origin/HEAD
> 9f0e280a3bada33978b2c0766886a25cd16994b4 refs/remotes/origin/master
> 3c064161d4568dd9cf3d76c0921a19ef1bc280b6 refs/remotes/origin/stable
> 8bbde7aacf771a9afb6992434f1ae413e010c6d8 refs/tags/spearce-gpg-pub
> fd608fbe625a2b456d9f15c2b1dc41f252057dd7
> refs/tags/spearce-gpg-pub^{}
>
> I can filter out the HEAD (which seems to be put in there manaully by
> readRefs())
>
> try {
> final Ref r = readRefBasic(Constants.HEAD, 0);
> if (r != null && r.getObjectId() != null)
> avail.put(Constants.HEAD, r);
> } catch (IOException e) {
>
> But I don't know where/how the refs/remotes/origin/HEAD is being put in
> (or, if it's something that is to be concerned about). Obviously I'd like
> to be equivalent to what server-update-info is doing if possible; but it's
> measurable progress, at least.

For now. don't worry. It seems like a bug in the refs reading code in jgit.

-- robin
Re: info/refs and ^{} [message #572751 is a reply to message #6786] Sat, 09 May 2009 23:42 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Alex Blewitt wrote:
> I can see these come from lines in the packed-refs file, but when using
> Repository.getAllRefs() these aren't listed. Is there anything I can do to
get
> these from Repository, or do I have to parse the contents of packed-refs to
> find out?

As a follow-up, if I use Repository.getAllRefsByPeeledObjectId, I can find
some entries like this:

AnyObjectId[d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864]=[Ref[r efs/tags/B5th=efee
904c794b943a06931c76c576dd552212e8bc],
Ref[refs/tags/B7th=a773cd2d9dbca00d08793dac0d7002a49f0428c0] ,

However, I don't understand if this is the right one to use to generate out
(say) B5th^{} with the parent reference. In addition, there are some entries
(like fd608fbe625a2b456d9f15c2b1dc41f252057dd7
refs/tags/spearce-gpg-pub^{}) which might be from a single reference in this
map:

AnyObjectId[fd608fbe625a2b456d9f15c2b1dc41f252057dd7]=[Ref[r efs/tags/spearce-g
pg-pub=8bbde7aacf771a9afb6992434f1ae413e010c6d8]]


However, I don't understand why I don't see other entries in there, like:

AnyObjectId[d0114ab8ac326bab30e3a657a0397578c5a1af88]=[Ref[r efs/heads/e=d0114a
b8ac326bab30e3a657a0397578c5a1af88]]


If there were a rule, like 'only print it out for those which have two or
more' then I could understand how to generate them; but given I don't know why
I see spearce-gpg-pub^{} but not e^{} in the info/refs file.

Alex
Re: info/refs and ^{} [message #572769 is a reply to message #6786] Sun, 10 May 2009 10:46 Go to previous message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Alex Blewitt wrote:

> I'm working on reproducing the info/refs from a test git repository, and I
> am missing some ^{} entries:
>
> 6db9c2ebf75590eef973081736730a9ea169a0c4 refs/tags/A
> 17768080a2318cd89bba4c8b87834401e2095703 refs/tags/B
> d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864 refs/tags/B^{} <- missing this
> 032c063ce34486359e3ee3d4f9e5c225b9e1a4c2 refs/tags/B10th
> d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864 refs/tags/B10th^{} <- missing
> this
>
> I can see these come from lines in the packed-refs file, but when using
> Repository.getAllRefs() these aren't listed. Is there anything I can do to
B^{} is the peeled refs, i.e. the object a tag refers to

> get these from Repository, or do I have to parse the contents of
> packed-refs to find out?

Repository has a peel method.

peeledref = repo.peel(ref); // null if problem. May be same as ref
peeledid = peeled.getPeeledObjectId(); // null if not a tag

A ref may be peeled or not, when you get it from getAllRefs

-- robin
Re: info/refs and ^{} [message #572810 is a reply to message #6800] Sun, 10 May 2009 11:41 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
>Robin Rosenberg wrote:
>> Alex Blewitt wrote:
>>
>> I can see these come from lines in the packed-refs file, but when using
>> Repository.getAllRefs() these aren't listed. Is there anything I can do to
> B^{} is the peeled refs, i.e. the object a tag refers to
>
>> get these from Repository, or do I have to parse the contents of
>> packed-refs to find out?
>
> Repository has a peel method.
>
> peeledref = repo.peel(ref); // null if problem. May be same as ref
> peeledid = peeled.getPeeledObjectId(); // null if not a tag

Excellent! I can now dump out the same format for the info/refs, with the
possible exception of HEAD. If I generate the list myself for egit, I get:

baca4a2e2ed5fd2a19a7136baba3d8b05cc15d31 HEAD
baca4a2e2ed5fd2a19a7136baba3d8b05cc15d31 refs/heads/master
9f0e280a3bada33978b2c0766886a25cd16994b4 refs/remotes/origin/master
3c064161d4568dd9cf3d76c0921a19ef1bc280b6 refs/remotes/origin/stable
8bbde7aacf771a9afb6992434f1ae413e010c6d8 refs/tags/spearce-gpg-pub
fd608fbe625a2b456d9f15c2b1dc41f252057dd7 refs/tags/spearce-gpg-pub^{}

(that has local commits in my HEAD, of course). If I look at the entries
generated by git update-server-info, I get:

baca4a2e2ed5fd2a19a7136baba3d8b05cc15d31 refs/heads/master
9f0e280a3bada33978b2c0766886a25cd16994b4 refs/remotes/origin/HEAD
9f0e280a3bada33978b2c0766886a25cd16994b4 refs/remotes/origin/master
3c064161d4568dd9cf3d76c0921a19ef1bc280b6 refs/remotes/origin/stable
8bbde7aacf771a9afb6992434f1ae413e010c6d8 refs/tags/spearce-gpg-pub
fd608fbe625a2b456d9f15c2b1dc41f252057dd7 refs/tags/spearce-gpg-pub^{}

I can filter out the HEAD (which seems to be put in there manaully by
readRefs())

try {
final Ref r = readRefBasic(Constants.HEAD, 0);
if (r != null && r.getObjectId() != null)
avail.put(Constants.HEAD, r);
} catch (IOException e) {

But I don't know where/how the refs/remotes/origin/HEAD is being put in (or,
if it's something that is to be concerned about). Obviously I'd like to be
equivalent to what server-update-info is doing if possible; but it's
measurable progress, at least.

Alex
Re: info/refs and ^{} [message #572840 is a reply to message #6807] Sun, 10 May 2009 13:22 Go to previous message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Alex Blewitt wrote:
> (that has local commits in my HEAD, of course). If I look at the entries
> generated by git update-server-info, I get:
>
> baca4a2e2ed5fd2a19a7136baba3d8b05cc15d31 refs/heads/master
> 9f0e280a3bada33978b2c0766886a25cd16994b4 refs/remotes/origin/HEAD
> 9f0e280a3bada33978b2c0766886a25cd16994b4 refs/remotes/origin/master
> 3c064161d4568dd9cf3d76c0921a19ef1bc280b6 refs/remotes/origin/stable
> 8bbde7aacf771a9afb6992434f1ae413e010c6d8 refs/tags/spearce-gpg-pub
> fd608fbe625a2b456d9f15c2b1dc41f252057dd7
> refs/tags/spearce-gpg-pub^{}
>
> I can filter out the HEAD (which seems to be put in there manaully by
> readRefs())
>
> try {
> final Ref r = readRefBasic(Constants.HEAD, 0);
> if (r != null && r.getObjectId() != null)
> avail.put(Constants.HEAD, r);
> } catch (IOException e) {
>
> But I don't know where/how the refs/remotes/origin/HEAD is being put in
> (or, if it's something that is to be concerned about). Obviously I'd like
> to be equivalent to what server-update-info is doing if possible; but it's
> measurable progress, at least.

For now. don't worry. It seems like a bug in the refs reading code in jgit.

-- robin
Previous Topic:info/refs and ^{}
Next Topic:Update on project creation status
Goto Forum:
  


Current Time: Tue Aug 16 00:47:58 GMT 2022

Powered by FUDForum. Page generated in 0.02299 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top