# XML parsing error from gitweb at freedesktop.org

3 messages from 2007-12-06 to 2007-12-08. Participants: Adam Mercer, Lars Hjemli, Jakub Narebski.
Thread: https://gitlist.dev/t/11165

## Adam Mercer, 2007-12-06 21:34

Subject: XML parsing error from gitweb at freedesktop.org
Message-ID: <799406d60712061334q33d2dba5r5496ba21069a4547@mail.gmail.com>
URL: https://gitlist.dev/e/799406d60712061334q33d2dba5r5496ba21069a4547%40mail.gmail.com

```
Hi

In looking through some commits on the freedesktop.org gitweb I
encountered an error trying to view the following commit

<http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commitdiff;h=48e6a75fbdd0fee86e364f02ace83f20b312a2b2>

In viewing the page under Safari on Mac OS X Leopard the following
error is displayed:

This page contains the following errors:
error on line 7998 at column 129634: internal error

Camino & Firefox both display:

XML Parsing Error: not well-formed
Location: http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commitdiff;h=48e6a75fbdd0fee86e364f02ace83f20b312a2b2
Line Number 7998, Column 24:

<div class="diff rem">- </div>
-----------------------^

as cgit displays the commit OK

<http://cgit.freedesktop.org/xorg/xserver/commit/?h=xorg-server-1.2-apple&id=48e6a75fbdd0fee86e364f02ace83f20b312a2b2>

leads me to think that the problem lies in gitweb.  Could this be a
problem with gitweb?

Cheers

Adam

```

## Lars Hjemli, 2007-12-06 22:11

Subject: Re: XML parsing error from gitweb at freedesktop.org
Message-ID: <8c5c35580712061411k7a40a08el35f31c43add25cb3@mail.gmail.com>
URL: https://gitlist.dev/e/8c5c35580712061411k7a40a08el35f31c43add25cb3%40mail.gmail.com
In-Reply-To: <799406d60712061334q33d2dba5r5496ba21069a4547@mail.gmail.com>

```
On Dec 6, 2007 10:34 PM, Adam Mercer <ramercer@gmail.com> wrote:
> as cgit displays the commit OK
>
> <http://cgit.freedesktop.org/xorg/xserver/commit/?h=xorg-server-1.2-apple&id=48e6a75fbdd0fee86e364f02ace83f20b312a2b2>
>
> leads me to think that the problem lies in gitweb.  Could this be a
> problem with gitweb?
>

Actually, it's a problem in both cgit and gitweb, but you need to look
a bit harder to find the error in cgit. It seems that gitweb on
freedesktop.org doesn't detect a file rename (due to diff.renamelimit
maybe?), so it shows the full source of the offending files, while in
cgit you'll need to go from the diff to either the old or the new
sourcefile to get the same error:

http://cgit.freedesktop.org/xorg/xserver/tree/hw/darwin/quartz/applewmExt.h?h=xorg-server-1.2-apple&id=141f69dc3d8d6e7d8ff65607f43700ac11243041
http://cgit.freedesktop.org/xorg/xserver/diff/hw/xquartz/applewm.c?h=xorg-server-1.2-apple&id=48e6a75fbdd0fee86e364f02ace83f20b312a2b2

The problem is a number of unencoded ascii char 12.

--
larsh

```

## Jakub Narebski, 2007-12-08 10:49

Subject: Re: XML parsing error from gitweb at freedesktop.org
Message-ID: <m3d4thtqaq.fsf@roke.D-201>
URL: https://gitlist.dev/e/m3d4thtqaq.fsf%40roke.D-201
In-Reply-To: <8c5c35580712061411k7a40a08el35f31c43add25cb3@mail.gmail.com>

```
"Lars Hjemli" <hjemli@gmail.com> writes:

> On Dec 6, 2007 10:34 PM, Adam Mercer <ramercer@gmail.com> wrote:
>>
>> as cgit displays the commit OK
>>
>> <http://cgit.freedesktop.org/xorg/xserver/commit/?h=xorg-server-1.2-apple&id=48e6a75fbdd0fee86e364f02ace83f20b312a2b2>
>>
>> leads me to think that the problem lies in gitweb.  Could this be a
>> problem with gitweb?
>>
> 
> Actually, it's a problem in both cgit and gitweb, but you need to look
> a bit harder to find the error in cgit. It seems that gitweb on
> freedesktop.org doesn't detect a file rename (due to diff.renamelimit
> maybe?), so it shows the full source of the offending files, while in
> cgit you'll need to go from the diff to either the old or the new
> sourcefile to get the same error:
> 
> http://cgit.freedesktop.org/xorg/xserver/tree/hw/darwin/quartz/applewmExt.h?h=xorg-server-1.2-apple&id=141f69dc3d8d6e7d8ff65607f43700ac11243041
> http://cgit.freedesktop.org/xorg/xserver/diff/hw/xquartz/applewm.c?h=xorg-server-1.2-apple&id=48e6a75fbdd0fee86e364f02ace83f20b312a2b2
> 
> The problem is a number of unencoded ascii char 12.

Strange... I have checked gitweb code, and esc_html used in HTML
version of diff output escapes _all_ control characters ([:cntrl:]).
So ASCII char 12 should be shown as \014 in "cntrl" style.

Ahhh... I see, Freedesktop.org uses some ANCIENT version of gitweb,
from before it was included in git repository.

Try to ask Freedesktop.org admins to upgrade gitweb. Some nice
features include:
 * mod_perl compatibility
 * ability to display binary files correctly
 * gitweb do not use /usr/bin/diff, and do not use temporary files
   (and supports renames, typechanges and combined diff format)
 * better support for strange characters in contents and in pathnames
 * very basic support for submodules
 * snapshot support (optional)
 * forks support (optional)
 * 'next' links in 'commit' and 'commitdiff' view
 * optional features: commit search, pickaxe search, snapshots
   support,...

-- 
Jakub Narebski
ShadeHawk on #git

```
