{"thread":{"id":"276","subject":"[ANNOUNCE] git-pasky-0.7","startedAt":"2005-04-24T00:59:23Z","lastAt":"2005-04-24T10:52:48Z","messageCount":17,"participants":["Petr Baudis","Martin Schlemmer","Linus Torvalds","Paul Jackson","James Purser","Daniel Barkalow","Greg KH","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"1453","messageId":"20050424005923.GA8859@pasky.ji.cz","threadId":"276","inReplyTo":null,"subject":"[ANNOUNCE] git-pasky-0.7","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-24T00:59:23Z","receivedAt":"2005-04-24T00:59:23Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hello,\n\n  this is the last release of git-pasky, my SCMish layer over Linus' git\ntree history storage tool. The next releases will be called 'cogito' and\nwill feature a significantly reworked user interface (finally). Get\ngit-pasky-0.7 at\n\n\thttp://www.kernel.org/pub/software/scm/cogito\n\nor\n\n\tftp://ftp.kernel.org/pub/software/scm/cogito\n\n  You can also pull, but actually you might as well not want to do that\nif you don't know that you will be able to recover possible\ninconsistencies (for no local changes, read-tree $(tree-id) &&\ncheckout-cache -f -a && update-cache --refresh should do). The\npulling/merging tools in older versions contain bugs which _might_\naffect this pull.\n\n  The biggest change is in the way the directory cache is used (this is\ninternal thing, nothing user-visible except less bugs). Now that we have\ndiff-cache, git-pasky uses that instead of show-diff, and drops the\nadd/rm queues. This also makes the diffs coming from git diff more\nconsistent-looking.\n\n  To pick randomly from the other changes - older zlib compatibility,\nalways use bash, git patch output changes/fixes, git log timezone fix,\nplenty of bugfixes and of course merges with Linus. Thanks to all the\ncontributors!\n\n  Have fun,\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"1457","messageId":"1114306009.27940.23.camel@nosferatu.lan","threadId":"276","inReplyTo":"20050424005923.GA8859@pasky.ji.cz","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Martin Schlemmer","fromEmail":"azarah@nosferatu.za.org","sentAt":"2005-04-24T01:26:49Z","receivedAt":"2005-04-24T01:26:49Z","isPatch":false,"sender":{"key":"azarah@nosferatu.za.org","avatar":null},"body":"On Sun, 2005-04-24 at 02:59 +0200, Petr Baudis wrote:\n>   Hello,\n> \n>   this is the last release of git-pasky, my SCMish layer over Linus' git\n> tree history storage tool. The next releases will be called 'cogito' and\n> will feature a significantly reworked user interface (finally). Get\n> git-pasky-0.7 at\n> \n\nOver here gitmerge-file.sh is looking for a 'merge' command not present.\n\n\nCheers,\n\n-- \nMartin Schlemmer\n\n"},{"id":"1474","messageId":"Pine.LNX.4.58.0504232044040.2344@ppc970.osdl.org","threadId":"276","inReplyTo":"1114306009.27940.23.camel@nosferatu.lan","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-04-24T03:45:35Z","receivedAt":"2005-04-24T03:45:35Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 24 Apr 2005, Martin Schlemmer wrote:\n> \n> Over here gitmerge-file.sh is looking for a 'merge' command not present.\n\nIt's usually packaged up with RCS. So in that sense git does need RCS,\nalthough it's really only the traditional three-way merge program it\nwants.\n\nDo \"yum install rcs\" and you should get it (or whatever your local \nalternative is).\n\n\t\tLinus\n"},{"id":"1476","messageId":"20050423205847.7758bfaa.pj@sgi.com","threadId":"276","inReplyTo":"20050424005923.GA8859@pasky.ji.cz","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Paul Jackson","fromEmail":"pj@sgi.com","sentAt":"2005-04-24T03:58:47Z","receivedAt":"2005-04-24T03:58:47Z","isPatch":false,"sender":{"key":"pj@sgi.com","avatar":null},"body":"I'm missing something here (well, missing alot, but ...).\n\nWhat are the exact steps, given that I have an empty chunk\nof diskspace, to get Linux 2.6.12-rc3 to appear there, using\ngit.\n\nActually, I got part way.  Perhaps someone can complete\nthe following:\n\n    mkdir git\n    cd git\n    curl -O ftp://ftp.kernel.org/pub/software/scm/cogito/git-pasky-0.6.3.tar.bz2\n    tar xvfj git-pasky-0.6.3.tar.bz2\n    cd git-pasky-0.6.3\n    ls -l /usr/local/include/openssl/sha.h\t # yup - I have openssl header\n    make\n    ./git init rsync://rsync.kernel.org/pub/scm/cogito/cogito.git\n    make install\n    git addremote pasky rsync://rsync.kernel.org/pub/scm/cogito/cogito.git\n    git pull pasky\n    git addremote linus rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n    git pull linus\n\nAnd I have the SHA1 for Linus's 2.6.12-rc3:\n\n    a2755a80f40e5794ddc20e00f781af9d6320fafb\n\nAnd I've set DB_ENVIRONMENT=<this-git-directory>/.git/objects\n\nNow I'd like to get 2.6.12-rc3 working kernel files to appear\nin a separate directory.\n\nNow what ... how do I do that?\n\n-- \n                  I won't rest till it's the best ...\n                  Programmer, Linux Scalability\n                  Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401\n"},{"id":"1477","messageId":"1114316259.25535.4.camel@kryten","threadId":"276","inReplyTo":"20050423205847.7758bfaa.pj@sgi.com","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"James Purser","fromEmail":"purserj@ksit.dynalias.com","sentAt":"2005-04-24T04:17:40Z","receivedAt":"2005-04-24T04:17:40Z","isPatch":false,"sender":{"key":"purserj@ksit.dynalias.com","avatar":null},"body":"Try separating out the git directory and linux directory. As I\nunderstand it each project/git repo needs its own directory.\n-- \nJames Purser\nhttp://ksit.dynalias.com\n\n"},{"id":"1479","messageId":"Pine.LNX.4.21.0504240018350.30848-100000@iabervon.org","threadId":"276","inReplyTo":"20050423205847.7758bfaa.pj@sgi.com","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-04-24T04:32:14Z","receivedAt":"2005-04-24T04:32:14Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sat, 23 Apr 2005, Paul Jackson wrote:\n\n> I'm missing something here (well, missing alot, but ...).\n> \n> What are the exact steps, given that I have an empty chunk\n> of diskspace, to get Linux 2.6.12-rc3 to appear there, using\n> git.\n> \n> Actually, I got part way.  Perhaps someone can complete\n> the following:\n> \n>     mkdir git\n>     cd git\n>     curl -O ftp://ftp.kernel.org/pub/software/scm/cogito/git-pasky-0.6.3.tar.bz2\n>     tar xvfj git-pasky-0.6.3.tar.bz2\n>     cd git-pasky-0.6.3\n>     ls -l /usr/local/include/openssl/sha.h\t # yup - I have openssl header\n>     make\n>     ./git init rsync://rsync.kernel.org/pub/scm/cogito/cogito.git\n>     make install\n>     git addremote pasky rsync://rsync.kernel.org/pub/scm/cogito/cogito.git\n>     git pull pasky\n\nYou might need a \"git seek\" or a \"git cancel\" or a \"git track\npasky\" here; make sure that VERSION is 0.7.\n\nThen do make install again (to install the 0.7 version that you just got).\n\nThen you want to go into the directory you want linux in:\n\n  cd ..\n  mkdir linux\n  cd linux\n\nAnd get a version of Linux:\n\n  git init linus rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n\n(IIRC; I've only really worked on git with git)\n\nIf you do another addremote in the git directory, it will think that both\nremote repositories are for different versions of the same project, and it\nwill be unhappy with the fact that they are completely unrelated.\n\n\t-Daniel\n*This .sig left intentionally blank*\n\n"},{"id":"1481","messageId":"20050423213557.475e0dfe.pj@sgi.com","threadId":"276","inReplyTo":"1114316259.25535.4.camel@kryten","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Paul Jackson","fromEmail":"pj@sgi.com","sentAt":"2005-04-24T04:35:57Z","receivedAt":"2005-04-24T04:35:57Z","isPatch":false,"sender":{"key":"pj@sgi.com","avatar":null},"body":"James wrote:\n> Try separating out the git directory and linux directory. As I\n> understand it each project/git repo needs its own directory.\n\nI'm willing to do that - but I still don't get what I actually type.\n\nI just tried:\n\n    mkdir linux\n    cd linux\n    git init\n\n    git addremote linus rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n    # The above complained:\n    #\tgrep: .git/remotes: No such file or directory\n    # but still seemed to work ?\n\n    git pull linus\t# seems to get the same files I pulled before ... ok.\n    # The above complained:\n    #\tclient: nothing to do: perhaps you need to specify some filenames or the --recursive option?\n\n\nNow what?  I still don't have the working source files for a kernel,\nand I don't see how to specify in particular whatever Linus meant by\n\n\ta2755a80f40e5794ddc20e00f781af9d6320fafb\n\nI issued a 'git --help' command (yeah - git is different - should be 'git help')\nbut I don't see any command that looks like it would checkout the working files.\n\n-- \n                  I won't rest till it's the best ...\n                  Programmer, Linux Scalability\n                  Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401\n"},{"id":"1484","messageId":"20050423215007.1b2877d2.pj@sgi.com","threadId":"276","inReplyTo":"Pine.LNX.4.21.0504240018350.30848-100000@iabervon.org","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Paul Jackson","fromEmail":"pj@sgi.com","sentAt":"2005-04-24T04:50:07Z","receivedAt":"2005-04-24T04:50:07Z","isPatch":false,"sender":{"key":"pj@sgi.com","avatar":null},"body":"Daniel wrote:\n> You might need a \"git seek\" or a \"git cancel\" or a \"git track\n> pasky\" here; make sure that VERSION is 0.7.\n\nOk - I typed some random combination of \"git seek\", \"git cancel\" and\n\"git track pasky\" and now I have a file named VERSION containing the\nstring \"0.7\\n\", and I did a make install, with apparently useful\nresults (built and installed a bunch of stuff).\n\nThen I did the following, with immediate, but not apparently useful, results:\n\n    $ rm -fr linux\n    $ mkdir linux\n    $ cd linux\n    $ git init linus rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n    defaulting to local storage area\n    link_stat linus/HEAD : No such file or directory\n    rsync error: some files could not be transferred (code 23) at main.c(620)\n    gitpull.sh: unable to get the head pointer of branch master\n    gitinit.sh: pull failed\n\nStill stuck ...\n\n-- \n                  I won't rest till it's the best ...\n                  Programmer, Linux Scalability\n                  Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401\n"},{"id":"1486","messageId":"1114318722.25535.9.camel@kryten","threadId":"276","inReplyTo":"20050423215007.1b2877d2.pj@sgi.com","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"James Purser","fromEmail":"purserj@ksit.dynalias.com","sentAt":"2005-04-24T04:58:42Z","receivedAt":"2005-04-24T04:58:42Z","isPatch":false,"sender":{"key":"purserj@ksit.dynalias.com","avatar":null},"body":"try git init rsync://rsync.kernel.org/pub/linux/kernel/people/torvalds/linux-2.6.git\n-- \nJames Purser\nhttp://ksit.dynalias.com\n\n"},{"id":"1488","messageId":"20050423220236.26f834ee.pj@sgi.com","threadId":"276","inReplyTo":"Pine.LNX.4.21.0504240018350.30848-100000@iabervon.org","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Paul Jackson","fromEmail":"pj@sgi.com","sentAt":"2005-04-24T05:02:36Z","receivedAt":"2005-04-24T05:02:36Z","isPatch":false,"sender":{"key":"pj@sgi.com","avatar":null},"body":"The winning solution via private email:\n\n\tmkdir linux\n\tcd linux\n\tgit init rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n\nAnother email was missing the 'scm' term.\n\nI still don't see how to get to the official 2.6.12-rc3:\n\n\ta2755a80f40e5794ddc20e00f781af9d6320fafb\n\nBut it looks like a kernel now - thanks !!\n\n-- \n                  I won't rest till it's the best ...\n                  Programmer, Linux Scalability\n                  Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401\n"},{"id":"1492","messageId":"20050424051130.GA25332@kroah.com","threadId":"276","inReplyTo":"20050423220236.26f834ee.pj@sgi.com","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Greg KH","fromEmail":"greg@kroah.com","sentAt":"2005-04-24T05:11:30Z","receivedAt":"2005-04-24T05:11:30Z","isPatch":false,"sender":{"key":"greg@kroah.com","avatar":"https://gravatar.com/avatar/5bb5aa0cc2e01c00ec899d11130c07796bc186e465bae57bc34873b13b72c7c8?d=mp&s=160"},"body":"On Sat, Apr 23, 2005 at 10:02:36PM -0700, Paul Jackson wrote:\n> The winning solution via private email:\n> \n> \tmkdir linux\n> \tcd linux\n> \tgit init rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n> \n> Another email was missing the 'scm' term.\n> \n> I still don't see how to get to the official 2.6.12-rc3:\n> \n> \ta2755a80f40e5794ddc20e00f781af9d6320fafb\n\n From your \"linux\" directory do:\n \tcd ..\n\tmkdir 2.6.12-rc3\n\tcd 2.6.12-rc3\n\tmkdir .git\n\tcp -rl ../linux/.git/object .git/objects\n\tTREE_HEAD=`cat-file commit a2755a80f40e5794ddc20e00f781af9d6320fafb | head -n 1 | cut -f 2 -d \" \"`\n\techo \"$TREE_HEAD\" > .git/HEAD\n\tread-tree $TREE_HEAD\n\tcheckout-cache -a\n\tupdate-cache --refresh\n\nAnd you should have a 2.6.12-rc3 tree, all ready to commit new changes\ninto.\n\nOr at least that's how my wrapper scripts do it, I haven't converted\nthem over to the \"easier\" git-pasky commands yet :)\n\nthanks,\n\ngreg k-h\n"},{"id":"1493","messageId":"Pine.LNX.4.21.0504240104520.30848-100000@iabervon.org","threadId":"276","inReplyTo":"20050423220236.26f834ee.pj@sgi.com","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-04-24T05:12:41Z","receivedAt":"2005-04-24T05:12:41Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sat, 23 Apr 2005, Paul Jackson wrote:\n\n> I still don't see how to get to the official 2.6.12-rc3:\n> \n> \ta2755a80f40e5794ddc20e00f781af9d6320fafb\n\nYou've got the current head, which is a couple of days past 2.6.12-rc3. If\nyou actually want the release version, \n\n  git seek a2755a80f40e5794ddc20e00f781af9d6320fafb\n\nshould get you there, although it will not want to let you commit changes\nwhen you are blatantly not up-to-date.\n\n\t-Daniel\n*This .sig left intentionally blank*\n\n"},{"id":"1503","messageId":"20050424071413.GA578@pasky.ji.cz","threadId":"276","inReplyTo":"20050423205847.7758bfaa.pj@sgi.com","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-24T07:14:13Z","receivedAt":"2005-04-24T07:14:13Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, Apr 24, 2005 at 05:58:47AM CEST, I got a letter\nwhere Paul Jackson <pj@sgi.com> told me that...\n> What are the exact steps, given that I have an empty chunk\n> of diskspace, to get Linux 2.6.12-rc3 to appear there, using\n> git.\n\nFWIW, excerpt from the README:\n\n===\n\nIf you want to start out new project, do (IN NEW DIRECTORY)\n\n        git init\n\nand if you want to have a look at someone else's project, do\n\n        git init URL\n\n(your working directory will be by default tracking branch 'origin').\n\n===\n\n(although I'm not sure why did I write it when apparently noone bothers\nto read it anyway ;-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"1504","messageId":"20050424002017.2f30992c.pj@sgi.com","threadId":"276","inReplyTo":"20050424071413.GA578@pasky.ji.cz","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Paul Jackson","fromEmail":"pj@sgi.com","sentAt":"2005-04-24T07:20:17Z","receivedAt":"2005-04-24T07:20:17Z","isPatch":false,"sender":{"key":"pj@sgi.com","avatar":null},"body":"> (although I'm not sure why did I write it when apparently noone bothers\n> to read it anyway ;-)\n\nI read it - that's how I got the rest of the steps.\n\nI did not recognize that what I wanted to do next was:\n\n> and if you want to have a look at someone else's project, do\n> \n>         git init URL\n\nGood documentation is hard -- different people catch on to different\nways of saying the same thing at different times in different ways.\n\n-- \n                  I won't rest till it's the best ...\n                  Programmer, Linux Scalability\n                  Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401\n"},{"id":"1508","messageId":"1114336249.27940.27.camel@nosferatu.lan","threadId":"276","inReplyTo":"Pine.LNX.4.58.0504232044040.2344@ppc970.osdl.org","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Martin Schlemmer","fromEmail":"azarah@nosferatu.za.org","sentAt":"2005-04-24T09:50:49Z","receivedAt":"2005-04-24T09:50:49Z","isPatch":false,"sender":{"key":"azarah@nosferatu.za.org","avatar":null},"body":"On Sat, 2005-04-23 at 20:45 -0700, Linus Torvalds wrote:\n> \n> On Sun, 24 Apr 2005, Martin Schlemmer wrote:\n> > \n> > Over here gitmerge-file.sh is looking for a 'merge' command not present.\n> \n> It's usually packaged up with RCS. So in that sense git does need RCS,\n> although it's really only the traditional three-way merge program it\n> wants.\n> \n\nThanks, thought it was something like this, but did not see a new\ndependency in the README.\n\n\nThanks,\n\n-- \nMartin Schlemmer\n\n"},{"id":"1509","messageId":"1114338906.27940.35.camel@nosferatu.lan","threadId":"276","inReplyTo":"20050423220236.26f834ee.pj@sgi.com","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Martin Schlemmer","fromEmail":"azarah@nosferatu.za.org","sentAt":"2005-04-24T10:35:06Z","receivedAt":"2005-04-24T10:35:06Z","isPatch":false,"sender":{"key":"azarah@nosferatu.za.org","avatar":null},"body":"On Sat, 2005-04-23 at 22:02 -0700, Paul Jackson wrote:\n> The winning solution via private email:\n> \n> \tmkdir linux\n> \tcd linux\n> \tgit init rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n> \n> Another email was missing the 'scm' term.\n> \n> I still don't see how to get to the official 2.6.12-rc3:\n> \n> \ta2755a80f40e5794ddc20e00f781af9d6320fafb\n> \n\nIf you want a new directory that only goes to official 2.6.12-rc3, try:\n\n    git fork linux-2.6.12-rc3 ../linux-2.6.12-rc3 a2755a80f40e5794ddc20e00f781af9d6320fafb\n\nThis will also share the object database, so only space for the checked\nout files will be needed.\n\n\nCheers,\n\n-- \nMartin Schlemmer\n\n"},{"id":"1510","messageId":"7vzmvosayn.fsf@assigned-by-dhcp.cox.net","threadId":"276","inReplyTo":"20050424005923.GA8859@pasky.ji.cz","subject":"Re: [ANNOUNCE] git-pasky-0.7","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-04-24T10:52:48Z","receivedAt":"2005-04-24T10:52:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I was reviewing the differences in C-part between what is in\ngit-pasky and Linus tree.  By the way, I finally decided to look\nat the upper layer again, now you switched to dircache based\nimplementation.  It looks like a good start.  Anyway, this\nmessage is about purely C part.\n\nFirst some nitpicks and possible bugs.\n\n - The remove_file_from_cache() function in read-cache.c was\n   fixed for quite some time ago in the Linus tree to let users\n   resolve unmerged path by \"update-cache --remove\".  You do not\n   seem to have this part (the diff is reversed) [*R1*].  If this is\n   not a merge oversight I'd like to know why?\n\n - show-diff exiting non-zero when unmatched paths are specified\n   does not make much sense.  diff traditionally exits non-zero\n   when differences are found.  Are you using this exit status\n   to see if entries on the command line are in the dircache?\n   If so that is not show-diff's job but probably belongs to\n   show-files [*R2*].\n\nComments, commends and requests.\n\n - The -t option you have in show-files sounds generally\n   useful [*R3*].  Could you push this upstream?\n\n - There are many small changes that adds free() and close(fd)\n   and from my cursory looking they all look reasonable fixes.\n   If you are confident with these, could please also push them\n   upstream?\n\nThanks.\n\n[References]\n\n*R1*\n\nThis hunk should be reverted from Pasky if there is no good reason.\n\n--- git.linus/read-cache.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/read-cache.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -99,9 +99,7 @@\n int remove_file_from_cache(char *path)\n {\n \tint pos = cache_name_pos(path, strlen(path));\n-\tif (pos < 0)\n-\t\tpos = -pos-1;\n-\twhile (pos < active_nr && !strcmp(active_cache[pos]->name, path))\n+\tif (pos >= 0)\n \t\tremove_entry_at(pos);\n \treturn 0;\n }\n\n*R2*\n\nThis hunk should be reverted from Pasky if there is no good reason.\n\n--- git.linus/show-diff.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/show-diff.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -126,6 +127,7 @@\n \tint machine_readable = 0;\n \tint reverse = 0;\n \tint entries = read_cache();\n+\tint matched = 0;\n \tint i;\n \n \twhile (1 < argc && argv[1][0] == '-') {\n@@ -161,6 +163,7 @@\n \t\tif (1 < argc &&\n \t\t    ! matches_pathspec(ce, argv+1, argc-1))\n \t\t\tcontinue;\n+\t\tmatched++;\n \n \t\tif (ce_stage(ce)) {\n \t\t\tif (machine_readable)\n@@ -192,10 +195,8 @@\n \t\t\tcontinue;\n \t\tif (!machine_readable)\n \t\t\tprintf(\"%s: %s\\n\", ce->name, sha1_to_hex(ce->sha1));\n-\t\telse {\n-\t\t\tprintf(\"%s %s%c\", sha1_to_hex(ce->sha1), ce->name, 0);\n-\t\t\tcontinue;\n-\t\t}\n+\t\telse\n+\t\t\tprintf(\"M %s %s%c\", sha1_to_hex(ce->sha1), ce->name, 0);\n \t\tif (silent)\n \t\t\tcontinue;\n \n@@ -208,5 +209,8 @@\n \t\t\t\t\t reverse);\n \t\tfree(old);\n \t}\n+\n+\tif (1 < argc && !matched)\n+\t\treturn 1;\n \treturn 0;\n }\n\n*R3*\n\nThis should be pushed upstream.\n\n--- git.linus/show-files.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/show-files.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -17,6 +17,11 @@\n static int show_unmerged = 0;\n static int line_terminator = '\\n';\n \n+static const char *tag_cached = \"\";\n+static const char *tag_unmerged = \"\";\n+static const char *tag_removed = \"\";\n+static const char *tag_other = \"\";\n+\n static const char **dir;\n static int nr_dir;\n static int dir_alloc;\n@@ -107,7 +112,7 @@\n \t}\n \tif (show_others) {\n \t\tfor (i = 0; i < nr_dir; i++)\n-\t\t\tprintf(\"%s%c\", dir[i], line_terminator);\n+\t\t\tprintf(\"%s%s%c\", tag_other, dir[i], line_terminator);\n \t}\n \tif (show_cached | show_stage) {\n \t\tfor (i = 0; i < active_nr; i++) {\n@@ -115,10 +120,13 @@\n \t\t\tif (show_unmerged && !ce_stage(ce))\n \t\t\t\tcontinue;\n \t\t\tif (!show_stage)\n-\t\t\t\tprintf(\"%s%c\", ce->name, line_terminator);\n+\t\t\t\tprintf(\"%s%s%c\",\n+\t\t\t\t       ce_stage(ce) ? tag_unmerged : tag_cached,\n+\t\t\t\t       ce->name, line_terminator);\n \t\t\telse\n \t\t\t\tprintf(/* \"%06o %s %d %10d %s%c\", */\n-\t\t\t\t       \"%06o %s %d %s%c\",\n+\t\t\t\t       \"%s %06o %s %d %s%c\",\n+\t\t\t\t       ce_stage(ce) ? tag_unmerged : tag_cached,\n \t\t\t\t       ntohl(ce->ce_mode),\n \t\t\t\t       sha1_to_hex(ce->sha1),\n \t\t\t\t       ce_stage(ce),\n@@ -132,7 +140,7 @@\n \t\t\tstruct stat st;\n \t\t\tif (!stat(ce->name, &st))\n \t\t\t\tcontinue;\n-\t\t\tprintf(\"%s%c\", ce->name, line_terminator);\n+\t\t\tprintf(\"%s%s%c\", tag_removed, ce->name, line_terminator);\n \t\t}\n \t}\n \tif (show_ignored) {\n@@ -151,6 +159,13 @@\n \t\t\tline_terminator = 0;\n \t\t\tcontinue;\n \t\t}\n+\t\tif (!strcmp(arg, \"-t\")) {\n+\t\t\ttag_cached = \"H \";\n+\t\t\ttag_unmerged = \"M \";\n+\t\t\ttag_removed = \"R \";\n+\t\t\ttag_other = \"? \";\n+\t\t\tcontinue;\n+\t\t}\n \n \t\tif (!strcmp(arg, \"--cached\")) {\n \t\t\tshow_cached = 1;\n@@ -179,7 +194,7 @@\n \t\t\tcontinue;\n \t\t}\n \n-\t\tusage(\"show-files [-z] (--[cached|deleted|others|ignored|stage])*\");\n+\t\tusage(\"show-files [-z] [-t] (--[cached|deleted|others|ignored|stage])*\");\n \t}\n \n \t/* With no flags, we default to showing the cached files */\n\n\n*R4*\n\nThese leak fixes look reasonable from cursory looking.  If you\nare confident, please push them upstream.\n\n--- git.linus/checkout-cache.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/checkout-cache.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -48,6 +48,7 @@\n \t\tbuf[len] = 0;\n \t\tmkdir(buf, 0755);\n \t}\n+\tfree(buf);\n }\n \n static int create_file(const char *path, unsigned int mode)\n@@ -75,6 +76,8 @@\n \n \tnew = read_sha1_file(ce->sha1, type, &size);\n \tif (!new || strcmp(type, \"blob\")) {\n+\t\tif (new)\n+\t\t\tfree(new);\n \t\treturn error(\"checkout-cache: unable to read sha1 file of %s (%s)\",\n \t\t\tpath, sha1_to_hex(ce->sha1));\n \t}\n\n\n--- git.linus/ls-tree.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/ls-tree.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -77,6 +77,7 @@\n \tif (!buffer)\n \t\tdie(\"unable to read sha1 file\");\n \tlist_recursive(buffer, \"tree\", size, NULL);\n+\tfree(buffer);\n \treturn 0;\n }\n \n\n--- git.linus/read-tree.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/read-tree.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -11,11 +11,14 @@\n {\n \tvoid *buffer;\n \tunsigned long size;\n+\tint ret;\n \n \tbuffer = read_tree_with_tree_or_commit_sha1(sha1, &size, 0);\n \tif (!buffer)\n \t\treturn -1;\n-\treturn read_tree(buffer, size, stage);\n+\tret = read_tree(buffer, size, stage);\n+\tfree(buffer);\n+\treturn ret;\n }\n \n static char *lockfile_name;\n\n\n--- git.linus/rev-tree.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/rev-tree.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -56,10 +56,10 @@\n \tstruct commit_list *parents;\n \tstruct commit *obj = lookup_commit(sha1);\n \n-\tif (obj->object.parsed)\n+\tif (obj && obj->object.parsed)\n \t\treturn;\n-\n-\tparse_commit(obj);\n+\tif (!obj || parse_commit(obj))\n+\t\tdie(\"unable to parse commit (%s)\", sha1_to_hex(sha1));\n \t\n \tparents = obj->parents;\n \twhile (parents) {\n\n\n--- git.linus/show-diff.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/show-diff.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -100,6 +100,7 @@\n \t\treturn;\n \t}\n \tshow_differences(\"/dev/null\", ce->name, old, size, reverse);\n+\tfree(old);\n }\n \n static const char *show_diff_usage = \"show-diff [-q] [-s] [-z] [paths...]\";\n\n\n* These all look genuine leak fixes.  If applicable to Linus tree please\n  push them upstream.\n\n--- git.linus/checkout-cache.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/checkout-cache.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -48,6 +48,7 @@\n \t\tbuf[len] = 0;\n \t\tmkdir(buf, 0755);\n \t}\n+\tfree(buf);\n }\n \n static int create_file(const char *path, unsigned int mode)\n@@ -75,6 +76,8 @@\n \n \tnew = read_sha1_file(ce->sha1, type, &size);\n \tif (!new || strcmp(type, \"blob\")) {\n+\t\tif (new)\n+\t\t\tfree(new);\n \t\treturn error(\"checkout-cache: unable to read sha1 file of %s (%s)\",\n \t\t\tpath, sha1_to_hex(ce->sha1));\n \t}\n\n\n--- git.linus/ls-tree.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/ls-tree.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -77,6 +77,7 @@\n \tif (!buffer)\n \t\tdie(\"unable to read sha1 file\");\n \tlist_recursive(buffer, \"tree\", size, NULL);\n+\tfree(buffer);\n \treturn 0;\n }\n \n--- git.linus/read-tree.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/read-tree.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -11,11 +11,14 @@\n {\n \tvoid *buffer;\n \tunsigned long size;\n+\tint ret;\n \n \tbuffer = read_tree_with_tree_or_commit_sha1(sha1, &size, 0);\n \tif (!buffer)\n \t\treturn -1;\n-\treturn read_tree(buffer, size, stage);\n+\tret = read_tree(buffer, size, stage);\n+\tfree(buffer);\n+\treturn ret;\n }\n \n static char *lockfile_name;\n\n--- git.linus/rev-tree.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/rev-tree.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -56,10 +56,10 @@\n \tstruct commit_list *parents;\n \tstruct commit *obj = lookup_commit(sha1);\n \n-\tif (obj->object.parsed)\n+\tif (obj && obj->object.parsed)\n \t\treturn;\n-\n-\tparse_commit(obj);\n+\tif (!obj || parse_commit(obj))\n+\t\tdie(\"unable to parse commit (%s)\", sha1_to_hex(sha1));\n \t\n \tparents = obj->parents;\n \twhile (parents) {\n\n--- git.linus/sha1_file.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/sha1_file.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -278,6 +278,7 @@\n \n \tif (write(fd, compressed, size) != size)\n \t\tdie(\"unable to write file\");\n+\tfree(compressed);\n \tclose(fd);\n \t\t\n \treturn 0;\n@@ -295,8 +296,10 @@\n \tif (fd < 0)\n \t\treturn -1;\n \n-\tif (fstat(fd, &st) < 0 || size != st.st_size)\n+\tif (fstat(fd, &st) < 0 || size != st.st_size) {\n+\t\tclose(fd);\n \t\treturn -1;\n+\t}\n \n \tmap = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);\n \tclose(fd);\n\n\n--- git.linus/show-diff.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/show-diff.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -100,6 +100,7 @@\n \t\treturn;\n \t}\n \tshow_differences(\"/dev/null\", ce->name, old, size, reverse);\n+\tfree(old);\n }\n \n static const char *show_diff_usage = \"show-diff [-q] [-s] [-z] [paths...]\";\n\n\n--- git.linus/update-cache.c\t2005-04-24 00:05:02.000000000 -0700\n+++ git.pasky/update-cache.c\t2005-04-24 00:49:00.000000000 -0700\n@@ -104,6 +104,11 @@\n \t\tclose(fd);\n \t\treturn -1;\n \t}\n+\tif (S_ISDIR(st.st_mode)) {\n+\t\tfprintf(stderr, \"'%s' is a directory, ignoring\\n\", path);\n+\t\tclose(fd);\n+\t\treturn 0;\n+\t}\n \tnamelen = strlen(path);\n \tsize = cache_entry_size(namelen);\n \tce = malloc(size);\n@@ -113,10 +118,15 @@\n \tce->ce_mode = create_ce_mode(st.st_mode);\n \tce->ce_flags = htons(namelen);\n \n-\tif (index_fd(ce->sha1, fd, &st) < 0)\n+\tif (index_fd(ce->sha1, fd, &st) < 0) {\n+\t\tfree(ce);\n \t\treturn -1;\n-\n-\treturn add_cache_entry(ce, allow_add);\n+\t}\n+\tif (add_cache_entry(ce, allow_add)) {\n+\t\tfree(ce);\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n }\n \n static int match_data(int fd, void *buffer, unsigned long size)\n@@ -141,7 +151,7 @@\n \tif (fd >= 0) {\n \t\tvoid *buffer;\n \t\tunsigned long size;\n-\t\tchar type[10];\n+\t\tchar type[20];\n \n \t\tbuffer = read_sha1_file(ce->sha1, type, &size);\n \t\tif (buffer) {\n@@ -216,6 +226,9 @@\n \t\t\tprintf(\"%s: needs update\\n\", ce->name);\n \t\t\tcontinue;\n \t\t}\n+\t\t/* You can NOT just free active_cache[i] here, since it\n+\t\t * might not be necessarily malloc()ed but can also come\n+\t\t * from mmap(). */\n \t\tactive_cache[i] = new;\n \t}\n }\n\n"}]}