{"thread":{"id":"3012","subject":"What's new in git.git","startedAt":"2006-01-09T01:20:56Z","lastAt":"2006-01-09T12:27:22Z","messageCount":3,"participants":["Junio C Hamano","Kay Sievers"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"14332","messageId":"7vslrytcw7.fsf@assigned-by-dhcp.cox.net","threadId":"3012","inReplyTo":null,"subject":"What's new in git.git","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-09T01:20:56Z","receivedAt":"2006-01-09T01:20:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Latest maintenance release for GIT 1.0 (1.0.8) and the new\nfeature release GIT 1.1.0 have been pushed out.\n\nWaiting in the proposed updates branch are two backward\nincompatible changes.\n\n - Require packfiles to be named pack-[0-9a-f]{40}.pack, and\n   issue an warning if [0-9a-f]{40} part does not match the SHA1\n   checksum of sorted object names that are contained in the\n   pack.  Later I would like to promote the warning to an error,\n   and there is a tool to help renaming packs created with older\n   git-pack-objects.  When the warning is promoted to an error,\n   this will break existing packfiles.\n\n - Use textual symbolic refs to represent .git/HEAD everywhere,\n   not just on filesystems without symbolic link supports.  This\n   was proposed by Pavel mid November 2005, but is known to\n   break Porcelains that read(2) from .git/HEAD and expect to\n   read an object name for the current branch head (use \"git\n   rev-parse --verify HEAD\" instead), and write(2) into\n   .git/HEAD and expect to update the current branch head (use\n   \"git update-ref HEAD $commit [$old]\" instead).  Last time I\n   checked, gitweb would break with this change.\n\nAlso there are patches floating around to update format-patch\nand rebase.  I rejected the initial round, but consider what\nthe latter wants to achieve a worthwhile goal, and expect to\nupdate rebase in some form.\n\nNow the core and the barebone Porcelain are more or less stable\nand changes have significantly slowed down, I think it is a good\ntime to start revisiting the libification effort, started by\nSmurf.  I haven't taken a look at his tree for a while.\n\nAnother area that needs attention is to see how we can improve\nhandling of merges between branches that have renamed things\n(i.e. HPA's klibc repositories).  I'd also like to teach\nrenaming merge to resolve strategy somehow.\n\nOther small things I have in mind, in random order, are:\n\n - Give extra option to \"diff-tree -m -p\" to show difference\n   between natural merge among parents and the actual merge\n   result.  I do not think this would make sense for non patch\n   format.\n\n - The recent \"git-daemon --base=/pub/git\" is a good addition\n   (git://host/frotz.git is mapped to /pub/git/frotz.git\n   directory), but with the current implementation whitelist\n   needs to start with /pub/git/.  I initially thought it was\n   not so nice, but maybe it is OK; but this needs to be\n   documented.  It also forbids user relative paths, which\n   should be made an independent switch.\n\n - Also in \"git-daemon\", I outlined --strict-symlink option a\n   while ago, which forbids symbolic links to step outside of\n   whitelisted areas.  This has not been implemented, and we may\n   want to add it.\n\n - Although Linus has been pretty negative about improving the\n   current dumb http transport, many people seem to rely on it.\n   It \"works\" with packfiles in the sense that it does not barf,\n   but the server file packing strategy to reduce duplicated\n   download needs to be worked out to make it more efficient.\n\n - If the same cloning requests are made number of times, we\n   should be able to cache the packfile we sent out and reuse,\n   to reduce the load on the server side.  When used with\n   git-daemon, this requires the daemon to be able to write\n   somewhere (not necessarily the original repository itself),\n   so there is certain security implications.\n"},{"id":"14350","messageId":"7v7j99ssfy.fsf@assigned-by-dhcp.cox.net","threadId":"3012","inReplyTo":"7vslrytcw7.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] gitweb: allow working in repositories with textual symref HEAD","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-09T08:42:41Z","receivedAt":"2006-01-09T08:42:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"There is a change to git-core, proposed by Pavel and cooking for\nthe last 6 weeks, to use textual symref to represent HEAD even\non filesystems that support symbolic links.  It would break\ngitweb without this even on UNIX.\n\nThe current code is already broken on filesystems that do not\nhandle symbolic links. With this change, gitweb keeps working\nwith repositories whose HEADs are symbolic links.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n Junio C Hamano <junkio@cox.net> writes:\n \n > Waiting in the proposed updates branch are two backward\n > incompatible changes.\n > ...\n >  - Use textual symbolic refs to represent .git/HEAD everywhere,\n >    not just on filesystems without symbolic link supports.  This\n >    was proposed by Pavel mid November 2005, but is known to\n >    break Porcelains that read(2) from .git/HEAD and expect to\n >    read an object name for the current branch head (use \"git\n >    rev-parse --verify HEAD\" instead), and write(2) into\n >    .git/HEAD and expect to update the current branch head (use\n >    \"git update-ref HEAD $commit [$old]\" instead).  Last time I\n >    checked, gitweb would break with this change.\n\n Here is a proposed fix.  It was not clear to me what your\n $ENV{'GIT_DIR'} policy was, so git_read_head tries to play\n safer, but please feel free to drop that part if the rest of\n the code is safe without them.\n\n gitweb.cgi |   49 +++++++++++++++++++++++++++++++++----------------\n 1 files changed, 33 insertions(+), 16 deletions(-)\n\nc903862d1c5d77fe5a1633eb7a40171d98a8dd73\ndiff --git a/gitweb.cgi b/gitweb.cgi\nindex 1814f7f..26c7395 100755\n--- a/gitweb.cgi\n+++ b/gitweb.cgi\n@@ -396,6 +396,23 @@ sub git_get_type {\n \treturn $type;\n }\n \n+sub git_read_head {\n+\tmy $project = shift;\n+\tmy $oENV = $ENV{'GIT_DIR'};\n+\tmy $retval = undef;\n+\t$ENV{'GIT_DIR'} = \"$projectroot/$project\";\n+\tif (open my $fd, \"-|\", \"$gitbin/git-rev-parse\", \"--verify\", \"HEAD\") {\n+\t\tmy $head = <$fd>;\n+\t\tclose $fd;\n+\t\tchomp $head;\n+\t\tif ($head =~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t\t$retval = $head;\n+\t\t}\n+\t}\n+\t$ENV{'GIT_DIR'} = $oENV;\n+\treturn $retval;\n+}\n+\n sub git_read_hash {\n \tmy $path = shift;\n \n@@ -823,7 +840,7 @@ sub git_project_list {\n \t\tdie_error(undef, \"No project found.\");\n \t}\n \tforeach my $pr (@list) {\n-\t\tmy $head = git_read_hash(\"$pr->{'path'}/HEAD\");\n+\t\tmy $head = git_read_head($pr->{'path'});\n \t\tif (!defined $head) {\n \t\t\tnext;\n \t\t}\n@@ -994,7 +1011,7 @@ sub git_read_refs {\n \n sub git_summary {\n \tmy $descr = git_read_description($project) || \"none\";\n-\tmy $head = git_read_hash(\"$project/HEAD\");\n+\tmy $head = git_read_head($project);\n \tmy %co = git_read_commit($head);\n \tmy %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});\n \n@@ -1034,7 +1051,7 @@ sub git_summary {\n \t      \"<tr><td>owner</td><td>$owner</td></tr>\\n\" .\n \t      \"<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\\n\" .\n \t      \"</table>\\n\";\n-\topen my $fd, \"-|\", \"$gitbin/git-rev-list --max-count=17 \" . git_read_hash(\"$project/HEAD\") or die_error(undef, \"Open failed.\");\n+\topen my $fd, \"-|\", \"$gitbin/git-rev-list --max-count=17 \" . git_read_head($project) or die_error(undef, \"Open failed.\");\n \tmy (@revlist) = map { chomp; $_ } <$fd>;\n \tclose $fd;\n \tprint \"<div>\\n\" .\n@@ -1172,7 +1189,7 @@ sub git_summary {\n }\n \n sub git_tag {\n-\tmy $head = git_read_hash(\"$project/HEAD\");\n+\tmy $head = git_read_head($project);\n \tgit_header_html();\n \tprint \"<div class=\\\"page_nav\\\">\\n\" .\n \t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=summary\")}, \"summary\") .\n@@ -1211,7 +1228,7 @@ sub git_tag {\n }\n \n sub git_tags {\n-\tmy $head = git_read_hash(\"$project/HEAD\");\n+\tmy $head = git_read_head($project);\n \tgit_header_html();\n \tprint \"<div class=\\\"page_nav\\\">\\n\" .\n \t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=summary\")}, \"summary\") .\n@@ -1270,7 +1287,7 @@ sub git_tags {\n }\n \n sub git_heads {\n-\tmy $head = git_read_hash(\"$project/HEAD\");\n+\tmy $head = git_read_head($project);\n \tgit_header_html();\n \tprint \"<div class=\\\"page_nav\\\">\\n\" .\n \t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=summary\")}, \"summary\") .\n@@ -1343,7 +1360,7 @@ sub git_get_hash_by_path {\n \n sub git_blob {\n \tif (!defined $hash && defined $file_name) {\n-\t\tmy $base = $hash_base || git_read_hash(\"$project/HEAD\");\n+\t\tmy $base = $hash_base || git_read_head($project);\n \t\t$hash = git_get_hash_by_path($base, $file_name, \"blob\") || die_error(undef, \"Error lookup file.\");\n \t}\n \topen my $fd, \"-|\", \"$gitbin/git-cat-file blob $hash\" or die_error(undef, \"Open failed.\");\n@@ -1407,13 +1424,13 @@ sub git_blob_plain {\n \n sub git_tree {\n \tif (!defined $hash) {\n-\t\t$hash = git_read_hash(\"$project/HEAD\");\n+\t\t$hash = git_read_head($project);\n \t\tif (defined $file_name) {\n-\t\t\tmy $base = $hash_base || git_read_hash(\"$project/HEAD\");\n+\t\t\tmy $base = $hash_base || $hash;\n \t\t\t$hash = git_get_hash_by_path($base, $file_name, \"tree\");\n \t\t}\n \t\tif (!defined $hash_base) {\n-\t\t\t$hash_base = git_read_hash(\"$project/HEAD\");\n+\t\t\t$hash_base = $hash;\n \t\t}\n \t}\n \t$/ = \"\\0\";\n@@ -1497,7 +1514,7 @@ sub git_tree {\n \n sub git_rss {\n \t# http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ\n-\topen my $fd, \"-|\", \"$gitbin/git-rev-list --max-count=150 \" . git_read_hash(\"$project/HEAD\") or die_error(undef, \"Open failed.\");\n+\topen my $fd, \"-|\", \"$gitbin/git-rev-list --max-count=150 \" . git_read_head($project) or die_error(undef, \"Open failed.\");\n \tmy (@revlist) = map { chomp; $_ } <$fd>;\n \tclose $fd or die_error(undef, \"Reading rev-list failed.\");\n \tprint $cgi->header(-type => 'text/xml', -charset => 'utf-8');\n@@ -1566,7 +1583,7 @@ sub git_opml {\n \n \tforeach my $pr (@list) {\n \t\tmy %proj = %$pr;\n-\t\tmy $head = git_read_hash(\"$proj{'path'}/HEAD\");\n+\t\tmy $head = git_read_head($proj{'path'});\n \t\tif (!defined $head) {\n \t\t\tnext;\n \t\t}\n@@ -1587,7 +1604,7 @@ sub git_opml {\n }\n \n sub git_log {\n-\tmy $head = git_read_hash(\"$project/HEAD\");\n+\tmy $head = git_read_head($project);\n \tif (!defined $hash) {\n \t\t$hash = $head;\n \t}\n@@ -2083,7 +2100,7 @@ sub git_commitdiff_plain {\n \n sub git_history {\n \tif (!defined $hash) {\n-\t\t$hash = git_read_hash(\"$project/HEAD\");\n+\t\t$hash = git_read_head($project);\n \t}\n \tmy %co = git_read_commit($hash);\n \tif (!%co) {\n@@ -2159,7 +2176,7 @@ sub git_search {\n \t\tdie_error(\"\", \"Text field empty.\");\n \t}\n \tif (!defined $hash) {\n-\t\t$hash = git_read_hash(\"$project/HEAD\");\n+\t\t$hash = git_read_head($project);\n \t}\n \tmy %co = git_read_commit($hash);\n \tif (!%co) {\n@@ -2300,7 +2317,7 @@ sub git_search {\n }\n \n sub git_shortlog {\n-\tmy $head = git_read_hash(\"$project/HEAD\");\n+\tmy $head = git_read_head($project);\n \tif (!defined $hash) {\n \t\t$hash = $head;\n \t}\n-- \n1.1.0\n"},{"id":"14359","messageId":"20060109122722.GA14187@vrfy.org","threadId":"3012","inReplyTo":"7v7j99ssfy.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb: allow working in repositories with textual symref HEAD","fromName":"Kay Sievers","fromEmail":"kay.sievers@suse.de","sentAt":"2006-01-09T12:27:22Z","receivedAt":"2006-01-09T12:27:22Z","isPatch":true,"sender":{"key":"kay.sievers@vrfy.org","avatar":null},"body":"On Mon, Jan 09, 2006 at 12:42:41AM -0800, Junio C Hamano wrote:\n> There is a change to git-core, proposed by Pavel and cooking for\n> the last 6 weeks, to use textual symref to represent HEAD even\n> on filesystems that support symbolic links.  It would break\n> gitweb without this even on UNIX.\n\nApplied and installed on kernel.org.\n\nThanks,\nKay\n"}]}