change of git-diff-tree and symlinks

9 messages, 5 authors, 2016-06-15 · open the first message on its own page

change of git-diff-tree and symlinks

From: Kay Sievers <hidden>
Date: 2016-06-15 22:41:58

Hi,
I'm catching up with gitweb.cgi to parse the changed output. Works fine
so far and is really much easier to parse. Here is something that does
not work anymore. See the difference between:

   http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6
   http://ehlo.org/~kay/gitweb.cgi?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6

On my box is the lates git with the adapted gitweb.cgi. Here is the raw
output of the old git-diff-tree:
  kay@dhcp-188:~/src/udev> /home/kay/src/cogito/git-diff-tree -r 49cedafaf893bfe348eb7598227f1a11ae24bfd6 17f2b1a7e0d10334af7f9622848788add125dea8
  *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/cciss!c0d0/device
  *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/rd!c0d0/device
  *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/sda/device
  *120000->100644 blob 1c776568bdc9dc750addd0885dded6b008a44460->1c776568bdc9dc750addd0885dded6b008a44460 test/sys/bus/pci/devices/0000:00:09.0
  *120000->100644 blob e000c77614a23ad57fed284bd007ed7c1cb7872e->e000c77614a23ad57fed284bd007ed7c1cb7872e test/sys/bus/pci/devices/0000:00:1e.0
  ...

The new one shows simply nothing.
Shouldn't it print the mode changes like the old one?

Kay

Re: change of git-diff-tree and symlinks

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:41:58


On Wed, 25 May 2005, Kay Sievers wrote:
I'm catching up with gitweb.cgi to parse the changed output. Works fine
so far and is really much easier to parse. Here is something that does
not work anymore. See the difference between:

   http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6
   http://ehlo.org/~kay/gitweb.cgi?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6
Yes, the new diff-tree thing doesn't show symlinks.

The problem seems to be that we just don't have a "status" flag for it. I 
think we should call it "T" for "Type change" or something, but in the 
meantime let's just have the rule that instead of ignoring unknown state 
changes, we always print them out as "?" instead.

Ie something like this..

(And I'd suggest you make gitweb flexible enough that it does something 
sane if it sees an unknown reason code - let's see what Junio thinks about 
what status code we should use for this).

		Linus

----
diff --git a/diff.c b/diff.c
--- a/diff.c
+++ b/diff.c
@@ -768,7 +768,7 @@ void diff_flush(int diff_output_style, i
 	for (i = 0; i < q->nr; i++) {
 		struct diff_filepair *p = q->queue[i];
 		if (p->status == 0)
-			continue;
+			p->status = '?';
 		switch (diff_output_style) {
 		case DIFF_FORMAT_PATCH:
 			diff_flush_patch(p);

Re: change of git-diff-tree and symlinks

From: Kay Sievers <hidden>
Date: 2016-06-15 22:41:58

On Wed, May 25, 2005 at 11:08:54AM -0700, Linus Torvalds wrote:

On Wed, 25 May 2005, Kay Sievers wrote:
quoted
I'm catching up with gitweb.cgi to parse the changed output. Works fine
so far and is really much easier to parse. Here is something that does
not work anymore. See the difference between:

   http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6
   http://ehlo.org/~kay/gitweb.cgi?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6
Yes, the new diff-tree thing doesn't show symlinks.

The problem seems to be that we just don't have a "status" flag for it. I 
think we should call it "T" for "Type change" or something, but in the 
meantime let's just have the rule that instead of ignoring unknown state 
changes, we always print them out as "?" instead.

Ie something like this..

(And I'd suggest you make gitweb flexible enough that it does something 
sane if it sees an unknown reason code - let's see what Junio thinks about 
what status code we should use for this).
Ok, works again. Any reason not to mark it as 'M'? It's easyly to
distinguish between a content change and a mode change by looking if
the sha has changed.

Kay

Re: change of git-diff-tree and symlinks

From: Jochen Roemling <hidden>
Date: 2016-06-15 22:41:58

Hello Kay,

I'm planning to use cogito/git for tracking development of my (PHP 
based) website. Although this is the first time in my life I'm using 
something that smells like a SCM, it seems to work great. The only thing 
lacking is a working gitweb installation.
I downloaded the gitweb.cgi script from 
kernel.org/pub/software/scm/gitweb, but it dates already May 23rd.

In your mail below from May 25 you state that there have been quite some 
changes to git-diff-tree:

Kay Sievers wrote:
Hi,
I'm catching up with gitweb.cgi to parse the changed output. Works fine
so far and is really much easier to parse. Here is something that does
not work anymore. See the difference between:

  http://www.kernel.org/git/?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6
  http://ehlo.org/~kay/gitweb.cgi?p=linux/hotplug/udev.git;a=commit;h=49cedafaf893bfe348eb7598227f1a11ae24bfd6

On my box is the lates git with the adapted gitweb.cgi. Here is the raw
output of the old git-diff-tree:
 kay@dhcp-188:~/src/udev> /home/kay/src/cogito/git-diff-tree -r 49cedafaf893bfe348eb7598227f1a11ae24bfd6 17f2b1a7e0d10334af7f9622848788add125dea8
 *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/cciss!c0d0/device
 *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/rd!c0d0/device
 *120000->100644 blob 2d78258b1a0fe49afabc8c16a352117df5dc338a->2d78258b1a0fe49afabc8c16a352117df5dc338a test/sys/block/sda/device
 *120000->100644 blob 1c776568bdc9dc750addd0885dded6b008a44460->1c776568bdc9dc750addd0885dded6b008a44460 test/sys/bus/pci/devices/0000:00:09.0
 *120000->100644 blob e000c77614a23ad57fed284bd007ed7c1cb7872e->e000c77614a23ad57fed284bd007ed7c1cb7872e test/sys/bus/pci/devices/0000:00:1e.0
 ...

The new one shows simply nothing.
Shouldn't it print the mode changes like the old one?

 
and that might be the reason why I'm getting "nothing" when I'm clicking 
on a "commitdiff" link.
After investigating further, I found out that the object type ("blob" in 
the example above) is no longer printed by git-diff-tree.
Also there is a new parameter '-p' that allows the output of a patch 
directly instead of creating it with the help of temporary files as you 
do it in gitweb.
Unfortunately my perl knowledge is really poor and I didn't get it to 
work. After I changed the call to git-diff-tree to use the '-p' switch, 
I'm getting a "403 Forbidden - Reading diff-tree failed" message, but 
the same command on the command line works perfectly well. I don't know 
what is wrong there.

Could you please post a downloadable current release of gitweb to 
kernel.org that works with the current git? If not, please tell me what 
git release is installed at kernel.org so that I can use that branch to 
get it to work with gitweb.

And as a last side note it would be helpfull if you could include a 
release number in the gitweb footer as you did in the very beginning so 
that we know if something changed and there is new stuff to explore...

... keep up the great work!

Jochen

Re: change of git-diff-tree and symlinks

From: Kay Sievers <hidden>
Date: 2016-06-15 22:41:58

On Sun, May 29, 2005 at 04:16:53PM +0200, Jochen Roemling wrote:
I'm planning to use cogito/git for tracking development of my (PHP 
based) website. Although this is the first time in my life I'm using 
something that smells like a SCM, it seems to work great. The only thing 
lacking is a working gitweb installation.
I downloaded the gitweb.cgi script from 
kernel.org/pub/software/scm/gitweb, but it dates already May 23rd.

In your mail below from May 25 you state that there have been quite some 
changes to git-diff-tree:

Kay Sievers wrote:
quoted
The new one shows simply nothing.
Shouldn't it print the mode changes like the old one?
and that might be the reason why I'm getting "nothing" when I'm clicking 
on a "commitdiff" link.
The kernel.org servers use Cogito which needs a new release. So the
version on kernel.org is always a working version with the current
release of Cogito as long as we don't get a git-core to provide the
binaries.
After investigating further, I found out that the object type ("blob" in 
the example above) is no longer printed by git-diff-tree.
The format has changed, just get the latest version of gitweb from my box
instead.
Also there is a new parameter '-p' that allows the output of a patch 
directly instead of creating it with the help of temporary files as you 
do it in gitweb.
Sure, gitweb did the diffs before git was able to do that. And it does
not really matter who is creating the temp-files, the cgi or the
git-binaries. :)
If things are stable some day, I may switch that over and maybe even
support the nice rename detection.
Could you please post a downloadable current release of gitweb to 
kernel.org that works with the current git? If not, please tell me what 
git release is installed at kernel.org so that I can use that branch to 
get it to work with gitweb.
My latest version is here:
  ftp://ehlo.org/gitweb.cgi
And as a last side note it would be helpfull if you could include a 
release number in the gitweb footer as you did in the very beginning so 
that we know if something changed and there is new stuff to explore...
It is in the html-source, right at the top.

Thanks,
Kay

Re: change of git-diff-tree and symlinks

From: Jochen Roemling <hidden>
Date: 2016-06-15 22:41:58

[resending in plain-text]

Kay Sievers wrote:
The kernel.org servers use Cogito which needs a new release. So the
version on kernel.org is always a working version with the current
release of Cogito as long as we don't get a git-core to provide the
binaries.
 
Ah yes, I remember the discussion about that.
Sebastian, could you include a matching gitweb.cgi into your 
Debian-Package?

And what about something like:

if (-e '/etc/gitweb.conf') { requite '/etc/gitweb.conf'; }

after the variable settings? The included file would then set 
$projectroot and friends to the local values so that I don't have to 
patch gitweb everytime I upgrade it. Since perl has no plain "include" 
and the require doesn't really work for me (it seems to include the 
file, but the variables stay the same), I leave it up to you (I would 
have been so proud to provide you a patch, but obviously my perl 
knowledge is worse than I thought).
My latest version is here:
 ftp://ehlo.org/gitweb.cgi
 
Thanks for pointing that out. I had the impression, on ehlo.org is only 
a installed version, not a downloadable one.
quoted
And as a last side note it would be helpfull if you could include a 
release number in the gitweb footer as you did in the very beginning so 
that we know if something changed and there is new stuff to explore...
   
It is in the html-source, right at the top.
 
Good hiding-place....

Jochen

Re: change of git-diff-tree and symlinks

From: Sebastian Kuzminsky <hidden>
Date: 2016-06-15 22:41:58

Jochen Roemling [off-list ref] wrote:
Sebastian, could you include a matching gitweb.cgi into your 
Debian-Package?
I'm planning to package gitweb as a separate Debian package.  I'll try
to get to it next week.


-- 
Sebastian Kuzminsky

Re: change of git-diff-tree and symlinks

From: Petr Baudis <hidden>
Date: 2016-06-15 22:41:58

Dear diary, on Sun, May 29, 2005 at 05:06:56PM CEST, I got a letter
where Kay Sievers [off-list ref] told me that...
On Sun, May 29, 2005 at 04:16:53PM +0200, Jochen Roemling wrote:
quoted
I'm planning to use cogito/git for tracking development of my (PHP 
based) website. Although this is the first time in my life I'm using 
something that smells like a SCM, it seems to work great. The only thing 
lacking is a working gitweb installation.
I downloaded the gitweb.cgi script from 
kernel.org/pub/software/scm/gitweb, but it dates already May 23rd.

In your mail below from May 25 you state that there have been quite some 
changes to git-diff-tree:

Kay Sievers wrote:
quoted
The new one shows simply nothing.
Shouldn't it print the mode changes like the old one?
and that might be the reason why I'm getting "nothing" when I'm clicking 
on a "commitdiff" link.
The kernel.org servers use Cogito which needs a new release. So the
version on kernel.org is always a working version with the current
release of Cogito as long as we don't get a git-core to provide the
binaries.
Tomorrow evening. I'd even do it now but I feel the changes need a bit
of testing yet.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

Re: change of git-diff-tree and symlinks

From: Sebastian Kuzminsky <hidden>
Date: 2016-06-15 22:41:58

Jochen Roemling [off-list ref] wrote:
Sebastian, could you include a matching gitweb.cgi into your 
Debian-Package?

Looks like gitweb's already packaged for Debian.  Andres Salomon is
doing it:

    http://marc.theaimsgroup.com/?l=git&m=111661740226054&w=2




-- 
Sebastian Kuzminsky
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help