librelist archives

« back to archive

A small question about git_reference_listall

A small question about git_reference_listall

From:
David Versmisse
Date:
2011-04-15 @ 09:34
Hello,

i have a small question about git_reference_listall:

i tried a git_reference_listall with GIT_REF_LISTALL on a small
test repo and i have this result: 'refs/heads/i18n', 'refs/heads/master'

I don't see HEAD.

Is HEAD a symbolic reference ? Why do i not see it ?

Thank you in advance,
Best regards,
D. Versmisse

-- 
David Versmisse
Itaapy <http://www.itaapy.com>         Tel +33 (0)1 42 23 67 45
9 rue Darwin, 75018 Paris              Fax +33 (0)1 53 28 27 88
_______________________________________________
Itaapy mailing list
Itaapy@ikaaro.org
http://mail.ikaaro.org/mailman/listinfo/itaapy

Re: [libgit2] A small question about git_reference_listall

From:
Emeric Fermas
Date:
2011-04-15 @ 10:05
Hello David,

As far as I remember, git_reference_listall() returns all the names of
the references (either symbolic or direct) located under the "refs/"
directory.
HEAD is located at the root of the git repository. Therefore, it is
not returned.

It should act in a similar was as a plain "git show-ref".

Hope that helps,
Em.



On Fri, Apr 15, 2011 at 11:34 AM, David Versmisse <davidv@itaapy.com> wrote:
> Hello,
>
> i have a small question about git_reference_listall:
>
> i tried a git_reference_listall with GIT_REF_LISTALL on a small
> test repo and i have this result: 'refs/heads/i18n', 'refs/heads/master'
>
> I don't see HEAD.
>
> Is HEAD a symbolic reference ? Why do i not see it ?
>
> Thank you in advance,
> Best regards,
> D. Versmisse
>
> --
> David Versmisse
> Itaapy <http://www.itaapy.com>         Tel +33 (0)1 42 23 67 45
> 9 rue Darwin, 75018 Paris              Fax +33 (0)1 53 28 27 88
> _______________________________________________
> Itaapy mailing list
> Itaapy@ikaaro.org
> http://mail.ikaaro.org/mailman/listinfo/itaapy
>

Re: [libgit2] A small question about git_reference_listall

From:
Vicent Marti
Date:
2011-04-15 @ 10:31
Hey,

On Fri, Apr 15, 2011 at 6:05 AM, Emeric Fermas <emeric.fermas@gmail.com> wrote:
> Hello David,
>
> As far as I remember, git_reference_listall() returns all the names of
> the references (either symbolic or direct) located under the "refs/"
> directory.
> HEAD is located at the root of the git repository. Therefore, it is
> not returned.
>
> It should act in a similar was as a plain "git show-ref".
>
> Hope that helps,
> Em.

Emeric is exactly right. The HEAD is not stored under 'refs/', so it's
not listed. On top of that, the HEAD reference is *required* to exist
on any Git repository, and libgit2 will fail to open a repository if
it doesn't contain a HEAD (the repo would be corrupted in this case),
so you can be assured the HEAD will always be there.

Cheers,
Vicent

>
>
>
> On Fri, Apr 15, 2011 at 11:34 AM, David Versmisse <davidv@itaapy.com> wrote:
>> Hello,
>>
>> i have a small question about git_reference_listall:
>>
>> i tried a git_reference_listall with GIT_REF_LISTALL on a small
>> test repo and i have this result: 'refs/heads/i18n', 'refs/heads/master'
>>
>> I don't see HEAD.
>>
>> Is HEAD a symbolic reference ? Why do i not see it ?
>>
>> Thank you in advance,
>> Best regards,
>> D. Versmisse
>>
>> --
>> David Versmisse
>> Itaapy <http://www.itaapy.com>         Tel +33 (0)1 42 23 67 45
>> 9 rue Darwin, 75018 Paris              Fax +33 (0)1 53 28 27 88
>> _______________________________________________
>> Itaapy mailing list
>> Itaapy@ikaaro.org
>> http://mail.ikaaro.org/mailman/listinfo/itaapy
>>
>

Re: [libgit2] A small question about git_reference_listall

From:
David Versmisse
Date:
2011-04-22 @ 10:05
OK, thank you for your answers, I just tried a git_reference_lookup
with "HEAD" and it works perfectly. I needed an example of symbolic
reference for my tests.

Cheers,
D. Versmisse


Le Fri, 15 Apr 2011 06:31:54 -0400,
Vicent Marti <vicent@github.com> a écrit :

> Hey,
> 
> On Fri, Apr 15, 2011 at 6:05 AM, Emeric Fermas
> <emeric.fermas@gmail.com> wrote:
> > Hello David,
> >
> > As far as I remember, git_reference_listall() returns all the names
> > of the references (either symbolic or direct) located under the
> > "refs/" directory.
> > HEAD is located at the root of the git repository. Therefore, it is
> > not returned.
> >
> > It should act in a similar was as a plain "git show-ref".
> >
> > Hope that helps,
> > Em.
> 
> Emeric is exactly right. The HEAD is not stored under 'refs/', so it's
> not listed. On top of that, the HEAD reference is *required* to exist
> on any Git repository, and libgit2 will fail to open a repository if
> it doesn't contain a HEAD (the repo would be corrupted in this case),
> so you can be assured the HEAD will always be there.
> 
> Cheers,
> Vicent
> 
> >
> >
> >
> > On Fri, Apr 15, 2011 at 11:34 AM, David Versmisse
> > <davidv@itaapy.com> wrote:
> >> Hello,
> >>
> >> i have a small question about git_reference_listall:
> >>
> >> i tried a git_reference_listall with GIT_REF_LISTALL on a small
> >> test repo and i have this result: 'refs/heads/i18n',
> >> 'refs/heads/master'
> >>
> >> I don't see HEAD.
> >>
> >> Is HEAD a symbolic reference ? Why do i not see it ?
> >>
> >> Thank you in advance,
> >> Best regards,
> >> D. Versmisse
> >>
> >> --
> >> David Versmisse
> >> Itaapy <http://www.itaapy.com>         Tel +33 (0)1 42 23 67 45
> >> 9 rue Darwin, 75018 Paris              Fax +33 (0)1 53 28 27 88
> >> _______________________________________________
> >> Itaapy mailing list
> >> Itaapy@ikaaro.org
> >> http://mail.ikaaro.org/mailman/listinfo/itaapy
> >>
> >


-- 
David Versmisse
Itaapy <http://www.itaapy.com>         Tel +33 (0)1 42 23 67 45
9 rue Darwin, 75018 Paris              Fax +33 (0)1 53 28 27 88
_______________________________________________
Itaapy mailing list
Itaapy@ikaaro.org
http://mail.ikaaro.org/mailman/listinfo/itaapy