{"thread":{"id":"7698","subject":"[PATCH 2/7] gitweb: Support comparing blobs with different names","startedAt":"2007-04-16T20:18:13Z","lastAt":"2007-05-19T08:27:45Z","messageCount":7,"participants":["Martin Koegler","Jakub Narebski","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"39570","messageId":"20070416201813.GA2592@auto.tuwien.ac.at","threadId":"7698","inReplyTo":"a209e0308fc80ef0623baef8dca49e61b7bafaab.1176659094.git.mkoegler@auto.tuwien.ac.at","subject":"[PATCH 2/7] gitweb: Support comparing blobs with different names","fromName":"Martin Koegler","fromEmail":"mkoegler@auto.tuwien.ac.at","sentAt":"2007-04-16T20:18:13Z","receivedAt":"2007-04-16T20:18:13Z","isPatch":true,"sender":{"key":"mkoegler@auto.tuwien.ac.at","avatar":null},"body":"Currently, blobdiff can only compare blobs with different file\nnames, if no hb/hpb parameters are present.\n\nThis patch adds support for comparing two blobs specified by any\ncombination of hb/f/h and hpb/fp/hp.\n\nSigned-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>\n---\nNew version, as I found a bug in the expiration handling code.\n\nI unified all blobdiff variants and added support for comparing blobs\nwith different names.\n\nIf h/hp parameter are missing, I need to generate them with\ngit_get_hash_by_path, as the are needed for the html header, which is\ngenerated before parsing the git-diff output.\n\nI currently ignore all mode changed, as they are part of the tree. I\ndon't think that displaying a mode change message justifes two call to\ngit-ls-tree for each blob diff (Currently it only calls git-ls-tree\nfor each missing h/hp parameter).\n\n gitweb/gitweb.perl |  136 ++++++++++++++++------------------------------------\n 1 files changed, 41 insertions(+), 95 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex cbd8d03..790041c 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -3902,109 +3902,54 @@ sub git_blobdiff {\n \tmy $fd;\n \tmy @difftree;\n \tmy %diffinfo;\n-\tmy $expires;\n-\n-\t# preparing $fd and %diffinfo for git_patchset_body\n-\t# new style URI\n-\tif (defined $hash_base && defined $hash_parent_base) {\n-\t\tif (defined $file_name) {\n-\t\t\t# read raw output\n-\t\t\topen $fd, \"-|\", git_cmd(), \"diff-tree\", '-r', @diff_opts,\n-\t\t\t\t$hash_parent_base, $hash_base,\n-\t\t\t\t\"--\", (defined $file_parent ? $file_parent : ()), $file_name\n-\t\t\t\tor die_error(undef, \"Open git-diff-tree failed\");\n-\t\t\t@difftree = map { chomp; $_ } <$fd>;\n-\t\t\tclose $fd\n-\t\t\t\tor die_error(undef, \"Reading git-diff-tree failed\");\n-\t\t\t@difftree\n-\t\t\t\tor die_error('404 Not Found', \"Blob diff not found\");\n-\n-\t\t} elsif (defined $hash &&\n-\t\t         $hash =~ /[0-9a-fA-F]{40}/) {\n-\t\t\t# try to find filename from $hash\n-\n-\t\t\t# read filtered raw output\n-\t\t\topen $fd, \"-|\", git_cmd(), \"diff-tree\", '-r', @diff_opts,\n-\t\t\t\t$hash_parent_base, $hash_base, \"--\"\n-\t\t\t\tor die_error(undef, \"Open git-diff-tree failed\");\n-\t\t\t@difftree =\n-\t\t\t\t# ':100644 100644 03b21826... 3b93d5e7... M\tls-files.c'\n-\t\t\t\t# $hash == to_id\n-\t\t\t\tgrep { /^:[0-7]{6} [0-7]{6} [0-9a-fA-F]{40} $hash/ }\n-\t\t\t\tmap { chomp; $_ } <$fd>;\n-\t\t\tclose $fd\n-\t\t\t\tor die_error(undef, \"Reading git-diff-tree failed\");\n-\t\t\t@difftree\n-\t\t\t\tor die_error('404 Not Found', \"Blob diff not found\");\n-\n-\t\t} else {\n-\t\t\tdie_error('404 Not Found', \"Missing one of the blob diff parameters\");\n-\t\t}\n+\tmy $expires = '+1d';\n \n-\t\tif (@difftree > 1) {\n-\t\t\tdie_error('404 Not Found', \"Ambiguous blob diff specification\");\n-\t\t}\n-\n-\t\t%diffinfo = parse_difftree_raw_line($difftree[0]);\n-\t\t$file_parent ||= $diffinfo{'from_file'} || $file_name || $diffinfo{'file'};\n-\t\t$file_name   ||= $diffinfo{'to_file'}   || $diffinfo{'file'};\n-\n-\t\t$hash_parent ||= $diffinfo{'from_id'};\n-\t\t$hash        ||= $diffinfo{'to_id'};\n+\t$file_parent ||= $file_name;\n \n-\t\t# non-textual hash id's can be cached\n-\t\tif ($hash_base =~ m/^[0-9a-fA-F]{40}$/ &&\n-\t\t    $hash_parent_base =~ m/^[0-9a-fA-F]{40}$/) {\n-\t\t\t$expires = '+1d';\n-\t\t}\n+\t# non-textual hash id's can be cached\n+\tif (defined $hash && $hash !~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t$expires = undef;\n+\t} elsif (defined $hash_parent && $hash_parent !~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t$expires = undef;\n+\t} elsif (defined $hash_base && $hash_base !~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t$expires = undef;\n+\t} elsif (defined $hash_parent_base && $hash_parent_base !~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t$expires = undef;\n+\t}\n \n-\t\t# open patch output\n-\t\topen $fd, \"-|\", git_cmd(), \"diff-tree\", '-r', @diff_opts,\n-\t\t\t'-p', ($format eq 'html' ? \"--full-index\" : ()),\n-\t\t\t$hash_parent_base, $hash_base,\n-\t\t\t\"--\", (defined $file_parent ? $file_parent : ()), $file_name\n-\t\t\tor die_error(undef, \"Open git-diff-tree failed\");\n+\t# if hash parameter is missing, read it from the commit.\n+\tif (defined $hash_base && defined $file_name && !defined $hash) {\n+\t\t$hash = git_get_hash_by_path($hash_base, $file_name);\n \t}\n \n-\t# old/legacy style URI\n-\tif (!%diffinfo && # if new style URI failed\n-\t    defined $hash && defined $hash_parent) {\n-\t\t# fake git-diff-tree raw output\n-\t\t$diffinfo{'from_mode'} = $diffinfo{'to_mode'} = \"blob\";\n-\t\t$diffinfo{'from_id'} = $hash_parent;\n-\t\t$diffinfo{'to_id'}   = $hash;\n-\t\tif (defined $file_name) {\n-\t\t\tif (defined $file_parent) {\n-\t\t\t\t$diffinfo{'status'} = '2';\n-\t\t\t\t$diffinfo{'from_file'} = $file_parent;\n-\t\t\t\t$diffinfo{'to_file'}   = $file_name;\n-\t\t\t} else { # assume not renamed\n-\t\t\t\t$diffinfo{'status'} = '1';\n-\t\t\t\t$diffinfo{'from_file'} = $file_name;\n-\t\t\t\t$diffinfo{'to_file'}   = $file_name;\n-\t\t\t}\n-\t\t} else { # no filename given\n-\t\t\t$diffinfo{'status'} = '2';\n-\t\t\t$diffinfo{'from_file'} = $hash_parent;\n-\t\t\t$diffinfo{'to_file'}   = $hash;\n-\t\t}\n+\tif (defined $hash_parent_base && defined $file_parent && !defined $hash_parent) {\n+\t    $hash_parent = git_get_hash_by_path($hash_parent_base, $file_parent);\n+\t}\n+\t\n+\tif (!defined $hash || ! defined $hash_parent) {\n+\t\tdie_error('404 Not Found', \"Missing one of the blob diff parameters\");\n+\t}\n \n-\t\t# non-textual hash id's can be cached\n-\t\tif ($hash =~ m/^[0-9a-fA-F]{40}$/ &&\n-\t\t    $hash_parent =~ m/^[0-9a-fA-F]{40}$/) {\n-\t\t\t$expires = '+1d';\n-\t\t}\n \n-\t\t# open patch output\n-\t\topen $fd, \"-|\", git_cmd(), \"diff\", @diff_opts,\n-\t\t\t'-p', ($format eq 'html' ? \"--full-index\" : ()),\n-\t\t\t$hash_parent, $hash, \"--\"\n-\t\t\tor die_error(undef, \"Open git-diff failed\");\n-\t} else  {\n-\t\tdie_error('404 Not Found', \"Missing one of the blob diff parameters\")\n-\t\t\tunless %diffinfo;\n+\t# fake git-diff-tree raw output\n+\t$diffinfo{'from_mode'} = $diffinfo{'to_mode'} = \"blob\";\n+\t$diffinfo{'from_id'} = $hash_parent;\n+\t$diffinfo{'to_id'}   = $hash;\n+\tif (defined $file_name) {\n+\t\t$diffinfo{'status'} = '2';\n+\t\t$diffinfo{'from_file'} = $file_parent;\n+\t\t$diffinfo{'to_file'}   = $file_name;\n+\t} else { # no filename given\n+\t\t$diffinfo{'status'} = '2';\n+\t\t$diffinfo{'from_file'} = $hash_parent;\n+\t\t$diffinfo{'to_file'}   = $hash;\n \t}\n \n+\t# open patch output\n+\topen $fd, \"-|\", git_cmd(), \"diff\", @diff_opts,\n+\t$hash_parent, $hash, \"--\"\n+\t\tor die_error(undef, \"Open git-diff failed\");\n+\n \t# header\n \tif ($format eq 'html') {\n \t\tmy $formats_nav =\n@@ -4028,11 +3973,12 @@ sub git_blobdiff {\n \t\t}\n \n \t} elsif ($format eq 'plain') {\n+\t\tmy $patch_file_name = $file_name || $hash;\n \t\tprint $cgi->header(\n \t\t\t-type => 'text/plain',\n \t\t\t-charset => 'utf-8',\n \t\t\t-expires => $expires,\n-\t\t\t-content_disposition => 'inline; filename=\"' . \"$file_name\" . '.patch\"');\n+\t\t\t-content_disposition => 'inline; filename=\"' . \"$patch_file_name\" . '.patch\"');\n \n \t\tprint \"X-Git-Url: \" . $cgi->self_url() . \"\\n\\n\";\n \n-- \n1.5.1.1.85.gf1888\n"},{"id":"39571","messageId":"20070416202010.GB2592@auto.tuwien.ac.at","threadId":"7698","inReplyTo":"85de402216e82cc0f220df9d27370a33538a232a.1176659094.git.mkoegler@auto.tuwien.ac.at","subject":"[PATCH 4/7] gitweb: Add treediff view","fromName":"Martin Koegler","fromEmail":"mkoegler@auto.tuwien.ac.at","sentAt":"2007-04-16T20:20:10Z","receivedAt":"2007-04-16T20:20:10Z","isPatch":true,"sender":{"key":"mkoegler@auto.tuwien.ac.at","avatar":null},"body":"git_treediff supports comparing different trees. A tree can be specified\neither as hash or as base hash and filename.\n---\nNew version, as I found a bug in the expiration handling code.\n\nI removed the parent links for now, as they require more discussion.\n\nThis patch uses empty fp/f for the root directory and does not propagte f to fp.\nPatch 6 adds this.\n\n gitweb/gitweb.perl |  116 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 116 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 1551d95..c2dc82d 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -450,6 +450,8 @@ my %actions = (\n \t\"tag\" => \\&git_tag,\n \t\"tags\" => \\&git_tags,\n \t\"tree\" => \\&git_tree,\n+\t\"treediff\" => \\&git_treediff,\n+\t\"treediff_plain\" => \\&git_treediff_plain,\n \t\"snapshot\" => \\&git_snapshot,\n \t\"object\" => \\&git_object,\n \t# those below don't need $project\n@@ -4174,6 +4176,120 @@ sub git_commitdiff_plain {\n \tgit_commitdiff('plain');\n }\n \n+sub git_treediff {\n+\tmy $format = shift || 'html';\n+\tmy $expires = '+1d';\n+\n+\t# non-textual hash id's can be cached\n+\tif (defined $hash && $hash !~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t$expires = undef;\n+\t} elsif (defined $hash_parent && $hash_parent !~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t$expires = undef;\n+\t} elsif (defined $hash_base && $hash_base !~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t$expires = undef;\n+\t} elsif (defined $hash_parent_base && $hash_parent_base !~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t$expires = undef;\n+\t}\n+\n+\t# we need to prepare $formats_nav before any parameter munging\n+\tmy $formats_nav;\n+\tif ($format eq 'html') {\n+\t\t$formats_nav =\n+\t\t\t$cgi->a({-href => href(action=>\"treediff_plain\",\n+\t\t\t\t\t\t\t\t   hash=>$hash, hash_parent=>$hash_parent,\n+\t\t\t\t\t\t\t\t   hash_base=>$hash_base, hash_parent_base=>$hash_parent_base,\n+\t\t\t\t\t\t\t\t   file_name=>$file_name, file_parent=>$file_parent)},\n+\t\t\t\t\t\"raw\");\n+\t}\n+\n+\tif (!defined $hash) {\n+\t\tif (!defined $hash_base) {\n+\t\t\tdie_error(undef,'tree parameter missing');\n+\t\t}\n+\t\t$hash = $hash_base;\n+\t\t$hash .= \":\".$file_name if (defined $file_name);\n+\t}\n+\t\n+\tif (!defined $hash_parent) {\n+\t\tif (!defined $hash_parent_base) {\n+\t\t\tdie_error(undef,'tree parameter missing');\n+\t\t}\n+\t\t$hash_parent = $hash_parent_base;\n+\t\t$hash_parent .= \":\".$file_parent if (defined $file_parent);\n+\t}\n+\n+\t# read treediff\n+\tmy $fd;\n+\tmy @difftree;\n+\tif ($format eq 'html') {\n+\t\topen $fd, \"-|\", git_cmd(), \"diff-tree\", '-r', @diff_opts,\n+\t\t\"--no-commit-id\", \"--patch-with-raw\", \"--full-index\",\n+\t\t$hash_parent, $hash, \"--\"\n+\t\t\tor die_error(undef, \"Open git-diff-tree failed\");\n+\t\t\n+\t\twhile (my $line = <$fd>) {\n+\t\t\tchomp $line;\n+\t\t\t# empty line ends raw part of diff-tree output\n+\t\t\tlast unless $line;\n+\t\t\tpush @difftree, $line;\n+\t\t}\n+\t\t\n+\t} elsif ($format eq 'plain') {\n+\t\topen $fd, \"-|\", git_cmd(), \"diff-tree\", '-r', @diff_opts,\n+\t\t'-p', $hash_parent, $hash, \"--\"\n+\t\t\tor die_error(undef, \"Open git-diff-tree failed\");\n+\t\t\n+\t} else {\n+\t\tdie_error(undef, \"Unknown treediff format\");\n+\t}\n+\n+\t# write header\n+\tif ($format eq 'html') {\n+\t\tgit_header_html(undef, $expires);\n+\t\tif (defined $hash_base && (my %co = parse_commit($hash_base))) {\n+\t\t\tgit_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n+\t\t\tgit_print_header_div('commit', esc_html($co{'title'}), $hash_base);\n+\t\t} else {\n+\t\t\tprint \"<div class=\\\"page_nav\\\"><br/>$formats_nav<br/></div>\\n\";\n+\t\t\tprint \"<div class=\\\"title\\\">$hash vs $hash_parent</div>\\n\";\n+\t\t}\n+\t\tprint \"<div class=\\\"page_body\\\">\\n\";\n+\t\t\n+\t} elsif ($format eq 'plain') {\n+\t\tmy $filename = basename($project) . \"-$hash-$hash_parent.patch\";\n+\t\t\n+\t\tprint $cgi->header(\n+\t\t\t\t\t\t   -type => 'text/plain',\n+\t\t\t\t\t\t   -charset => 'utf-8',\n+\t\t\t\t\t\t   -expires => $expires,\n+\t\t\t\t\t\t   -content_disposition => 'inline; filename=\"' . \"$filename\" . '\"');\n+\t\t\n+\t\tprint \"X-Git-Url: \" . $cgi->self_url() . \"\\n\\n\";\n+\t\tprint \"---\\n\\n\";\n+\t}\n+\t\n+\t# write patch\n+\tif ($format eq 'html') {\n+\t\tgit_difftree_body(\\@difftree, $hash_base, $hash_parent_base, $file_name, $file_parent);\n+\t\tprint \"<br/>\\n\";\n+\n+\t\tgit_patchset_body($fd, \\@difftree, $hash_base, $hash_parent_base, $file_name, $file_parent);\n+\t\tclose $fd;\n+\t\tprint \"</div>\\n\"; # class=\"page_body\"\n+\t\tgit_footer_html();\n+\n+\t} elsif ($format eq 'plain') {\n+\t\tlocal $/ = undef;\n+\t\tprint <$fd>;\n+\t\tclose $fd\n+\t\t\tor print \"Reading git-diff-tree failed\\n\";\n+\t}\n+}\n+\n+sub git_treediff_plain {\n+\tgit_treediff('plain');\n+}\n+\n sub git_history {\n \tif (!defined $hash_base) {\n \t\t$hash_base = git_get_head_hash($project);\n-- \n1.5.1.1.85.gf1888\n"},{"id":"40725","messageId":"200704292335.50102.jnareb@gmail.com","threadId":"7698","inReplyTo":"20070416201813.GA2592@auto.tuwien.ac.at","subject":"Re: [PATCH 2/7] gitweb: Support comparing blobs with different names","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-04-29T21:35:49Z","receivedAt":"2007-04-29T21:35:49Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Monday, 16 April 2007, Martin Koegler wrote:\n\n> Currently, blobdiff can only compare blobs with different file\n> names, if no hb/hpb parameters are present.\n> \nNot true. Since commit 5ae917acdf40444945271e5e014cda37e202504e\n\n  \"gitweb: Support comparing blobs (files) with different names\"\n\ngit_blobdiff ('blobdiff' view) suports comparing arbitrary blobs\n(also with different file names) when no hp/hpb parameters are\npresent (although there would be no mode change information),\nbut supports comparing blobs with different file names in presence\nof hp/hpb parameters, provided that it is proper rename diff.\n\nSince this commit you can select rename diff which is part of\n'commitdiff' view as a 'blobdiff' view, correctly.\n\n> This patch adds support for comparing two blobs specified by any\n> combination of hb/f/h and hpb/fp/hp.\n>\nBut it used to lose mode change information. This info should be\nI think in commit message.\n\nBecause your work on including mode changes for git-diff with\n<tree-ish>:<path-to-blob> extended SHA-1 syntax (thanks a lot!)\nI guess that you would want to rewrite this patch.\n \n> Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>\n> ---\n> New version, as I found a bug in the expiration handling code.\n> \n> I unified all blobdiff variants and added support for comparing blobs\n> with different names.\n> \n> If h/hp parameter are missing, I need to generate them with\n> git_get_hash_by_path, as the are needed for the html header, which is\n> generated before parsing the git-diff output.\n\ngit_get_hash_by_path uses git-ls-tree but it does not catch all the info;\nperhaps git_get_info_by_path would be called for here.\n\n> I currently ignore all mode changes, as they are part of the tree. I\n> don't think that displaying a mode change message justifes two call to\n> git-ls-tree for each blob diff (Currently it only calls git-ls-tree\n> for each missing h/hp parameter).\n\nThat is not a problem now, thanks to your patches... although it would\nbe nice to have subroutine which would get the difftree information\nfrom extended git diff header (if it is possible).\n\n> +\tmy $expires = '+1d';\n> +\t# non-textual hash id's can be cached\n> +\tif (defined $hash && $hash !~ m/^[0-9a-fA-F]{40}$/) {\n> +\t\t$expires = undef;\n> +\t} elsif (defined $hash_parent && $hash_parent !~ m/^[0-9a-fA-F]{40}$/) {\n> +\t\t$expires = undef;\n> +\t} elsif (defined $hash_base && $hash_base !~ m/^[0-9a-fA-F]{40}$/) {\n> +\t\t$expires = undef;\n> +\t} elsif (defined $hash_parent_base && $hash_parent_base !~ m/^[0-9a-fA-F]{40}$/) {\n> +\t\t$expires = undef;\n> +\t}\n\nUsually gitweb _changes_ $expires to '+1d' when appropriate, instead\nof defaulting to '+1d' and undefining it. But this might be the matter\nof style consistency, and personal preferences: one complicated boolean\nexpression or set of if ... elsif ... conditionals.\n\nThe idea is that both TO and FROM are to be immutable; this means\neither $hash_parent (or $hash_parent_base) being full SHA-1 and having\nfilename defined, or if appropriate \"parent\" hash is not present (because\n\"parent\" hash has precedence over blob hash) it means that $hash\n(or $hash_parent) being full SHA-1.\n\n[...]  \n> +\tif (defined $hash_parent_base && defined $file_parent && !defined $hash_parent) {\n> +\t    $hash_parent = git_get_hash_by_path($hash_parent_base, $file_parent);\n> +\t}\n[...]\n> +\t# open patch output\n> +\topen $fd, \"-|\", git_cmd(), \"diff\", @diff_opts,\n> +\t$hash_parent, $hash, \"--\"\n> +\t\tor die_error(undef, \"Open git-diff failed\");\n\nYou would most probably use now \"$hash_base:$file_name\" instead of $hash\nif $hash_base is defined, i.e.\n\n  defined $hash_base ? \"$hash_base:$file_name\" : $hash\n\nand similarly for $hash_parent parameter now that <tree>:<path> form\nrespects mode changes information.\n\n-- \nJakub Narebski\nShadeHawk on #git\nPoland\n"},{"id":"40732","messageId":"20070430052702.GA12744@auto.tuwien.ac.at","threadId":"7698","inReplyTo":"200704292335.50102.jnareb@gmail.com","subject":"Re: [PATCH 2/7] gitweb: Support comparing blobs with different names","fromName":"Martin Koegler","fromEmail":"mkoegler@auto.tuwien.ac.at","sentAt":"2007-04-30T05:27:02Z","receivedAt":"2007-04-30T05:27:02Z","isPatch":true,"sender":{"key":"mkoegler@auto.tuwien.ac.at","avatar":null},"body":"On Sun, Apr 29, 2007 at 11:35:49PM +0200, Jakub Narebski wrote:\n> On Monday, 16 April 2007, Martin Koegler wrote:\n> \n> > Currently, blobdiff can only compare blobs with different file\n> > names, if no hb/hpb parameters are present.\n> > \n\nI've already posted a new version of this patch:\nhttp://www.spinics.net/lists/git/msg28812.html\n\nCan you please look at it.\n\n> > Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>\n> > ---\n> > New version, as I found a bug in the expiration handling code.\n> > \n> > I unified all blobdiff variants and added support for comparing blobs\n> > with different names.\n> > \n> > If h/hp parameter are missing, I need to generate them with\n> > git_get_hash_by_path, as the are needed for the html header, which is\n> > generated before parsing the git-diff output.\n> \n> git_get_hash_by_path uses git-ls-tree but it does not catch all the info;\n> perhaps git_get_info_by_path would be called for here.\n\nI now only need the hash of the blob, if not passed as parameter, to\ngenerate a correct header.\n\n> [...]  \n> > +\tif (defined $hash_parent_base && defined $file_parent && !defined $hash_parent) {\n> > +\t    $hash_parent = git_get_hash_by_path($hash_parent_base, $file_parent);\n> > +\t}\n> [...]\n> > +\t# open patch output\n> > +\topen $fd, \"-|\", git_cmd(), \"diff\", @diff_opts,\n> > +\t$hash_parent, $hash, \"--\"\n> > +\t\tor die_error(undef, \"Open git-diff failed\");\n> \n> You would most probably use now \"$hash_base:$file_name\" instead of $hash\n> if $hash_base is defined, i.e.\n> \n>   defined $hash_base ? \"$hash_base:$file_name\" : $hash\n> \n> and similarly for $hash_parent parameter now that <tree>:<path> form\n> respects mode changes information.\n\nAddressed in new patch.\n\nmfg Martin Kögler\n"},{"id":"42456","messageId":"20070518084935.GV4489@pasky.or.cz","threadId":"7698","inReplyTo":"481946c2e3cff09ed4a623b1b20b9889666aedb0.1176659095.git.mkoegler@auto.tuwien.ac.at","subject":"Re: [PATCH 5/7] gitweb: Prototyp for selecting diffs in JavaScript","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2007-05-18T08:49:35Z","receivedAt":"2007-05-18T08:49:35Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hi,\n\nOn Sun, Apr 15, 2007 at 10:46:08PM CEST, Martin Koegler wrote:\n> ---\n> This patch is only to test the other patches. I'm working on reimplementing it in perl.\n\n  I think this is something that I'd quite like to testdrive at\nrepo.or.cz, but I'm admittelly somewhat lost in all the patches,\nresends, new versions, something got applied, etc. - if it's not too big\na hassle for you, would you please care to resend the latest series?\n\n  Thanks,\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nEver try. Ever fail. No matter. // Try again. Fail again. Fail better.\n\t\t-- Samuel Beckett\n"},{"id":"42604","messageId":"20070519075701.GA30933@auto.tuwien.ac.at","threadId":"7698","inReplyTo":"20070518084935.GV4489@pasky.or.cz","subject":"Re: [PATCH 5/7] gitweb: Prototyp for selecting diffs in JavaScript","fromName":"Martin Koegler","fromEmail":"mkoegler@auto.tuwien.ac.at","sentAt":"2007-05-19T07:57:01Z","receivedAt":"2007-05-19T07:57:01Z","isPatch":true,"sender":{"key":"mkoegler@auto.tuwien.ac.at","avatar":null},"body":"On Fri, May 18, 2007 at 10:49:35AM +0200, Petr Baudis wrote:\n> On Sun, Apr 15, 2007 at 10:46:08PM CEST, Martin Koegler wrote:\n> > ---\n> > This patch is only to test the other patches. I'm working on reimplementing it in perl.\n> \n>   I think this is something that I'd quite like to testdrive at\n> repo.or.cz, but I'm admittelly somewhat lost in all the patches,\n> resends, new versions, something got applied, etc. - if it's not too big\n> a hassle for you, would you please care to resend the latest series?\n\nAgaingst what version/repository do you want the patch?\n\nFor the new version, I intend to move the JavaScript file into the\nhead tag of the html page. I could integrate your incremental blame\nlink rewrite as well. If I'm doing this, we could remove the blamelink\nclass hack as well as the fixBlameLinks JavaScript function.\n\nmfg Martin Kögler\n"},{"id":"42605","messageId":"20070519082744.GC4489@pasky.or.cz","threadId":"7698","inReplyTo":"20070519075701.GA30933@auto.tuwien.ac.at","subject":"Re: [PATCH 5/7] gitweb: Prototyp for selecting diffs in JavaScript","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2007-05-19T08:27:45Z","receivedAt":"2007-05-19T08:27:45Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sat, May 19, 2007 at 09:57:01AM CEST, Martin Koegler wrote:\n> Againgst what version/repository do you want the patch?\n\nWhatever is comfortable for you :-) - next would be ideal for me, but\ncan be something else as well.\n\n> For the new version, I intend to move the JavaScript file into the\n> head tag of the html page. I could integrate your incremental blame\n> link rewrite as well. If I'm doing this, we could remove the blamelink\n> class hack as well as the fixBlameLinks JavaScript function.\n\nIt's not clear at all yet whether incremental blame is viable idea\nbecause I suspect Firefox might be just too horribly slow at working\nwith DOM for it to make sense for any files of non-trivial size. So I\nwouldn't rely on this going in just yet. :-(\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nEver try. Ever fail. No matter. // Try again. Fail again. Fail better.\n\t\t-- Samuel Beckett\n"}]}