{"thread":{"id":"9382","subject":"rc4 - make quick-install-doc is broken","startedAt":"2007-08-04T15:07:03Z","lastAt":"2007-08-07T14:08:43Z","messageCount":36,"participants":["Mark Levedahl","Johannes Schindelin","René Scharfe","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"49734","messageId":"46B49617.3070402@gmail.com","threadId":"9382","inReplyTo":null,"subject":"rc4 - make quick-install-doc is broken","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-08-04T15:07:03Z","receivedAt":"2007-08-04T15:07:03Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Beginning with commit\n\n6490a3383f1d0d96c122069e510ef1af1d019fbb Fix work-tree related breakages\n\ninstall-doc-quick.sh no longer installs man pages, at least not to the \ndefined $mandir (if \"git-checkout-index\" is putting them somewhere else, \nI haven't discovered where). Reverting the above commit eliminates this \nproblem. This is on Cygwin, haven't tried on Linux.\n\nMark Levedahl\n"},{"id":"49740","messageId":"Pine.LNX.4.64.0708041637450.14781@racer.site","threadId":"9382","inReplyTo":"46B49617.3070402@gmail.com","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T15:38:27Z","receivedAt":"2007-08-04T15:38:27Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 4 Aug 2007, Mark Levedahl wrote:\n\n> Beginning with commit\n> \n> 6490a3383f1d0d96c122069e510ef1af1d019fbb Fix work-tree related breakages\n> \n> install-doc-quick.sh no longer installs man pages, at least not to the defined\n> $mandir (if \"git-checkout-index\" is putting them somewhere else, I haven't\n> discovered where). Reverting the above commit eliminates this problem. This is\n> on Cygwin, haven't tried on Linux.\n\nCould it be that you did not find this commit by bisecting the issue?  I \nhighly doubt that said commit changes anything in the build process.\n\nCiao,\nDscho\n"},{"id":"49742","messageId":"46B4A2B0.9080208@gmail.com","threadId":"9382","inReplyTo":"Pine.LNX.4.64.0708041637450.14781@racer.site","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-08-04T16:00:48Z","receivedAt":"2007-08-04T16:00:48Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Johannes Schindelin wrote:\n> Could it be that you did not find this commit by bisecting the issue?  I \n> highly doubt that said commit changes anything in the build process.\n>\n> Ciao,\n> Dscho\n>\n>   \n<snip ...>\n\ngit>git bisect good\n6490a3383f1d0d96c122069e510ef1af1d019fbb is first bad commit\ncommit 6490a3383f1d0d96c122069e510ef1af1d019fbb\nAuthor: Junio C Hamano <gitster@pobox.com>\nDate:   Thu Aug 2 15:10:56 2007 -0700\n\n    Fix work-tree related breakages\n\n    In set_work_tree(), variable rel needs to be reinitialized to\n    NULL on every call (it should not be static).\n\n    Make sure the incoming dir variable is not too long before\n    copying to the temporary buffer, and make sure chdir to the\n    resulting directory succeeds.\n\n    This was spotted and fixed by Alex and Johannes in a handful\n    patch exchanges.  Here is the final version.\n\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n    Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n:100644 100644 3653092ab657942639b6183fb04b3af783b77e7a \n4945eb3134c3e047f54e51db25cd0aa81d9c47d7 M      setup.c\n"},{"id":"49748","messageId":"Pine.LNX.4.64.0708041704040.14781@racer.site","threadId":"9382","inReplyTo":"46B4A2B0.9080208@gmail.com","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T16:04:39Z","receivedAt":"2007-08-04T16:04:39Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 4 Aug 2007, Mark Levedahl wrote:\n\n> git>git bisect good\n\nCould you please\n\n\tGIT_TRACE=1 make quick-install-doc\n\n? It breaks here, too, but because I have no origin/man branch.\n\nCiao,\nDscho\n"},{"id":"49746","messageId":"46B4A47E.5030901@gmail.com","threadId":"9382","inReplyTo":"46B4A2B0.9080208@gmail.com","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-08-04T16:08:30Z","receivedAt":"2007-08-04T16:08:30Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Mark Levedahl wrote:\n> Johannes Schindelin wrote:\n>> Could it be that you did not find this commit by bisecting the \n>> issue?  I highly doubt that said commit changes anything in the build \n>> process.\n>>\n> git>git bisect good\n> 6490a3383f1d0d96c122069e510ef1af1d019fbb is first bad commit\n> commit 6490a3383f1d0d96c122069e510ef1af1d019fbb\n> Author: Junio C Hamano <gitster@pobox.com>\n> Date:   Thu Aug 2 15:10:56 2007 -0700\n>\n>    Fix work-tree related breakages\nSorry - I hit send too fast on the previous mail. The relevant build \nlines are:\n\nGIT_INDEX_FILE=`pwd`/.quick-doc.index\nexport GIT_INDEX_FILE\nrm -f \"$GIT_INDEX_FILE\"\ngit read-tree $head\ngit checkout-index -a -f --prefix=\"$mandir\"/\n\nAfter this commit, git checkout-index does not write the man files into \n$mandir, before this commit, it does.\n\nMark Levedahl\n"},{"id":"49749","messageId":"46B4A5FD.3070107@gmail.com","threadId":"9382","inReplyTo":"Pine.LNX.4.64.0708041704040.14781@racer.site","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-08-04T16:14:53Z","receivedAt":"2007-08-04T16:14:53Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Johannes Schindelin wrote:\n>\n> Could you please\n>\n> \tGIT_TRACE=1 make quick-install-doc\n>\n> ? It breaks here, too, but because I have no origin/man branch.\n>\n> Ciao,\n> Dscho\n>\n>\n>   \ngit>GIT_TRACE=1 make prefix=/usr quick-install-doc\nmake -C Documentation quick-install\nmake[1]: Entering directory `/usr/src/git/Documentation'\nmake -C ../ GIT-VERSION-FILE\nmake[2]: Entering directory `/usr/src/git'\nmake[2]: `GIT-VERSION-FILE' is up to date.\nmake[2]: Leaving directory `/usr/src/git'\nsh ./install-doc-quick.sh origin/man /usr/share/man\ntrace: built-in: git 'rev-parse' '--git-dir'\ntrace: built-in: git 'rev-parse' '--verify' 'origin/man^0'\ntrace: built-in: git 'read-tree' 'origin/man'\ntrace: built-in: git 'checkout-index' '-a' '-f' '--prefix=/usr/share/man/'\nmake[1]: Leaving directory `/usr/src/git/Documentation'\ngit>man git\nNo manual entry for git\ngit>\n\nMark\n"},{"id":"49754","messageId":"Pine.LNX.4.64.0708041715140.14781@racer.site","threadId":"9382","inReplyTo":"46B4A47E.5030901@gmail.com","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T16:16:18Z","receivedAt":"2007-08-04T16:16:18Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 4 Aug 2007, Mark Levedahl wrote:\n\n> git checkout-index -a -f --prefix=\"$mandir\"/\n\nJust to hazard a guess... you see an error message there, such as \"cannot \nchdir to <blablabla>: No such file or directory\"?\n\nIt's kinda hard to debug this with incomplete information.\n\nCiao,\nDscho\n"},{"id":"49752","messageId":"Pine.LNX.4.64.0708041719490.14781@racer.site","threadId":"9382","inReplyTo":"46B4A5FD.3070107@gmail.com","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T16:21:18Z","receivedAt":"2007-08-04T16:21:18Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 4 Aug 2007, Mark Levedahl wrote:\n\n> Johannes Schindelin wrote:\n> > \n> > Could you please\n> > \n> > \tGIT_TRACE=1 make quick-install-doc\n> > \n> > ? It breaks here, too, but because I have no origin/man branch.\n> > \n> > Ciao,\n> > Dscho\n> > \n> > \n> >   \n> git>GIT_TRACE=1 make prefix=/usr quick-install-doc\n> make -C Documentation quick-install\n> make[1]: Entering directory `/usr/src/git/Documentation'\n> make -C ../ GIT-VERSION-FILE\n> make[2]: Entering directory `/usr/src/git'\n> make[2]: `GIT-VERSION-FILE' is up to date.\n> make[2]: Leaving directory `/usr/src/git'\n> sh ./install-doc-quick.sh origin/man /usr/share/man\n> trace: built-in: git 'rev-parse' '--git-dir'\n> trace: built-in: git 'rev-parse' '--verify' 'origin/man^0'\n> trace: built-in: git 'read-tree' 'origin/man'\n> trace: built-in: git 'checkout-index' '-a' '-f' '--prefix=/usr/share/man/'\n> make[1]: Leaving directory `/usr/src/git/Documentation'\n\nAt this point, could you try debugging it?  For example, set a break point \nin set_work_tree(), since that is the only function that commit touches, \nand see what it returns both before and after the bad commit?\n\nCiao,\nDscho\n"},{"id":"49750","messageId":"46B4A8DC.1000504@gmail.com","threadId":"9382","inReplyTo":"Pine.LNX.4.64.0708041715140.14781@racer.site","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-08-04T16:27:08Z","receivedAt":"2007-08-04T16:27:08Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Johannes Schindelin wrote:\n> Hi,\n>\n> On Sat, 4 Aug 2007, Mark Levedahl wrote:\n>\n>   \n>> git checkout-index -a -f --prefix=\"$mandir\"/\n>>     \n>\n> Just to hazard a guess... you see an error message there, such as \"cannot \n> chdir to <blablabla>: No such file or directory\"?\n>\n> It's kinda hard to debug this with incomplete information.\n>\n> Ciao,\n> Dscho\n>\n>\n>   \nNope - no error messages, nada. The trace output I sent you is \nabsolutely uninformative as well. There is absolutely no visible \ndifference between the version where this works (the previous commit) \nand the version where it does not, except that in the latter case the \nfiles are not written out (or at least not to where they should be \nwritten nor to any other place I can find.\n\nIf you have any suggestions on how I can help debug this, I am more than \nwilling but not at all familiar with the internal workings of git.\n\nMark\n"},{"id":"49763","messageId":"46B4BDCF.9060809@gmail.com","threadId":"9382","inReplyTo":"Pine.LNX.4.64.0708041719490.14781@racer.site","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-08-04T17:56:31Z","receivedAt":"2007-08-04T17:56:31Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Johannes Schindelin wrote:\n> At this point, could you try debugging it?  For example, set a break point \n> in set_work_tree(), since that is the only function that commit touches, \n> and see what it returns both before and after the bad commit?\n>\n> Ciao,\n> Dscho\n>\n>\n>   \nBefore the bad commit, set_work_tree returns (null), and\nvariable dir_buffer in the call to get_relative_cwd is \n\"/usr/src/git/.git/HEAD\"\n\nAfter, it returns \"Documentation/\", and\nvariable dir_buffer in the call to get_relative_cwd is \"/usr/src/git\"\n\nI do not understand what the desired changes in this patch were so am \nreally lost as to what should be fixed. However, the above I hope will \ngive you a good clue as to what is broken.\n\nMark\n"},{"id":"49774","messageId":"46B4DF39.2070506@lsrfire.ath.cx","threadId":"9382","inReplyTo":"46B4A2B0.9080208@gmail.com","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2007-08-04T20:19:05Z","receivedAt":"2007-08-04T20:19:05Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Mark Levedahl schrieb:\n> git>git bisect good\n> 6490a3383f1d0d96c122069e510ef1af1d019fbb is first bad commit\n\nI've started a bisect run myself and ended up at a different commit,\nviz. e90fdc39b6903502192b2dd11e5503cea721a1ad (\"Clean up work-tree\nhandling\").  Hmm.  I guess this candidate has a greater chance of\nactually being the culprit than yours. ;-)\n\nI can't offer a fix, but I think I've captured install-doc-quick.sh's\nproblem in a test script (see below).  It fails with e90fdc3 (and\nmaster) but succeeds with e90fdc3^.\n\nApparently checkout-index (and ls-files, but this is not used by the\ninstall script) can now be confused by running it from inside an\nuntracked directory.\n\nJohannes, does this help you in finding out what's going on here?\n\nRené\n\n\ndiff --git a/dev/null b/t/t1502-untracked.sh\nnew file mode 100755\nindex 0000000..3fbdb02\n--- /dev/null\n+++ b/t/t1502-untracked.sh\n@@ -0,0 +1,36 @@\n+#!/bin/sh\n+\n+test_description='accessing the index from an untracked directory'\n+. ./test-lib.sh\n+\n+pwd=$(pwd)\n+GIT_DIR=$pwd/.git\n+export GIT_DIR\n+\n+test_expect_success 'setup' '\n+\tgit init &&\n+\techo some file content >some_file &&\n+\tgit add some_file &&\n+\tgit commit -m \"added a file\" some_file &&\n+\tmkdir untracked\n+'\n+\n+test_expect_success 'test read-tree from an untracked directory' '\n+\t(                GIT_INDEX_FILE=$pwd/idx-a git read-tree HEAD) &&\n+\t(cd untracked && GIT_INDEX_FILE=$pwd/idx-b git read-tree HEAD) &&\n+\tgit diff --binary idx-a idx-b\n+'\n+\n+test_expect_success 'test checkout-index from an untracked directory' '\n+\t(                git checkout-index -a --prefix=$pwd/a/) &&\n+\t(cd untracked && git checkout-index -a --prefix=$pwd/b/) &&\n+\tgit diff a/ b/\n+'\n+\n+test_expect_success 'test ls-files from an untracked directory' '\n+\t(                git ls-files) >ls-files-a &&\n+\t(cd untracked && git ls-files) >ls-files-b &&\n+\tgit diff ls-files-a ls-files-b\n+'\n+\n+test_done\n"},{"id":"49775","messageId":"Pine.LNX.4.64.0708042120320.14781@racer.site","threadId":"9382","inReplyTo":"46B4DF39.2070506@lsrfire.ath.cx","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T20:21:09Z","receivedAt":"2007-08-04T20:21:09Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 4 Aug 2007, Ren? Scharfe wrote:\n\n> Mark Levedahl schrieb:\n> > git>git bisect good\n> > 6490a3383f1d0d96c122069e510ef1af1d019fbb is first bad commit\n> \n> I've started a bisect run myself and ended up at a different commit,\n> viz. e90fdc39b6903502192b2dd11e5503cea721a1ad (\"Clean up work-tree\n> handling\").  Hmm.  I guess this candidate has a greater chance of\n> actually being the culprit than yours. ;-)\n> \n> I can't offer a fix, but I think I've captured install-doc-quick.sh's\n> problem in a test script (see below).  It fails with e90fdc3 (and\n> master) but succeeds with e90fdc3^.\n> \n> Apparently checkout-index (and ls-files, but this is not used by the\n> install script) can now be confused by running it from inside an\n> untracked directory.\n> \n> Johannes, does this help you in finding out what's going on here?\n\nThanks for doing this.  I will work on this in a few minutes; at the \nmoment I am occupied with msysGit...\n\nCiao,\nDscho\n"},{"id":"49778","messageId":"46B4E582.7030200@gmail.com","threadId":"9382","inReplyTo":"46B4DF39.2070506@lsrfire.ath.cx","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-08-04T20:45:54Z","receivedAt":"2007-08-04T20:45:54Z","isPatch":false,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"René Scharfe wrote:\n> Mark Levedahl schrieb:\n>   \n>> git>git bisect good\n>> 6490a3383f1d0d96c122069e510ef1af1d019fbb is first bad commit\n>>     \n>\n> I've started a bisect run myself and ended up at a different commit,\n> viz. e90fdc39b6903502192b2dd11e5503cea721a1ad (\"Clean up work-tree\n> handling\").  Hmm.  I guess this candidate has a greater chance of\n> actually being the culprit than yours. ;-)\n>   \n\nNak - at commit e90fdc... it works fine for me here. However, one \nproblem is the following lines in setup.c/set_work_tree() that appear \nuntil 6490a3\n\n            strncpy(dir_buffer, dir, len - postfix_len);\n\n        /* are we inside the default work tree? */\n        rel = get_relative_cwd(buffer, sizeof(buffer), dir_buffer);\n\nNote that dir_buffer is not null terminated in the above code, that bug \nhas been around for a while, and you certainly could run into a \ndifferent problem than I did as the results are essentially undefined \nhere because of that bug.. The key innovation for the current discussion \nin commit 6490a33 is that dir_buffer is null terminated after the copy, \ncausing a different but repeatable result from get_relative_cwd.\n\nI think this ultimately exposes a bug in \nbuiltin-checkout-index/checkout_all wherein the latter does not \nexplicitly honor the given --prefix option that is passed along in \nstate.  Specifically, on each pass the following test passes\n\n        if (prefix && *prefix &&\n            (ce_namelen(ce) <= prefix_length ||\n             memcmp(prefix, ce->name, prefix_length)))\n            continue;\n\nso the code never attempts to write the file out. I cannot fathom what \nthis test is trying to discern and have to leave it to others more \nfamiliar with the design to figure out the right course. For this \nparticular use, the passed in prefix is irrelevant, the correct path to \nwrite to is in state.\n\nMark\n"},{"id":"49781","messageId":"Pine.LNX.4.64.0708042229130.14781@racer.site","threadId":"9382","inReplyTo":"46B4BDCF.9060809@gmail.com","subject":"[PATCH] Fix quick-install-doc","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T21:32:27Z","receivedAt":"2007-08-04T21:32:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThe recent work-tree cleanups exposed that the install-doc-quick\nscript was relying on a strange behaviour predating the work-tree\nseries: when setting a GIT_DIR, it was assumed that the current\nworking directory is the root of the working tree.\n\nThe recent work-tree series changed that behaviour: now that you can\nset the work tree explicitely, the work tree root defaults to\n$GIT_DIR/.. if $GIT_DIR has a /.git suffix when that is a parent\ndirectory of the current working directory.\n\nNoticed by Mark Levedahl. Diagnosed by Junio Hamano.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tJunio, I did it slightly differently from what I said on IRC: \n\tsetting the work-tree with \"--work-tree\" does not work as \n\texpected.  Will fix.\n\n Documentation/install-doc-quick.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/install-doc-quick.sh b/Documentation/install-doc-quick.sh\nindex e6601bd..5c8b604 100755\n--- a/Documentation/install-doc-quick.sh\n+++ b/Documentation/install-doc-quick.sh\n@@ -19,7 +19,7 @@ GIT_INDEX_FILE=`pwd`/.quick-doc.index\n export GIT_INDEX_FILE\n rm -f \"$GIT_INDEX_FILE\"\n git read-tree $head\n-git checkout-index -a -f --prefix=\"$mandir\"/\n+(cd \"$mandir\"; git checkout-index -a -f)\n \n if test -n \"$GZ\"; then\n \tcd \"$mandir\"\n-- \n1.5.3.rc4.1.g7805\n"},{"id":"49782","messageId":"Pine.LNX.4.64.0708042232390.14781@racer.site","threadId":"9382","inReplyTo":"46B4DF39.2070506@lsrfire.ath.cx","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T21:33:13Z","receivedAt":"2007-08-04T21:33:13Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 4 Aug 2007, Ren? Scharfe wrote:\n\n> I can't offer a fix, but I think I've captured install-doc-quick.sh's\n> problem in a test script (see below).  It fails with e90fdc3 (and\n> master) but succeeds with e90fdc3^.\n\nIt succeeds here... (without the patch I sent out, of course.)\n\nCiao,\nDscho\n"},{"id":"49784","messageId":"46B4F91D.1070907@lsrfire.ath.cx","threadId":"9382","inReplyTo":"Pine.LNX.4.64.0708042229130.14781@racer.site","subject":"Re: [PATCH] Fix quick-install-doc","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2007-08-04T22:09:33Z","receivedAt":"2007-08-04T22:09:33Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Johannes Schindelin schrieb:\n> The recent work-tree cleanups exposed that the install-doc-quick\n> script was relying on a strange behaviour predating the work-tree\n> series: when setting a GIT_DIR, it was assumed that the current\n> working directory is the root of the working tree.\n> \n> The recent work-tree series changed that behaviour: now that you can\n> set the work tree explicitely, the work tree root defaults to\n> $GIT_DIR/.. if $GIT_DIR has a /.git suffix when that is a parent\n> directory of the current working directory.\n\n> -git checkout-index -a -f --prefix=\"$mandir\"/\n> +(cd \"$mandir\"; git checkout-index -a -f)\n\nThat won't work if $mandir doesn't exist, which can happen if you\ninstall the manpages for the first time.  Simply add a mkdir:\n\n   (mkdir -p \"$mandir\" && cd \"$mandir\" && git checkout-index -a -f)\n\nRené\n"},{"id":"49785","messageId":"46B4F923.3090604@lsrfire.ath.cx","threadId":"9382","inReplyTo":"Pine.LNX.4.64.0708042232390.14781@racer.site","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2007-08-04T22:09:39Z","receivedAt":"2007-08-04T22:09:39Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Johannes Schindelin schrieb:\n> Hi,\n> \n> On Sat, 4 Aug 2007, Ren? Scharfe wrote:\n> \n>> I can't offer a fix, but I think I've captured install-doc-quick.sh's\n>> problem in a test script (see below).  It fails with e90fdc3 (and\n>> master) but succeeds with e90fdc3^.\n> \n> It succeeds here... (without the patch I sent out, of course.)\n\nI assume you tested e90fdc3 and e90fdc3^; what about 4f8f03d (current HEAD)?\n\nThanks,\nRené\n"},{"id":"49787","messageId":"Pine.LNX.4.64.0708042321590.14781@racer.site","threadId":"9382","inReplyTo":"46B4F923.3090604@lsrfire.ath.cx","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T22:25:03Z","receivedAt":"2007-08-04T22:25:03Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 5 Aug 2007, Ren? Scharfe wrote:\n\n> Johannes Schindelin schrieb:\n>\n> > On Sat, 4 Aug 2007, Ren? Scharfe wrote:\n> > \n> >> I can't offer a fix, but I think I've captured install-doc-quick.sh's \n> >> problem in a test script (see below).  It fails with e90fdc3 (and \n> >> master) but succeeds with e90fdc3^.\n> > \n> > It succeeds here... (without the patch I sent out, of course.)\n> \n> I assume you tested e90fdc3 and e90fdc3^; what about 4f8f03d (current \n> HEAD)?\n\nI thought I tested on master + --new-workdir... But I did not.\n\nAnd indeed, it fails.\n\nSorry,\nDscho\n"},{"id":"49788","messageId":"Pine.LNX.4.64.0708042328000.14781@racer.site","threadId":"9382","inReplyTo":"46B4F923.3090604@lsrfire.ath.cx","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T22:37:19Z","receivedAt":"2007-08-04T22:37:19Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nyour test script is slightly wrong...\n\nFirst you \"git init\", with GIT_DIR in $(pwd)/.git, i.e. the default.  But \nthen, you need not do this, test scripts are called when git init was \nalready called.\n\nThen you make an untracked directory called untracked/.  Tradition \ndictates that when we're in that directory, we get the prefix \n\"untracked/\", because we might add a file, or reference a file in another \nbranch, where that directory is _not_ untracked.\n\nSo it is expected that checkout-index and ls-files behave differently \nin a subdirectory (even if that is currently untracked).\n\nIt seems a bit counterintuitive that read-tree succeeds, but really, \nread-tree is only a commit -> index operation, which should not care about \nthe current prefix.  So it is fine.\n\nCheckout-index, instead, is an index -> working tree operation, and for \nmost of these, we care about the current prefix (so that you can say git \ncheckout-index file1, where file1 is in the current directory, which is \n_not_ the working tree root).\n\nCiao,\nDscho\n"},{"id":"49791","messageId":"46B505AD.4010009@lsrfire.ath.cx","threadId":"9382","inReplyTo":"Pine.LNX.4.64.0708042328000.14781@racer.site","subject":"Re: rc4 - make quick-install-doc is broken","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2007-08-04T23:03:09Z","receivedAt":"2007-08-04T23:03:09Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Johannes Schindelin schrieb:\n> Then you make an untracked directory called untracked/.  Tradition \n> dictates that when we're in that directory, we get the prefix \n> \"untracked/\", because we might add a file, or reference a file in another \n> branch, where that directory is _not_ untracked.\n\nThe test is modelled after the install script; Documentation/ (the CWD\nduring 'make quick-install-doc') is not tracked in branch origin/man.\n\n> So it is expected that checkout-index and ls-files behave differently \n> in a subdirectory (even if that is currently untracked).\n> \n> It seems a bit counterintuitive that read-tree succeeds, but really, \n> read-tree is only a commit -> index operation, which should not care about \n> the current prefix.  So it is fine.\n> \n> Checkout-index, instead, is an index -> working tree operation, and for \n> most of these, we care about the current prefix (so that you can say git \n> checkout-index file1, where file1 is in the current directory, which is \n> _not_ the working tree root).\n\nOK, makes sense.\n\nThanks,\nRené\n"},{"id":"49831","messageId":"7vmyx6fohv.fsf_-_@assigned-by-dhcp.cox.net","threadId":"9382","inReplyTo":"46B4F91D.1070907@lsrfire.ath.cx","subject":"[PATCH] Fix install-doc-quick target","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-05T07:07:40Z","receivedAt":"2007-08-05T07:07:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The script starts in a subdirectory of the source directory to\nmuck with a branch whose structure does not have anything to\ndo with the actual work tree.  Go up to the top to make it clear\nthat we operate on the whole tree.\n\nIt also exported GIT_DIR without any good reason.  Remove it.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * I am getting the impression that the semantics of the updated\n   work-tree support is as broken as the original, although the\n   code that implements it is easier to read.  \n\n   Admittedly, this is an unorthodox corner case usage, that\n   deals with a tree structure that does not have any relation\n   with the current project state, and the script is started\n   with a subdirectory of the current project.  What is needed\n   is a way to tell git that \"we may be in a subdirectory but\n   the tree structure we are dealing with does not have anything\n   to do with the current work tree structure -- ignore the fact\n   that we are not at the toplevel\", and exporting of GIT_DIR\n   was the way to do so in the old world order.\n\n   Another way to do this in the new world order would be to\n   pass \"--work-tree=.\", but this has its own problems it\n   seems.  You can try commenting out cd_to_toplevel this patch\n   introduces, then rewrite checkout-index part with:\n\n    git --git-dir=\"$GIT_DIR\" --work-tree=. checkout-index -a...\n\n   which seems to work, but if you drop --git-dir=\"$GIT_DIR\"\n   from the above (without reintroducing the export of GIT_DIR),\n   you get \"fatal: Could not switch to '.git'\" which seems quite\n   bogus.  If you say:\n\n\tgit --work-tree=. foo\n\n   without saying anything about GIT_DIR, shouldn't we run the\n   usual .git/ discovery, going up the directories? \n\n Documentation/install-doc-quick.sh |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/install-doc-quick.sh b/Documentation/install-doc-quick.sh\nindex e6601bd..07d227f 100755\n--- a/Documentation/install-doc-quick.sh\n+++ b/Documentation/install-doc-quick.sh\n@@ -7,7 +7,7 @@ mandir=\"$2\"\n SUBDIRECTORY_OK=t\n USAGE='<refname> <target directory>'\n . git-sh-setup\n-export GIT_DIR\n+cd_to_toplevel\n \n test -z \"$mandir\" && usage\n if ! git rev-parse --verify \"$head^0\" >/dev/null; then\n@@ -18,6 +18,8 @@ fi\n GIT_INDEX_FILE=`pwd`/.quick-doc.index\n export GIT_INDEX_FILE\n rm -f \"$GIT_INDEX_FILE\"\n+trap 'rm -f \"$GIT_INDEX_FILE\"' 0\n+\n git read-tree $head\n git checkout-index -a -f --prefix=\"$mandir\"/\n \n-- \n1.5.3.rc4.8.ga120\n"},{"id":"49885","messageId":"Pine.LNX.4.64.0708051344430.14781@racer.site","threadId":"9382","inReplyTo":"7vmyx6fohv.fsf_-_@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fix install-doc-quick target","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-05T13:12:53Z","receivedAt":"2007-08-05T13:12:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 5 Aug 2007, Junio C Hamano wrote:\n\n>  * I am getting the impression that the semantics of the updated\n>    work-tree support is as broken as the original, although the\n>    code that implements it is easier to read.  \n> \n>    Admittedly, this is an unorthodox corner case usage, that\n>    deals with a tree structure that does not have any relation\n>    with the current project state, and the script is started\n>    with a subdirectory of the current project.\n\nI do not like the behaviour \"be stupid and assume cwd to be the working \ntree root, if GIT_DIR is set and GIT_WORK_TREE is not\".\n\nIt bears _all_ kind of stupid connotations.  Just imagine what would \nhappen with \"git --git-dir=. add .\".\n\nIMHO the new behaviour is _better_, since you can not shoot yourself in \nthe foot so easily.  Being able to safeguard against doing a work tree \noperation inside the git directory is a direct and elegant consequence of \ndefaulting to $GIT_DIR/.. in case $GIT_DIR ends in \"/.git\", and no work \ntree if $GIT_DIR does _not_ end in \"/.git\".\n\nThe semantics \"if GIT_DIR is set, just assume the cwd to be the work tree \nroot unilaterally\" is _broken_ as far as I am concerned.\n\nNOTE: this change in semantics will _only_ _ever_ burn you if you set \nGIT_DIR, but not GIT_WORK_TREE, in a _subdirectory_ of $GIT_DIR/.. (if it \nends in /.git, and $GIT_DIR otherwise).\n\nSo the _common_ use of setting GIT_DIR, namely something like\n\n\t$ git --git-dir=/some/where/completely/different bla\n\nis _not_ affected.\n\nSo I really think that the code in install-doc-quick.sh is not only ugly, \nbut also wrong.  It sets the GIT_DIR to _the same_ value as the default, \nto change git's idea of the _work tree_!  All at the same time as it is \nutterly clear that it wants to write to $HOME/share/man, but it does not \nmake this its working tree.  No, sir.  It has to play cute games with the \nprefix.\n\nHowever, you are the maintainer, and it is your decision.  If you want the \nold semantics (without sanity checks for work-tree operations inside the \ngit directory), here is a patch.  I don't like it, but if you take it, \nI'll learn to live with it.\n\nCiao,\nDscho\n\n-- snipsnap --\nReinstate the old behaviour when GIT_DIR is set and GIT_WORK_TREE is unset\n\nThe old behaviour was to unilaterally default to the cwd is the work tree \nwhen GIT_DIR was set, but GIT_WORK_TREE wasn't, no matter if we are inside \nthe GIT_DIR, or if GIT_DIR is actually something like ../../../.git.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n\tFeel free to change the commit message.\n\n setup.c |   50 +++++++++-----------------------------------------\n 1 files changed, 9 insertions(+), 41 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex 4945eb3..7bcf4eb 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -189,53 +189,21 @@ int is_inside_work_tree(void)\n }\n \n /*\n- * If no worktree was given, and we are outside of a default work tree,\n- * now is the time to set it.\n- *\n- * In other words, if the user calls git with something like\n- *\n- *\tgit --git-dir=/some/where/else/.git bla\n- *\n- * default to /some/where/else as working directory; if the specified\n- * git-dir does not end in \"/.git\", the cwd is used as working directory.\n+ * set_work_tree() is only ever called if you set GIT_DIR explicitely.\n+ * The old behaviour (which we retain here) is to set the work tree root\n+ * to the cwd, unless overridden by the config, the command line, or\n+ * GIT_WORK_TREE.\n  */\n const char *set_work_tree(const char *dir)\n {\n-\tchar dir_buffer[PATH_MAX], *rel = NULL;\n-\tstatic char buffer[PATH_MAX + 1];\n-\tint len, suffix_len = strlen(DEFAULT_GIT_DIR_ENVIRONMENT) + 1;\n-\n-\t/* strip the variable 'dir' of the postfix \"/.git\" if it has it */\n-\tlen = strlen(dir);\n-\tif (len > suffix_len &&\n-\t    !strcmp(dir + len - suffix_len, \"/\" DEFAULT_GIT_DIR_ENVIRONMENT)) {\n-\t\tif ((len - suffix_len) >= sizeof(dir_buffer))\n-\t\t\tdie(\"directory name too long\");\n-\t\tmemcpy(dir_buffer, dir, len - suffix_len);\n-\t\tdir_buffer[len - suffix_len] = '\\0';\n-\n-\t\t/* are we inside the default work tree? */\n-\t\trel = get_relative_cwd(buffer, sizeof(buffer), dir_buffer);\n-\t}\n+\tchar buffer[PATH_MAX + 1];\n \n-\t/* if rel is set, the cwd is _not_ the current working tree */\n-\tif (rel && *rel) {\n-\t\tif (!is_absolute_path(dir))\n-\t\t\tset_git_dir(make_absolute_path(dir));\n-\t\tdir = dir_buffer;\n-\t\tif (chdir(dir))\n-\t\t\tdie(\"cannot chdir to %s: %s\", dir, strerror(errno));\n-\t\telse\n-\t\t\tstrcat(rel, \"/\");\n-\t\tinside_git_dir = 0;\n-\t} else {\n-\t\trel = NULL;\n-\t\tdir = getcwd(buffer, sizeof(buffer));\n-\t}\n-\tgit_work_tree_cfg = xstrdup(dir);\n+\tif (!getcwd(buffer, sizeof(buffer)))\n+\t\tdie (\"Could not get the current working directory\");\n+\tgit_work_tree_cfg = xstrdup(buffer);\n \tinside_work_tree = 1;\n \n-\treturn rel;\n+\treturn NULL;\n }\n \n /*\n"},{"id":"49897","messageId":"Pine.LNX.4.64.0708051533590.14781@racer.site","threadId":"9382","inReplyTo":"7vmyx6fohv.fsf_-_@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fix install-doc-quick target","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-05T14:44:02Z","receivedAt":"2007-08-05T14:44:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 5 Aug 2007, Junio C Hamano wrote:\n\n>    If you say:\n> \n> \tgit --work-tree=. foo\n> \n>    without saying anything about GIT_DIR, shouldn't we run the\n>    usual .git/ discovery, going up the directories? \n\nWell, it seems natural.\n\nThe problem is that if you are in a bare repository, after \nsetup_git_directory_gently() you will no longer be able to tell where you \nstarted from, but you are in the same directory that HEAD was found.\n\nI had the following patch, but it breaks all kinds of tests :-(\n\nWill keep you posted,\nDscho\n\n-- snipsnap --\n\n setup.c |    8 +++++---\n 1 files changed, 5 insertions(+), 3 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex d87e4e1..c627623 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -291,7 +291,7 @@ const char *setup_git_directory_gently(int *nongit_ok)\n \t\t\tif (!work_tree_env)\n \t\t\t\tinside_work_tree = 0;\n \t\t\tsetenv(GIT_DIR_ENVIRONMENT, \".\", 1);\n-\t\t\treturn NULL;\n+\t\t\tgoto ret;\n \t\t}\n \t\tchdir(\"..\");\n \t\tdo {\n@@ -311,6 +311,7 @@ const char *setup_git_directory_gently(int *nongit_ok)\n \tif (!work_tree_env)\n \t\tinside_work_tree = 1;\n \tgit_work_tree_cfg = xstrndup(cwd, offset);\n+ret:\n \tif (offset == len)\n \t\treturn NULL;\n \n@@ -376,14 +377,15 @@ const char *setup_git_directory(void)\n \t/* If the work tree is not the default one, recompute prefix */\n \tif (inside_work_tree < 0) {\n \t\tstatic char buffer[PATH_MAX + 1];\n+\t\tconst char *git_dir = get_git_dir();\n \t\tchar *rel;\n \n \t\t/*\n \t\t * When the git dir was determined automatically, it is\n \t\t * a relative path.\n \t\t */\n-\t\tif (!getenv(GIT_DIR_ENVIRONMENT))\n-\t\t\tset_git_dir(make_absolute_path(get_git_dir()));\n+\t\tif (!is_absolute_path(git_dir))\n+\t\t\tset_git_dir(make_absolute_path(git_dir));\n \n \t\tif (retval && chdir(retval))\n \t\t\tdie (\"Could not jump back into original cwd\");\n"},{"id":"49919","messageId":"7vzm15eukf.fsf@assigned-by-dhcp.cox.net","threadId":"9382","inReplyTo":"Pine.LNX.4.64.0708051344430.14781@racer.site","subject":"Re: [PATCH] Fix install-doc-quick target","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-05T17:54:08Z","receivedAt":"2007-08-05T17:54:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> I do not like the behaviour \"be stupid and assume cwd to be the working \n> tree root, if GIT_DIR is set and GIT_WORK_TREE is not\".\n>\n> It bears _all_ kind of stupid connotations.  Just imagine what would \n> happen with \"git --git-dir=. add .\".\n>\n> IMHO the new behaviour is _better_, since you can not shoot yourself in \n> the foot so easily.  Being able to safeguard against doing a work tree \n> operation inside the git directory is a direct and elegant consequence of \n> defaulting to $GIT_DIR/.. in case $GIT_DIR ends in \"/.git\", and no work \n> tree if $GIT_DIR does _not_ end in \"/.git\".\n>\n> The semantics \"if GIT_DIR is set, just assume the cwd to be the work tree \n> root unilaterally\" is _broken_ as far as I am concerned.\n\nI am not disputing that.  I was just pointing out that this is a\nchange in semantics and we need to advertise it as such, and\nmore importantly, advise people how to adjust to the new (and\nimproved) world order.\n"},{"id":"49921","messageId":"Pine.LNX.4.64.0708051909300.14781@racer.site","threadId":"9382","inReplyTo":"7vzm15eukf.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fix install-doc-quick target","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-05T18:10:24Z","receivedAt":"2007-08-05T18:10:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 5 Aug 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > I do not like the behaviour \"be stupid and assume cwd to be the working \n> > tree root, if GIT_DIR is set and GIT_WORK_TREE is not\".\n> >\n> > It bears _all_ kind of stupid connotations.  Just imagine what would \n> > happen with \"git --git-dir=. add .\".\n> >\n> > IMHO the new behaviour is _better_, since you can not shoot yourself in \n> > the foot so easily.  Being able to safeguard against doing a work tree \n> > operation inside the git directory is a direct and elegant consequence of \n> > defaulting to $GIT_DIR/.. in case $GIT_DIR ends in \"/.git\", and no work \n> > tree if $GIT_DIR does _not_ end in \"/.git\".\n> >\n> > The semantics \"if GIT_DIR is set, just assume the cwd to be the work tree \n> > root unilaterally\" is _broken_ as far as I am concerned.\n> \n> I am not disputing that.  I was just pointing out that this is a\n> change in semantics and we need to advertise it as such, and\n> more importantly, advise people how to adjust to the new (and\n> improved) world order.\n\nThanks.  I will prepare a patch to ReleaseNotes, but that'll have to wait \nuntil tomorrow.  I'm pretty exhausted after the last night of msysGit \nhacking.\n\nCiao,\nDscho\n"},{"id":"50050","messageId":"11864401942772-git-send-email-mdl123@verizon.net","threadId":"9382","inReplyTo":"7vmyx6fohv.fsf_-_@assigned-by-dhcp.cox.net","subject":"[PATCH] (Really) Fix install-doc-quick target","fromName":"Mark Levedahl","fromEmail":"mdl123@verizon.net","sentAt":"2007-08-06T22:43:14Z","receivedAt":"2007-08-06T22:43:14Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Commit 00d8c51 caused git-ls-tree to be invoked from a directory where\nGIT_DIR cannot be found and without that variable being set.\n\nSigned-off-by: Mark Levedahl <mdl123@verizon.net>\n---\n Documentation/install-doc-quick.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/install-doc-quick.sh b/Documentation/install-doc-quick.sh\nindex 07d227f..a0164fb 100755\n--- a/Documentation/install-doc-quick.sh\n+++ b/Documentation/install-doc-quick.sh\n@@ -25,7 +25,7 @@ git checkout-index -a -f --prefix=\"$mandir\"/\n \n if test -n \"$GZ\"; then\n \tcd \"$mandir\"\n-\tfor i in `git ls-tree -r --name-only $head`\n+\tfor i in `git --git-dir=\"$GIT_DIR\" ls-tree -r --name-only $head`\n \tdo\n \t\tgzip < $i > $i.gz && rm $i\n \tdone\n-- \n1.5.3.rc4.5.g4f0b5\n"},{"id":"50054","messageId":"Pine.LNX.4.64.0708062349460.14781@racer.site","threadId":"9382","inReplyTo":"11864401942772-git-send-email-mdl123@verizon.net","subject":"Re: [PATCH] (Really) Fix install-doc-quick target","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-06T22:50:21Z","receivedAt":"2007-08-06T22:50:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 6 Aug 2007, Mark Levedahl wrote:\n\n> -\tfor i in `git ls-tree -r --name-only $head`\n> +\tfor i in `git --git-dir=\"$GIT_DIR\" ls-tree -r --name-only $head`\n\nThis awfully looks like hiding a bug.  It should _never_ be necessary to \nsay '--git-dir=\"$GIT_DIR\"'.\n\nCiao,\nDscho\n"},{"id":"50055","messageId":"7vzm149s8s.fsf@assigned-by-dhcp.cox.net","threadId":"9382","inReplyTo":"Pine.LNX.4.64.0708062349460.14781@racer.site","subject":"Re: [PATCH] (Really) Fix install-doc-quick target","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-06T23:07:47Z","receivedAt":"2007-08-06T23:07:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Mon, 6 Aug 2007, Mark Levedahl wrote:\n>\n>> -\tfor i in `git ls-tree -r --name-only $head`\n>> +\tfor i in `git --git-dir=\"$GIT_DIR\" ls-tree -r --name-only $head`\n>\n> This awfully looks like hiding a bug.  It should _never_ be necessary to \n> say '--git-dir=\"$GIT_DIR\"'.\n\nYes.  And 00d8c51 obviously \"works for me\", so there is\nsomething different between what Mark and I are doing.  I cannot\ntell what it is.\n"},{"id":"50059","messageId":"46B7B10F.4060402@gmail.com","threadId":"9382","inReplyTo":"7vzm149s8s.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] (Really) Fix install-doc-quick target","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-08-06T23:38:55Z","receivedAt":"2007-08-06T23:38:55Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Junio C Hamano wrote:\n> Yes.  And 00d8c51 obviously \"works for me\", so there is\n> something different between what Mark and I are doing.  I cannot\n> tell what it is.\n>   \nGZ=1 make quick-install-doc\n\n...fails because git-ls-tree is called when cwd=$mandir which is nowhere \nunder or related to $GIT_DIR.\n\nMark\n"},{"id":"50060","messageId":"Pine.LNX.4.64.0708070042450.14781@racer.site","threadId":"9382","inReplyTo":"46B7B10F.4060402@gmail.com","subject":"Re: [PATCH] (Really) Fix install-doc-quick target","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-06T23:43:12Z","receivedAt":"2007-08-06T23:43:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 6 Aug 2007, Mark Levedahl wrote:\n\n> Junio C Hamano wrote:\n> > Yes.  And 00d8c51 obviously \"works for me\", so there is\n> > something different between what Mark and I are doing.  I cannot\n> > tell what it is.\n> >   \n> GZ=1 make quick-install-doc\n> \n> ...fails because git-ls-tree is called when cwd=$mandir which is nowhere under\n> or related to $GIT_DIR.\n\nAh, I suspect you do not have the latest 'master' installed?\n\nCiao,\nDscho\n"},{"id":"50061","messageId":"46B7B374.4010304@gmail.com","threadId":"9382","inReplyTo":"Pine.LNX.4.64.0708070042450.14781@racer.site","subject":"Re: [PATCH] (Really) Fix install-doc-quick target","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-08-06T23:49:08Z","receivedAt":"2007-08-06T23:49:08Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Johannes Schindelin wrote:\n> Ah, I suspect you do not have the latest 'master' installed?\n>\n> Ciao,\n> Dscho\n>\n>   \ngit>git fetch origin\ngit>git show-ref origin/master\na76c2acb28146f5630592f2ba738c0ebf0f3c1c4 refs/remotes/origin/master\ngit>git checkout -b test origin/master\nBranch test set up to track remote branch refs/remotes/origin/master.\nSwitched to a new branch \"test\"\ngit>GZ=1 make prefix=/usr quick-install-doc\nGIT_VERSION = 1.5.3.rc4.16.ga76c2\nmake -C Documentation quick-install\nmake[1]: Entering directory `/usr/src/git/Documentation'\nrm -f doc.dep+ doc.dep\nperl ./build-docdep.perl >doc.dep+\nmv doc.dep+ doc.dep\nmake -C ../ GIT-VERSION-FILE\nmake[2]: Entering directory `/usr/src/git'\nmake[2]: `GIT-VERSION-FILE' is up to date.\nmake[2]: Leaving directory `/usr/src/git'\nmake[1]: Leaving directory `/usr/src/git/Documentation'\nmake[1]: Entering directory `/usr/src/git/Documentation'\nmake -C ../ GIT-VERSION-FILE\nmake[2]: Entering directory `/usr/src/git'\nmake[2]: `GIT-VERSION-FILE' is up to date.\nmake[2]: Leaving directory `/usr/src/git'\nsh ./install-doc-quick.sh origin/man /usr/share/man\nfatal: Not a git repository\nmake[1]: Leaving directory `/usr/src/git/Documentation'\ngit>\n"},{"id":"50065","messageId":"7vhcnc9lpm.fsf@assigned-by-dhcp.cox.net","threadId":"9382","inReplyTo":"46B7B10F.4060402@gmail.com","subject":"Re: [PATCH] (Really) Fix install-doc-quick target","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-07T01:28:53Z","receivedAt":"2007-08-07T01:28:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Levedahl <mlevedahl@gmail.com> writes:\n\n> Junio C Hamano wrote:\n>> Yes.  And 00d8c51 obviously \"works for me\", so there is\n>> something different between what Mark and I are doing.  I cannot\n>> tell what it is.\n>>\n> GZ=1 make quick-install-doc\n>\n> ...fails because git-ls-tree is called when cwd=$mandir which is\n> nowhere under or related to $GIT_DIR.\n\nOops.  I am blind.  That's right.  That command does a chdir on\nits own.\n\nHow does this sound?\n\n---\ndiff --git a/Documentation/install-doc-quick.sh b/Documentation/install-doc-quick.sh\nindex 07d227f..bc170f0 100755\n--- a/Documentation/install-doc-quick.sh\n+++ b/Documentation/install-doc-quick.sh\n@@ -24,10 +24,10 @@ git read-tree $head\n git checkout-index -a -f --prefix=\"$mandir\"/\n \n if test -n \"$GZ\"; then\n-\tcd \"$mandir\"\n-\tfor i in `git ls-tree -r --name-only $head`\n+\tgit ls-tree -r --name-only $head |\n+\twhile read path\n \tdo\n-\t\tgzip < $i > $i.gz && rm $i\n+\t\tgzip \"$mandir/$path\"\n \tdone\n fi\n rm -f \"$GIT_INDEX_FILE\"\n"},{"id":"50068","messageId":"46B7D108.20606@gmail.com","threadId":"9382","inReplyTo":"7vhcnc9lpm.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] (Really) Fix install-doc-quick target","fromName":"Mark Levedahl","fromEmail":"mlevedahl@gmail.com","sentAt":"2007-08-07T01:55:20Z","receivedAt":"2007-08-07T01:55:20Z","isPatch":true,"sender":{"key":"mdl123@verizon.net","avatar":"https://avatars.githubusercontent.com/u/5302462?v=4"},"body":"Subject:   Re: [PATCH] (Really) Fix install-doc-quick target\nTo:        Junio C Hamano <gitster@pobox.com>\nCc:        Johannes Schindelin <Johannes.Schindelin@gmx.de>,Mark \nLevedahl <mdl123@verizon.net>,Git Mailing List <git@vger.kernel.org>,Ren \nScharfe <rene.scharfe@lsrfire.ath.cx>\nBcc:\nReply-To:\nNewsgroup:\n-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-\nJunio C Hamano wrote:\n > Mark Levedahl <mlevedahl@gmail.com> writes:\n >\n >\n > How does this sound?\n >\n > ---\n > diff --git a/Documentation/install-doc-quick.sh \nb/Documentation/install-doc-quick.sh\n > index 07d227f..bc170f0 100755\n > --- a/Documentation/install-doc-quick.sh\n > +++ b/Documentation/install-doc-quick.sh\n > @@ -24,10 +24,10 @@ git read-tree $head\n >  git checkout-index -a -f --prefix=\"$mandir\"/\n >\n >  if test -n \"$GZ\"; then\n > -    cd \"$mandir\"\n > -    for i in `git ls-tree -r --name-only $head`\n > +    git ls-tree -r --name-only $head |\n > +    while read path\n >      do\n > -        gzip < $i > $i.gz && rm $i\n > +        gzip \"$mandir/$path\"\n >      done\n >  fi\n >  rm -f \"$GIT_INDEX_FILE\"\n >\n >\n\nMaybe this instead, many fewer gzip invocations, happily overwrites the \nold man pages already installed...\n\n---\ndiff --git a/Documentation/install-doc-quick.sh \nb/Documentation/install-doc-quick.sh\nindex 07d227f..45f78fa 100755\n--- a/Documentation/install-doc-quick.sh\n+++ b/Documentation/install-doc-quick.sh\n@@ -24,10 +24,6 @@ git read-tree $head\n git checkout-index -a -f --prefix=\"$mandir\"/\n\n if test -n \"$GZ\"; then\n-    cd \"$mandir\"\n-    for i in `git ls-tree -r --name-only $head`\n-    do\n-        gzip < $i > $i.gz && rm $i\n-    done\n+    printf \"$mandir/%s\\n\" $(git ls-tree -r --name-only $head) | xargs \ngzip -f\n fi\n rm -f \"$GIT_INDEX_FILE\"\n"},{"id":"50084","messageId":"7vd4y09f07.fsf@assigned-by-dhcp.cox.net","threadId":"9382","inReplyTo":"46B7D108.20606@gmail.com","subject":"Re: [PATCH] (Really) Fix install-doc-quick target","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-07T03:53:44Z","receivedAt":"2007-08-07T03:53:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Levedahl <mlevedahl@gmail.com> writes:\n\n> +    printf \"$mandir/%s\\n\" $(git ls-tree -r --name-only $head) | xargs\n> gzip -f\n\nNo risk that ls-tree output is too long to fit within the exec\nargs limit to run printf?\n"},{"id":"50128","messageId":"46B879DB.4090504@lsrfire.ath.cx","threadId":"9382","inReplyTo":"7vd4y09f07.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] (Really) Fix install-doc-quick target","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2007-08-07T13:55:39Z","receivedAt":"2007-08-07T13:55:39Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Junio C Hamano schrieb:\n> Mark Levedahl <mlevedahl@gmail.com> writes:\n> \n>> +    printf \"$mandir/%s\\n\" $(git ls-tree -r --name-only $head) | xargs\n>> gzip -f\n> \n> No risk that ls-tree output is too long to fit within the exec\n> args limit to run printf?\n\nPerhaps this instead?\n\n   git ls-tree -r --name-only $head | (cd \"$mandir\" && xargs gzip -f)\n\nRené\n"},{"id":"50130","messageId":"Pine.LNX.4.64.0708071507410.14781@racer.site","threadId":"9382","inReplyTo":"46B879DB.4090504@lsrfire.ath.cx","subject":"Re: [PATCH] (Really) Fix install-doc-quick target","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-07T14:08:43Z","receivedAt":"2007-08-07T14:08:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 7 Aug 2007, Ren? Scharfe wrote:\n\n> Junio C Hamano schrieb:\n> > Mark Levedahl <mlevedahl@gmail.com> writes:\n> > \n> >> +    printf \"$mandir/%s\\n\" $(git ls-tree -r --name-only $head) | xargs\n> >> gzip -f\n> > \n> > No risk that ls-tree output is too long to fit within the exec\n> > args limit to run printf?\n> \n> Perhaps this instead?\n> \n>    git ls-tree -r --name-only $head | (cd \"$mandir\" && xargs gzip -f)\n\nI would have done\n\n\tgit ls-tree -r --name-only $head | sed \"s|^|$mandir|\" | xargs gzip -f\n\nbut I like your version better.\n\nThanks for teaching me,\nDscho\n"}]}