{"thread":{"id":"2679","subject":"[PATCH 0/4] Repository format version check series.","startedAt":"2005-11-26T01:15:02Z","lastAt":"2005-11-29T06:42:42Z","messageCount":8,"participants":["Junio C Hamano","Timo Hirvonen","Linus Torvalds","Martin Atukunda"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"12749","messageId":"7voe48gqg9.fsf@assigned-by-dhcp.cox.net","threadId":"2679","inReplyTo":null,"subject":"[PATCH 0/4] Repository format version check series.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-26T01:15:02Z","receivedAt":"2005-11-26T01:15:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This series is what I've been cooking for the past several days,\npartly based on patch from Martin Atukunda but with hopefully\nsmaller impact.\n\n[PATCH 1/4] Repository format version check.\n[PATCH 2/4] Check repository format version in enter_repo().\n[PATCH 3/4] init-db: check template and repository format.\n[PATCH 4/4] setup_git_directory(): check repository format version.\n\nThe first in the series adds the core.repositoryformatversion\nconfiguration item.  The current repository format version is\ndefined as version 0, and is the same as not having that in the\nconfiguration file.\n\nThe second one adds a repository format version check to\nenter_repo().  This function is used to verify the path given by\nthe user, either from the command line or over the network, is a\nvalid git repository by daemon, upload-pack (which runs on the\nother end when you run fetch-pack or clone-pack), and\nreceive-pack (which runs on the other end when you run\nsend-pack).\n\nThe third one makes sure we do not reinitialize a repository\nwhose format version we do not understand, do not copy\ntemplate files from unmatching version into a new repository,\nand record the repository format version in a newly created\nrepository.\n\nThe last bit in the series adds the same check code to\nsetup_git_directory().  Along with the earlier change to\ngit-sh-setup that uses git-var to verify the repository, this\ngives the shell scripts the same repository format version\ncheck.\n\nI'll push this out to the \"master\" sometime over the weekend,\nand hopefully merge it into \"maint\" and cut the next 1.0rc on\nWednesday.  Let's hope that will be the last 1.0rc.\n"},{"id":"12790","messageId":"7vek52e4ve.fsf@assigned-by-dhcp.cox.net","threadId":"2679","inReplyTo":"7voe48gqg9.fsf@assigned-by-dhcp.cox.net","subject":"What's in master and pu (aka when will 1.0rc4 be out)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-27T10:56:21Z","receivedAt":"2005-11-27T10:56:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> This series is what I've been cooking for the past several days,\n> partly based on patch from Martin Atukunda but with hopefully\n> smaller impact.\n>\n> [PATCH 1/4] Repository format version check.\n> [PATCH 2/4] Check repository format version in enter_repo().\n> [PATCH 3/4] init-db: check template and repository format.\n> [PATCH 4/4] setup_git_directory(): check repository format version.\n\nAnd they are now in the master branch, along with a couple of\nbugfixes I received in the last couple of days.  I've given them\nsome testing and believe they are in good enough shape for 1.0\nfutureproofing.  Bug reports with reproduction recipe and/or\npatch are most welcomed.\n\nCooking in the proposed updates branch is the 8-series \"work\nfrom subdirectory\" patch I posted yesterday, with some polishing\nbased on suggestion from Linus. The ls-tree rework is not\nincluded at this point, neither is the git-sh-setup, both of\nwhich unfortunately have wider impact than I feel comfortable to\nswallow in one day.\n\nI am hoping to base the next \"maint\" branch update, probably on\nWednesday, on what is in \"pu\" tonight, with safer updates I will\nreceive from the list (Documentation fixes and updates, and\narchimport updates from Eric and Martin are the candidates).\nThat will be tagged as 1.0rc4 and hopefully be the last 1.0rc,\nwhich means no more major feature/semantics changes after that\nuntil 1.0 --- famous last words.\n\nSo I anticipate that many of the barebone Porcelain commands\nthat insist on running from the toplevel will ship the way they\nare in 1.0.  If you run \"git grep git-sh-setup 'git*sh'\", you\nwill notice that most of them are whole-tree operations anyway,\nso not much is lost [*1*].\n\n[Footnote]\n\n*1* Bisecting only in a subdirectory might be an interesting\nthing to do, hunting down a bug in a subsystem, but usually a\nsubsystem has at least two relevant subdirectories (source and\ninclude file trees) ;-).\n\nI suspect that it would be trivial to convert whole-repository\noperations such as count-objects, prune, and repack to work from\nsubdirectory, although the value of that is dubious.\n"},{"id":"12797","messageId":"20051127151134.0eac7019.tihirvon@gmail.com","threadId":"2679","inReplyTo":"7vek52e4ve.fsf@assigned-by-dhcp.cox.net","subject":"Re: What's in master and pu (aka when will 1.0rc4 be out)","fromName":"Timo Hirvonen","fromEmail":"tihirvon@gmail.com","sentAt":"2005-11-27T13:11:34Z","receivedAt":"2005-11-27T13:11:34Z","isPatch":false,"sender":{"key":"tihirvon@gmail.com","avatar":null},"body":"On Sun, 27 Nov 2005 02:56:21 -0800\nJunio C Hamano <junkio@cox.net> wrote:\n\n> *1* Bisecting only in a subdirectory might be an interesting\n> thing to do, hunting down a bug in a subsystem, but usually a\n> subsystem has at least two relevant subdirectories (source and\n> include file trees) ;-).\n\nHmm.. would something like \n\n    git-bisect --include drivers/char/drm/ --include include/ ...\n\nbe easy to implement?  That command would limit bisecting to only the\ncommits that have changed files under those two directories.\n\n-- \nhttp://onion.dynserv.net/~timo/\n"},{"id":"12808","messageId":"Pine.LNX.4.64.0511271106360.13959@g5.osdl.org","threadId":"2679","inReplyTo":"20051127151134.0eac7019.tihirvon@gmail.com","subject":"Re: What's in master and pu (aka when will 1.0rc4 be out)","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-11-27T19:32:03Z","receivedAt":"2005-11-27T19:32:03Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 27 Nov 2005, Timo Hirvonen wrote:\n> \n> Hmm.. would something like \n> \n>     git-bisect --include drivers/char/drm/ --include include/ ...\n> \n> be easy to implement?  That command would limit bisecting to only the\n> commits that have changed files under those two directories.\n\nHeh.\n\nIt was surprisingly easy to do.\n\nThe syntax is\n\n\tgit bisect start <pathspec>\n\nfollowed by all the normal \"git bisect good/bad\" stuff.\n\nAlmost totally untested, and I guarantee that if your pathnames have \nspaces in them (or your GIT_DIR has spaces in it) this won't work. I don't \nknow how to fix that, my shell programming isn't good enough.\n\nThis involves small changes to make \"git-rev-list --bisect\" work in the \npresense of a pathspec limiter, and then truly trivial (and that's the \nbroken part) changes to make \"git bisect\" save away and use the pathspec.\n\nI tried one bisection, and a \"git bisect visualize\", and it all looked \ncorrect. But hey, don't be surprised if it has problems.\n\n\t\tLinus\n\n---\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex d92993b..2455f00 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -33,7 +33,6 @@ bisect_autostart() {\n }\n \n bisect_start() {\n-        case \"$#\" in 0) ;; *) usage ;; esac\n \t#\n \t# Verify HEAD. If we were bisecting before this, reset to the\n \t# top-of-line master first!\n@@ -57,7 +56,8 @@ bisect_start() {\n \trm -f \"$GIT_DIR/refs/heads/bisect\"\n \trm -rf \"$GIT_DIR/refs/bisect/\"\n \tmkdir \"$GIT_DIR/refs/bisect\"\n-\techo \"git-bisect start\" >\"$GIT_DIR/BISECT_LOG\"\n+\techo \"git-bisect start $@\" >\"$GIT_DIR/BISECT_LOG\"\n+\techo \"$@\" > \"$GIT_DIR/BISECT_NAMES\"\n }\n \n bisect_bad() {\n@@ -121,7 +121,7 @@ bisect_next() {\n \tbad=$(git-rev-parse --verify refs/bisect/bad) &&\n \tgood=$(git-rev-parse --sq --revs-only --not \\\n \t\t$(cd \"$GIT_DIR\" && ls refs/bisect/good-*)) &&\n-\trev=$(eval \"git-rev-list --bisect $good $bad\") || exit\n+\trev=$(eval \"git-rev-list --bisect $good $bad -- $(cat $GIT_DIR/BISECT_NAMES)\") || exit\n \tif [ -z \"$rev\" ]; then\n \t    echo \"$bad was both good and bad\"\n \t    exit 1\n@@ -131,7 +131,7 @@ bisect_next() {\n \t    git-diff-tree --pretty $rev\n \t    exit 0\n \tfi\n-\tnr=$(eval \"git-rev-list $rev $good\" | wc -l) || exit\n+\tnr=$(eval \"git-rev-list $rev $good -- $(cat $GIT_DIR/BISECT_NAMES)\" | wc -l) || exit\n \techo \"Bisecting: $nr revisions left to test after this\"\n \techo \"$rev\" > \"$GIT_DIR/refs/heads/new-bisect\"\n \tgit checkout new-bisect || exit\n@@ -142,7 +142,7 @@ bisect_next() {\n \n bisect_visualize() {\n \tbisect_next_check fail\n-\tgitk bisect/bad --not `cd \"$GIT_DIR/refs\" && echo bisect/good-*`\n+\tgitk bisect/bad --not `cd \"$GIT_DIR/refs\" && echo bisect/good-*` -- $(cat $GIT_DIR/BISECT_NAMES)\n }\n \n bisect_reset() {\ndiff --git a/rev-list.c b/rev-list.c\nindex e17f928..8020d97 100644\n--- a/rev-list.c\n+++ b/rev-list.c\n@@ -350,7 +350,8 @@ static int count_distance(struct commit_\n \n \t\tif (commit->object.flags & (UNINTERESTING | COUNTED))\n \t\t\tbreak;\n-\t\tnr++;\n+\t\tif (!paths || (commit->object.flags & TREECHANGE))\n+\t\t\tnr++;\n \t\tcommit->object.flags |= COUNTED;\n \t\tp = commit->parents;\n \t\tentry = p;\n@@ -362,6 +363,7 @@ static int count_distance(struct commit_\n \t\t\t}\n \t\t}\n \t}\n+\n \treturn nr;\n }\n \n@@ -382,15 +384,20 @@ static struct commit_list *find_bisectio\n \tnr = 0;\n \tp = list;\n \twhile (p) {\n-\t\tnr++;\n+\t\tif (!paths || (p->item->object.flags & TREECHANGE))\n+\t\t\tnr++;\n \t\tp = p->next;\n \t}\n \tclosest = 0;\n \tbest = list;\n \n-\tp = list;\n-\twhile (p) {\n-\t\tint distance = count_distance(p);\n+\tfor (p = list; p; p = p->next) {\n+\t\tint distance;\n+\n+\t\tif (paths && !(p->item->object.flags & TREECHANGE))\n+\t\t\tcontinue;\n+\n+\t\tdistance = count_distance(p);\n \t\tclear_distance(list);\n \t\tif (nr - distance < distance)\n \t\t\tdistance = nr - distance;\n@@ -398,7 +405,6 @@ static struct commit_list *find_bisectio\n \t\t\tbest = p;\n \t\t\tclosest = distance;\n \t\t}\n-\t\tp = p->next;\n \t}\n \tif (best)\n \t\tbest->next = NULL;\n"},{"id":"12814","messageId":"7v8xv9dcix.fsf@assigned-by-dhcp.cox.net","threadId":"2679","inReplyTo":"Pine.LNX.4.64.0511271106360.13959@g5.osdl.org","subject":"Re: What's in master and pu (aka when will 1.0rc4 be out)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-27T21:08:38Z","receivedAt":"2005-11-27T21:08:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> The syntax is\n>\n> \tgit bisect start <pathspec>\n>\n> followed by all the normal \"git bisect good/bad\" stuff.\n\nI love how I can just say \"this might be interesting\" and \nfind your message in my mailbox next morning [*1*] ;-).\n\nThis would be useful to cut down the number of bisection needed\nto reach the culprit if the initial guess is correct as to which\npart of the tree is involved.\n\n[Reference]\n*1* http://marc.theaimsgroup.com/?l=git&m=111669620826189\n"},{"id":"12835","messageId":"7vmzjp35gk.fsf_-_@assigned-by-dhcp.cox.net","threadId":"2679","inReplyTo":"Pine.LNX.4.64.0511271106360.13959@g5.osdl.org","subject":"[PATCH] bisect: quote pathnames for eval safety.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-28T01:51:23Z","receivedAt":"2005-11-28T01:51:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> Almost totally untested, and I guarantee that if your pathnames have \n> spaces in them (or your GIT_DIR has spaces in it) this won't work. I don't \n> know how to fix that, my shell programming isn't good enough.\n\nLike this?  I've placed the bisect patch with this in the\nproposed updates.\n\n---\n\n git-bisect.sh |   16 ++++++++++++----\n 1 files changed, 12 insertions(+), 4 deletions(-)\n\napplies-to: 7da44ab45773e0a424c1e08c838c1f6deeb6ceb2\n82c8f5bed2ae61f1f368cfca84f6b0194b1ad208\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 2455f00..d4196f9 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -1,9 +1,16 @@\n #!/bin/sh\n . git-sh-setup\n \n+sq() {\n+    for x\n+    do\n+\techo \"$x\" | sed -e \"s/'/'\\\\\\\\''/g\" -e \"s/^/'/\" -e \"s/\\$/'/\"\n+    done\n+}\n+\n usage() {\n     echo >&2 'usage: git bisect [start|bad|good|next|reset|visualize]\n-git bisect start\t\treset bisect state and start bisection.\n+git bisect start [<pathspec>]\treset bisect state and start bisection.\n git bisect bad [<rev>]\t\tmark <rev> a known-bad revision.\n git bisect good [<rev>...]\tmark <rev>... known-good revisions.\n git bisect next\t\t\tfind next bisection to test and check it out.\n@@ -56,8 +63,8 @@ bisect_start() {\n \trm -f \"$GIT_DIR/refs/heads/bisect\"\n \trm -rf \"$GIT_DIR/refs/bisect/\"\n \tmkdir \"$GIT_DIR/refs/bisect\"\n-\techo \"git-bisect start $@\" >\"$GIT_DIR/BISECT_LOG\"\n-\techo \"$@\" > \"$GIT_DIR/BISECT_NAMES\"\n+\tsq git-bisect start \"$@\" >\"$GIT_DIR/BISECT_LOG\"\n+\tsq \"$@\" >\"$GIT_DIR/BISECT_NAMES\"\n }\n \n bisect_bad() {\n@@ -142,7 +149,8 @@ bisect_next() {\n \n bisect_visualize() {\n \tbisect_next_check fail\n-\tgitk bisect/bad --not `cd \"$GIT_DIR/refs\" && echo bisect/good-*` -- $(cat $GIT_DIR/BISECT_NAMES)\n+\tnot=`cd \"$GIT_DIR/refs\" && echo bisect/good-*`\n+\teval gitk bisect/bad --not $not -- $(cat \"$GIT_DIR/BISECT_NAMES\")\n }\n \n bisect_reset() {\n---\n0.99.9.GIT\n"},{"id":"12838","messageId":"7virud34hd.fsf@assigned-by-dhcp.cox.net","threadId":"2679","inReplyTo":"7vmzjp35gk.fsf_-_@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] bisect: quote pathnames for eval safety.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-28T02:12:30Z","receivedAt":"2005-11-28T02:12:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Linus Torvalds <torvalds@osdl.org> writes:\n>\n>> Almost totally untested, and I guarantee that if your pathnames have \n>> spaces in them (or your GIT_DIR has spaces in it) this won't work. I don't \n>> know how to fix that, my shell programming isn't good enough.\n>\n> Like this?  I've placed the bisect patch with this in the\n> proposed updates.\n\nNot like that ;-).  Fixed one is in pu.\n"},{"id":"12916","messageId":"20051129064242.GA8978@igloo.ds.co.ug","threadId":"2679","inReplyTo":"7voe48gqg9.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 0/4] Repository format version check series.","fromName":"Martin Atukunda","fromEmail":"matlads@dsmagic.com","sentAt":"2005-11-29T06:42:42Z","receivedAt":"2005-11-29T06:42:42Z","isPatch":true,"sender":{"key":"matlads@dsmagic.com","avatar":null},"body":"On Fri, Nov 25, 2005 at 05:15:02PM -0800, Junio C Hamano wrote:\n> This series is what I've been cooking for the past several days,\n> partly based on patch from Martin Atukunda but with hopefully\n> smaller impact.\n> \n> [PATCH 1/4] Repository format version check.\n> [PATCH 2/4] Check repository format version in enter_repo().\n> [PATCH 3/4] init-db: check template and repository format.\n> [PATCH 4/4] setup_git_directory(): check repository format version.\n\nThis is just to confirm that this patch series passed the tests on my\nend. Good work.\n\n- Martin -\n\n-- \nDue to a shortage of devoted followers, the production of great leaders has been discontinued.\n"}]}