threads / discuss / 5733

Why gitweb commitdiff NO diff output ?

Subject: Why gitweb commitdiff NO diff output ?

## tl;dr

15 messages between Sep 28, 2006 and Oct 11, 2006.

replies: 14people: 5as markdown or json

Dongsheng Song· Sep 28, 2006, 07:32 UTC · lore

My git repository import from subversion, and the latest files has correct mime-type property, but gitweb commitdiff NO diff output !

file:82dc767b3f1425435fa6d8fa7511718d3f614172 -> file:4c7269ed65bf8691c46541497fbecc706f7d012f

file:6817671d9af75b9adcc439d62f9047c7b2a9adb2 -> file:575d40108f550ac5965bb6ea8b6792fa9cc10536

Thanks for some help,
Donogsheng
Jakub Narebski· Oct 3, 2006, 09:02 UTC · re: Dongsheng Song · lore

Re: Why gitweb commitdiff NO diff output ?

Dongsheng Song wrote:
Show 8 quoted lines
> My git repository import from subversion, and the latest files has
> correct mime-type property, but gitweb commitdiff NO diff output !
> 
> file:82dc767b3f1425435fa6d8fa7511718d3f614172 ->
> file:4c7269ed65bf8691c46541497fbecc706f7d012f
> 
> file:6817671d9af75b9adcc439d62f9047c7b2a9adb2 ->
> file:575d40108f550ac5965bb6ea8b6792fa9cc10536
Not enough information.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Martin Waitz· Oct 3, 2006, 09:52 UTC · re: Jakub Narebski · lore

Re: Why gitweb commitdiff NO diff output ?

hoi :)
On Tue, Oct 03, 2006 at 11:02:25AM +0200, Jakub Narebski wrote:
Show 11 quoted lines
> Dongsheng Song wrote:
> > My git repository import from subversion, and the latest files has
> > correct mime-type property, but gitweb commitdiff NO diff output !
> > 
> > file:82dc767b3f1425435fa6d8fa7511718d3f614172 ->
> > file:4c7269ed65bf8691c46541497fbecc706f7d012f
> > 
> > file:6817671d9af75b9adcc439d62f9047c7b2a9adb2 ->
> > file:575d40108f550ac5965bb6ea8b6792fa9cc10536
> 
> Not enough information.

A few months ago, I got that a on kernel.org a few times, too. After reloading the page it always got shown correctly, so I never bothered to report it.

-- 
Martin Waitz
Junio C Hamano· Oct 3, 2006, 17:39 UTC · re: Martin Waitz · lore

Re: Why gitweb commitdiff NO diff output ?

Martin Waitz <tali@admingilde.org> writes:
Show 14 quoted lines
>> > My git repository import from subversion, and the latest files has
>> > correct mime-type property, but gitweb commitdiff NO diff output !
>> > 
>> > file:82dc767b3f1425435fa6d8fa7511718d3f614172 ->
>> > file:4c7269ed65bf8691c46541497fbecc706f7d012f
>> > 
>> > file:6817671d9af75b9adcc439d62f9047c7b2a9adb2 ->
>> > file:575d40108f550ac5965bb6ea8b6792fa9cc10536
>> 
>> Not enough information.
>
> A few months ago, I got that a on kernel.org a few times, too.
> After reloading the page it always got shown correctly, so I never bothered
> to report it.

This is just a wild guess without reproduction, but if that was seen on kernel.org _temporarily_, it could be that rsync was in the middle of mirroring and things other than these blobs that were needed for you to reach that page (i.e. the commits and the trees, and the refs/heads/master to mark the tip of the ancestry chain) were already on the gitweb public machine but blobs weren't.

Dongsheng Song· Oct 8, 2006, 08:22 UTC · re: Junio C Hamano · lore

Re: Why gitweb commitdiff NO diff output ?

> >> Not enough information.

There is gitweb address: http://www.foresee.com.cn:8888/git/

bad output: http://www.foresee.com.cn:8888/git/?p=gcc/.git;a=commitdiff;h=c977ee1b2e54d67bb379ce476f784431c32136d7

debian pkgs: ii bash 3.1-5 The GNU Bourne Again SHell ii cogito 0.17.3-2 version control system ii diff 2.8.1-11 File comparison utilities ii git-core 1.4.2.1-1 content addressable filesystem ii git-cvs 1.4.2.1-1 content addressable filesystem (cvs interope ii git-doc 1.4.2.1-1 content addressable filesystem (documentatio ii git-email 1.4.2.1-1 content addressable filesystem (email add-on ii git-svn 1.4.2.1-1 content addressable filesystem (svn interope ii gitweb 1.4.2.1-1 content addressable filesystem (web interfac ii kernel-image-2.4.27-2-686 2.4.27-12 Linux kernel image for version 2.4.27 on PPr ii patch 2.5.9-4 Apply a diff file to an original

But the other debian 2.6.x kernel is OK!
Junio C Hamano· Oct 10, 2006, 00:32 UTC · re: Dongsheng Song · lore

Re: Why gitweb commitdiff NO diff output ?

The site does not return any of these four blobs that are part of the commitdiff when a=blob is requested on them.

        file:a34d77e47bf1561db1ade4f6b247598b880f80d5 ->
        file:7625c494df01d4745e67bd4423e2fdbe9fc43799
        file:b207fe30a5430f97d27d398d89c974b068694c7a ->
        file:57b07ace4bb6352416bbf9436b9f2642b3273257

I would first suspect if the repository actually have them _and_ with an appropriate mode protection to be readable by your gitweb process.

Dongsheng Song· Oct 10, 2006, 01:51 UTC · re: Junio C Hamano · lore

Re: Why gitweb commitdiff NO diff output ?

NO.
When I change the repository's owner to gitweb process,  no diff output yet.
$ chown -R www-data:www-data  cauchy/ gcc/ mph/
2006/10/10, Junio C Hamano <junkio@cox.net>:
Show 16 quoted lines
> The site does not return any of these four blobs that are part
> of the commitdiff when a=blob is requested on them.
>
>         file:a34d77e47bf1561db1ade4f6b247598b880f80d5 ->
>         file:7625c494df01d4745e67bd4423e2fdbe9fc43799
>
>         file:b207fe30a5430f97d27d398d89c974b068694c7a ->
>         file:57b07ace4bb6352416bbf9436b9f2642b3273257
>
> I would first suspect if the repository actually have them _and_
> with an appropriate mode protection to be readable by your
> gitweb process.
>
>
>
>
Junio C Hamano· Oct 10, 2006, 02:13 UTC · re: Dongsheng Song · lore

Re: Why gitweb commitdiff NO diff output ?

"Dongsheng Song" <dongsheng.song@gmail.com> writes:
Show 19 quoted lines
> NO.
>
> When I change the repository's owner to gitweb process,  no diff output yet.
>
> $ chown -R www-data:www-data  cauchy/ gcc/ mph/
>
> 2006/10/10, Junio C Hamano <junkio@cox.net>:
>> The site does not return any of these four blobs that are part
>> of the commitdiff when a=blob is requested on them.
>>
>>         file:a34d77e47bf1561db1ade4f6b247598b880f80d5 ->
>>         file:7625c494df01d4745e67bd4423e2fdbe9fc43799
>>
>>         file:b207fe30a5430f97d27d398d89c974b068694c7a ->
>>         file:57b07ace4bb6352416bbf9436b9f2642b3273257
>>
>> I would first suspect if the repository actually have them _and_
>> with an appropriate mode protection to be readable by your
>> gitweb process.
And does the repository have these four blob objects?
Junio C Hamano· Oct 10, 2006, 02:28 UTC · re: Junio C Hamano · lore

Re: Why gitweb commitdiff NO diff output ?

Junio C Hamano <junkio@cox.net> writes:
Show 23 quoted lines
> "Dongsheng Song" <dongsheng.song@gmail.com> writes:
>
>> NO.
>>
>> When I change the repository's owner to gitweb process,  no diff output yet.
>>
>> $ chown -R www-data:www-data  cauchy/ gcc/ mph/
>>
>> 2006/10/10, Junio C Hamano <junkio@cox.net>:
>>> The site does not return any of these four blobs that are part
>>> of the commitdiff when a=blob is requested on them.
>>>
>>>         file:a34d77e47bf1561db1ade4f6b247598b880f80d5 ->
>>>         file:7625c494df01d4745e67bd4423e2fdbe9fc43799
>>>
>>>         file:b207fe30a5430f97d27d398d89c974b068694c7a ->
>>>         file:57b07ace4bb6352416bbf9436b9f2642b3273257
>>>
>>> I would first suspect if the repository actually have them _and_
>>> with an appropriate mode protection to be readable by your
>>> gitweb process.
>
> And does the repository have these four blob objects?

Sorry, the follow-up question was not very helpful to guide another person over e-mail. Let's try again with more specific questions.

What do these say in that repository when run as the webserver user?

	$ for blob in \
          a34d77e47bf1561db1ade4f6b247598b880f80d5 \
	  7625c494df01d4745e67bd4423e2fdbe9fc43799 \
          b207fe30a5430f97d27d398d89c974b068694c7a \
          57b07ace4bb6352416bbf9436b9f2642b3273257
	  do
          	git cat-file -t $blob || echo $blob does not exist
	  done
	$ git cat-file commit c977ee1b2e54d67bb379ce476f784431c32136d7 |
	  grep 'parent '
	$ git diff-tree -p c977ee1b2e54d67bb379ce476f784431c32136d7 | wc

The first one tries to make sure you have those four blob objects in the repository, the second tries to make sure the commit is a single parent commit as your gitweb output suggests, and the last one is to obtain the diff text.

Also do you have the same problem with other commits, or is this the only commit your gitweb is having trouble with showing commitdiff?

Dongsheng Song· Oct 10, 2006, 06:36 UTC · re: Junio C Hamano · lore

Re: Why gitweb commitdiff NO diff output ?

There is the result:
www-data@ab:/home/repository/git/gcc$ for blob in \
Show 7 quoted lines
>          a34d77e47bf1561db1ade4f6b247598b880f80d5 \
>          7625c494df01d4745e67bd4423e2fdbe9fc43799 \
>          b207fe30a5430f97d27d398d89c974b068694c7a \
>          57b07ace4bb6352416bbf9436b9f2642b3273257
>          do
>                git cat-file -t $blob || echo $blob does not exist
>          done

blob blob blob blob www-data@ab:/home/repository/git/gcc$ git cat-file commit c977ee1b2e54d67bb379ce476f784431c32136d7 |

>          grep 'parent '
parent b693aceaba66f741cd6735d4ecd16fe59394a2cf
www-data@ab:/home/repository/git/gcc$ git diff-tree -p
c977ee1b2e54d67bb379ce476f784431c32136d7 | wc
     37     137    1179

I have the SAME problem with ALL commits, ONLY the 2.4.x machine, but git-core/cg tools is OK. All git/cg/gitweb is good for other 2.6.x machines.

you can browse the two gitweb site:

2.4.27 http://www.foresee.com.cn:8888/git/?p=gcc/.git;a=shortlog 2.6.16 http://www.foresee.com.cn:9999/git/?p=gcc/.git;a=shortlog

2006/10/10, Junio C Hamano <junkio@cox.net>:
Show 55 quoted lines
> Junio C Hamano <junkio@cox.net> writes:
>
> > "Dongsheng Song" <dongsheng.song@gmail.com> writes:
> >
> >> NO.
> >>
> >> When I change the repository's owner to gitweb process,  no diff output yet.
> >>
> >> $ chown -R www-data:www-data  cauchy/ gcc/ mph/
> >>
> >> 2006/10/10, Junio C Hamano <junkio@cox.net>:
> >>> The site does not return any of these four blobs that are part
> >>> of the commitdiff when a=blob is requested on them.
> >>>
> >>>         file:a34d77e47bf1561db1ade4f6b247598b880f80d5 ->
> >>>         file:7625c494df01d4745e67bd4423e2fdbe9fc43799
> >>>
> >>>         file:b207fe30a5430f97d27d398d89c974b068694c7a ->
> >>>         file:57b07ace4bb6352416bbf9436b9f2642b3273257
> >>>
> >>> I would first suspect if the repository actually have them _and_
> >>> with an appropriate mode protection to be readable by your
> >>> gitweb process.
> >
> > And does the repository have these four blob objects?
>
> Sorry, the follow-up question was not very helpful to guide
> another person over e-mail.  Let's try again with more specific
> questions.
>
> What do these say in that repository when run as the webserver
> user?
>
>         $ for blob in \
>           a34d77e47bf1561db1ade4f6b247598b880f80d5 \
>           7625c494df01d4745e67bd4423e2fdbe9fc43799 \
>           b207fe30a5430f97d27d398d89c974b068694c7a \
>           57b07ace4bb6352416bbf9436b9f2642b3273257
>           do
>                 git cat-file -t $blob || echo $blob does not exist
>           done
>         $ git cat-file commit c977ee1b2e54d67bb379ce476f784431c32136d7 |
>           grep 'parent '
>         $ git diff-tree -p c977ee1b2e54d67bb379ce476f784431c32136d7 | wc
>
> The first one tries to make sure you have those four blob
> objects in the repository, the second tries to make sure the
> commit is a single parent commit as your gitweb output suggests,
> and the last one is to obtain the diff text.
>
> Also do you have the same problem with other commits, or is this
> the only commit your gitweb is having trouble with showing
> commitdiff?
>
>
Junio C Hamano· Oct 10, 2006, 06:54 UTC · re: Dongsheng Song · lore

Re: Why gitweb commitdiff NO diff output ?

"Dongsheng Song" <dongsheng.song@gmail.com> writes:
Show 25 quoted lines
> There is the result:
>
> www-data@ab:/home/repository/git/gcc$ for blob in \
>>          a34d77e47bf1561db1ade4f6b247598b880f80d5 \
>>          7625c494df01d4745e67bd4423e2fdbe9fc43799 \
>>          b207fe30a5430f97d27d398d89c974b068694c7a \
>>          57b07ace4bb6352416bbf9436b9f2642b3273257
>>          do
>>                git cat-file -t $blob || echo $blob does not exist
>>          done
> blob
> blob
> blob
> blob
> www-data@ab:/home/repository/git/gcc$ git cat-file commit
> c977ee1b2e54d67bb379ce476f784431c32136d7 |
>>          grep 'parent '
> parent b693aceaba66f741cd6735d4ecd16fe59394a2cf
> www-data@ab:/home/repository/git/gcc$ git diff-tree -p
> c977ee1b2e54d67bb379ce476f784431c32136d7 | wc
>     37     137    1179
> ...
> I have the SAME problem with ALL commits,  ONLY the 2.4.x machine, but
> git-core/cg tools is OK. All git/cg/gitweb is good for other 2.6.x
> machines.

That's mildly interesting. I do not know the difference between your 2.4 and 2.6 machines (nor how many of each you have). I am guessing that either these machines are sharing one repository over NFS, or they have their own copies and none of them is corrupt (i.e. you got these reasonable results you pasted above from all of them).

At this point I have to say that this sounds like a problem that reproduces only for you on that particular machine. Maybe comparing the apache logs from a good machine and a bad one would tell you what's different between them?

I am not sure what version of gitweb your distribution packages, but it used to be that commitdiff page wanted to create temporary file somewhere on the filesystem (the variable was $git_temp and by default it was set to "/tmp/gitweb", I think). Your other pages such as commit and log page seem to be working, so perhaps your gitweb has trouble writing there only on that machine?

Dongsheng Song· Oct 10, 2006, 10:46 UTC · re: Junio C Hamano · lore

Re: Why gitweb commitdiff NO diff output ?

Thanks, now that's OK.
Show 9 quoted lines
>
> I am not sure what version of gitweb your distribution packages,
> but it used to be that commitdiff page wanted to create
> temporary file somewhere on the filesystem (the variable was
> $git_temp and by default it was set to "/tmp/gitweb", I think).
> Your other pages such as commit and log page seem to be working,
> so perhaps your gitweb has trouble writing there only on that
> machine?
>
Junio C Hamano· Oct 10, 2006, 17:42 UTC · re: Dongsheng Song · lore

Re: Why gitweb commitdiff NO diff output ?

"Dongsheng Song" <dongsheng.song@gmail.com> writes:
Show 9 quoted lines
> Thanks, now that's OK.
>
>> I am not sure what version of gitweb your distribution packages,
>> but it used to be that commitdiff page wanted to create
>> temporary file somewhere on the filesystem (the variable was
>> $git_temp and by default it was set to "/tmp/gitweb", I think).
>> Your other pages such as commit and log page seem to be working,
>> so perhaps your gitweb has trouble writing there only on that
>> machine?
Care to share your experience to help others?

If it was /tmp/gitweb permission problem then the newer gitweb shouldn't have that issue so it would be a moot point, but if the pitfall still applies to the current software we might want to add a "common pitfals" section to gitweb/README.

Johannes Schindelin· Oct 10, 2006, 19:01 UTC · re: Junio C Hamano · lore

Re: Why gitweb commitdiff NO diff output ?

Hi,
On Tue, 10 Oct 2006, Junio C Hamano wrote:
> If it was /tmp/gitweb permission problem then the newer gitweb
> shouldn't have that issue so it would be a moot point, but if
> the pitfall still applies to the current software we might want
> to add a "common pitfals" section to gitweb/README.
Make that "common pitfalse".
;-)

Ciao, Dscho

Dongsheng Song· Oct 11, 2006, 02:31 UTC · re: Junio C Hamano · lore

Re: Why gitweb commitdiff NO diff output ?

Yes, it was /tmp/gitweb permission problem.
I think it's a good idea for add a "common pitfals" section to gitweb/README.
2006/10/11, Junio C Hamano <junkio@cox.net>:
Show 8 quoted lines
>
> Care to share your experience to help others?
>
> If it was /tmp/gitweb permission problem then the newer gitweb
> shouldn't have that issue so it would be a moot point, but if
> the pitfall still applies to the current software we might want
> to add a "common pitfals" section to gitweb/README.
>

← back to recent threads