{"thread":{"id":"9332","subject":"Git clone error","startedAt":"2007-07-31T23:45:47Z","lastAt":"2007-08-02T17:40:45Z","messageCount":13,"participants":["Denis Bueno","Junio C Hamano","Linus Torvalds","Steffen Prohaska","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"49252","messageId":"C2D525CB.2A81%denbuen@sandia.gov","threadId":"9332","inReplyTo":null,"subject":"Git clone error","fromName":"Denis Bueno","fromEmail":"denbuen@sandia.gov","sentAt":"2007-07-31T23:45:47Z","receivedAt":"2007-07-31T23:45:47Z","isPatch":false,"sender":{"key":"denbuen@sandia.gov","avatar":null},"body":"Hi all,\n\nI'm a new git user (actually a darcs convert) and am running into a weird\nproblem on a small and simple repository.  The error I see is:\n\n    git[14] > git clone /Volumes/work/scripts/\n    Initialized empty Git repository in /tmp/git/scripts/.git/\n    remote: Generating pack...\n    Done counting 80 objects.\n    remote: error: unable to unpack b28b949a1a3c8eb37ca6eefd024508fa8b253429\nheader\n    fatal: unable to get type of object b28b949a1a3c8eb37ca6error:\ngit-upload-pack: git-pack-objects died with error.\n    fatal: git-upload-pack: aborting due to possible repository corruption\non the remote side.\n    remote: aborting due to possible repository corruption on the remote\nside.\n    fatal: early EOF\n    fatal: index-pack died with error code 128\n    fetch-pack from '/Volumes/work/scripts/.git' failed.\n\nI have many git repos on my system (one for configuration files, one for\nscripts, various school projects, etc.) and this is the only one that has\nbeen problematic thus far.  As you can see I am trying to clone a local repo\n-- there should be no network problems here.  As I said, the repo is small:\n\n    scripts[19] > find . -type f | wc -l\n    118\n\n(which of course includes all of git's files.)\n\n$ git --version\ngit version 1.5.2.4\n\n$ uname -a\nDarwin 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007;\nroot:xnu-792.22.5~1/RELEASE_I386 i386 i386\n\nI have little experience with git, but if you need any more info, let me\nknow.  Any suggestion on what might be the problem, and how to fix it?\n\n-Denis\n"},{"id":"49255","messageId":"7vlkcwdrxw.fsf@assigned-by-dhcp.cox.net","threadId":"9332","inReplyTo":"C2D525CB.2A81%denbuen@sandia.gov","subject":"Re: Git clone error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-01T00:22:35Z","receivedAt":"2007-08-01T00:22:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Denis Bueno\" <denbuen@sandia.gov> writes:\n\n> ...  The error I see is:\n>\n>     git[14] > git clone /Volumes/work/scripts/\n>     Initialized empty Git repository in /tmp/git/scripts/.git/\n>     remote: Generating pack...\n>     Done counting 80 objects.\n>     remote: error: unable to unpack b28b949a1a3c8eb37ca6eefd024508fa8b253429\n> header\n>     fatal: unable to get type of object b28b949a1a3c8eb37ca6error:\n> git-upload-pack: git-pack-objects died with error.\n>     fatal: git-upload-pack: aborting due to possible repository corruption\n> on the remote side.\n>     remote: aborting due to possible repository corruption on the remote\n> side.\n\nFirst thing to check would be...\n\n>     fatal: early EOF\n>     fatal: index-pack died with error code 128\n>     fetch-pack from '/Volumes/work/scripts/.git' failed.\n\n        $ cd /Volumes/work/scripts\n        $ git fsck --full\n"},{"id":"49271","messageId":"alpine.LFD.0.999.0707311924590.4161@woody.linux-foundation.org","threadId":"9332","inReplyTo":"C2D525CB.2A81%denbuen@sandia.gov","subject":"Re: Git clone error","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-08-01T02:38:21Z","receivedAt":"2007-08-01T02:38:21Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Tue, 31 Jul 2007, Denis Bueno wrote:\n> \n> I'm a new git user (actually a darcs convert) and am running into a weird\n> problem on a small and simple repository.  The error I see is:\n> \n>     git[14] > git clone /Volumes/work/scripts/\n>     Initialized empty Git repository in /tmp/git/scripts/.git/\n>     remote: Generating pack...\n>     Done counting 80 objects.\n>     remote: error: unable to unpack b28b949a1a3c8eb37ca6eefd024508fa8b253429 header\n>     fatal: unable to get type of object b28b949a1a3c8eb37ca6error: git-upload-pack: git-pack-objects died with error.\n>     fatal: git-upload-pack: aborting due to possible repository corruption on the remote side.\n>     remote: aborting due to possible repository corruption on the remote side.\n>     fatal: early EOF\n>     fatal: index-pack died with error code 128\n>     fetch-pack from '/Volumes/work/scripts/.git' failed.\n\nWell, it says so, but the most likely issue really is that there is \n\"corruption on the remote side\".\n\nPlease do\n\n\tcd /Volumes/work/scripts\n\tgit fsck --full\n\nwhich I would guess will almost certainly talk about some kind of problems \nwith that object \"b28b949a1a3c8eb37ca6eefd024508fa8b253429\". And possibly \nmore.\n\nThe \"unable to unpack .. header\" problem would at a guess be a totally \ncorrupted loose object. You should have a file named\n\n\t.git/objects/b2/8b949a1a3c8eb37ca6eefd024508fa8b253429\n\nand it sounds like that file is corrupt. So far, apart from a CRLF \nconversion bug (that you wouldn't have triggered on OS X anyway), I think \nevery single time we've seen that, it's been a real disk or memory \ncorruption.\n\nTrying to restore corrupt objects can be quite hard, since git stores them \nin a compressed format, and so git single-bit errors are very detectable \n(that's kind of the point of having cryptographically secure hashes!), but \nthey are very much not fixable, unless you can find the original data that \n*resulted* in that object some way (in another clone of the git \nrepository, or in a backup).\n\nThere are certainly ways to figure out what that object _should_ be, \nthough. For example, if that object is the only corrupted entry, and it's \na blob (ie pure data object), what you can generally do is still use the \nrepo (as long as you avoid that particular blob), and do things like\n\n\tgit log --raw -r --no-abbrev\n\nand you'll see the git history with all blobs named with their SHA1's. \nThen you can just search for that b28b949.. name, and you'll see exactly \nwhich file (in which version) it was, and if you can just find a backup of \nthat file (or re-create it *exactly* from previous versions and your \nmemory of it), you can re-generate the git object and thus save your \nrepository.\n\nOf course, a much easier option tends to be to just have a backup \nrepository that has that object in it, and then you can literally just \ncopy that b28b949 object over.\n\nIn short: git basically guarantees that it will *find* all corruption, but \nit doesn't do backups for you. Backups are easy to do (cloning), and git \nalso makes incremental backups trivial (ie just do \"git fetch\" or \"git \npush\"), but git won't do backups for you unless you ask for them that way.\n\n\t\t\tLinus\n"},{"id":"49312","messageId":"C2D5F3B2.2B00%denbuen@sandia.gov","threadId":"9332","inReplyTo":"alpine.LFD.0.999.0707311924590.4161@woody.linux-foundation.org","subject":"Re: Git clone error","fromName":"Denis Bueno","fromEmail":"denbuen@sandia.gov","sentAt":"2007-08-01T14:24:18Z","receivedAt":"2007-08-01T14:24:18Z","isPatch":false,"sender":{"key":"denbuen@sandia.gov","avatar":null},"body":"On 07/31/2007 20:38, \"Linus Torvalds\" <torvalds@linux-foundation.org> wrote:\n> Please do\n> \n> cd /Volumes/work/scripts\n> git fsck --full\n> \n> which I would guess will almost certainly talk about some kind of problems\n> with that object \"b28b949a1a3c8eb37ca6eefd024508fa8b253429\". And possibly\n> more.\n\nIndeed:\n\n    scripts[10] > git fsck --full\n    error: b28b949a1a3c8eb37ca6eefd024508fa8b253429: object corrupt or\nmissing\n    missing blob b28b949a1a3c8eb37ca6eefd024508fa8b253429\n\nFortunately, it's the only one.\n\n> There are certainly ways to figure out what that object _should_ be,\n> though. For example, if that object is the only corrupted entry, and it's\n> a blob (ie pure data object), what you can generally do is still use the\n> repo (as long as you avoid that particular blob), and do things like\n> \n> git log --raw -r --no-abbrev\n\n    scripts[11] > git log --raw -r --no-abbrev | grep\nb28b949a1a3c8eb37ca6eefd024508fa8b253429\n    :100755 100755 b28b949a1a3c8eb37ca6eefd024508fa8b253429\n9dbd5bb59198ab59e1850f838f2ed27c77364cde M      condor/condor-uninstall.sh\n    :000000 100755 0000000000000000000000000000000000000000\nb28b949a1a3c8eb37ca6eefd024508fa8b253429 A      condor/condor-uninstall.sh\n\n> and you'll see the git history with all blobs named with their SHA1's.\n> Then you can just search for that b28b949.. name, and you'll see exactly\n> which file (in which version) it was, and if you can just find a backup of\n> that file (or re-create it *exactly* from previous versions and your\n> memory of it), you can re-generate the git object and thus save your\n> repository.\n\nWhen you say \"re-generate\", do you mean `git add <file> ; git commit\n<file>`?  Or something a bit more clever?  I suspect you actually meant the\nlatter, since you suggest recreating it *exactly*.\n\nIf I just recreate a version I'm happy with, can I add that to the repo and\ngo from there?\n\n> Of course, a much easier option tends to be to just have a backup\n> repository that has that object in it, and then you can literally just\n> copy that b28b949 object over.\n\nNo such luck, but I'll back up my repos in the future.  Any hint on what\nmight have caused this kind of corruption?  That repo was created on my\nlaptop and only edited there; it's not a clone from some other machine.\nIt's possible that I have Ctrl-C'd some git operation in the past -- could\nthat have caused it?\n\nIs there anything (e.g. trapping signals if a blob is being written until\nit's done, or backing out of the current blob on SIG{INT,HUP}) that could\nmake this kind of corruption less easy to encounter?  I ask because I have\nused VC systems (i.e. CVS, SVN, darcs, and now git) for 4+ years (not long\nby any means, but long enough) and the only repository corruption I had ever\nencountered was after I went mucking about in a CVS repo's internal\nrepresentation -- and I deserved that.\n\n\n                      Denis\n--\n\"Dealing with failure is easy: Work hard to improve. Success is also easy to\nhandle: You've solved the wrong problem. Work hard to improve.\" -- Perlis\n"},{"id":"49319","messageId":"alpine.LFD.0.999.0708010846360.3582@woody.linux-foundation.org","threadId":"9332","inReplyTo":"C2D5F3B2.2B00%denbuen@sandia.gov","subject":"Re: Git clone error","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-08-01T16:19:51Z","receivedAt":"2007-08-01T16:19:51Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 1 Aug 2007, Denis Bueno wrote:\n> \n> Indeed:\n> \n>     scripts[10] > git fsck --full\n>     error: b28b949a1a3c8eb37ca6eefd024508fa8b253429: object corrupt or missing\n>     missing blob b28b949a1a3c8eb37ca6eefd024508fa8b253429\n> \n> Fortunately, it's the only one.\n\nOk. That's the \"easy\" case, although the fact that the file went missing \nin the first place is certainly worrisome. \n\nI think you said you were using OS X - have you seen crashes or are you \nusing something like the experimental ZFS support?\n\nMemory and disk corruption is also a possibility, so running fsck (I have \n*no* idea how you do that under OS X, but I bet others on the list know) \nis a good idea.\n\nAlso, *if* you actually have the file\n\n\t.git/objects/b2/8b949a1a3c8eb37ca6eefd024508fa8b253429\n\nand it's not just missing entirely, please move it out, ie do something \nlike\n\n\tmv .git/objects/b2/8b949a1a3c8eb37ca6eefd024508fa8b253429 ~/corrupt-object\n\nYou want to move it away from the .git/objects directory in any case, \nbecause if it exists (but is corrupted), git will never overwrite it with \nthe non-corrupted version. And you don't want to just delete it, because \nI'd love to see exactly *what* the corruption was.\n\n> > There are certainly ways to figure out what that object _should_ be,\n> > though. For example, if that object is the only corrupted entry, and it's\n> > a blob (ie pure data object), what you can generally do is still use the\n> > repo (as long as you avoid that particular blob), and do things like\n> > \n> > git log --raw -r --no-abbrev\n> \n>     scripts[11] > git log --raw -r --no-abbrev | grep b28b949a1a3c8eb37ca6eefd024508fa8b253429\n>     :100755 100755 b28b949a1a3c8eb37ca6eefd024508fa8b253429 9dbd5bb59198ab59e1850f838f2ed27c77364cde M      condor/condor-uninstall.sh\n>     :000000 100755 0000000000000000000000000000000000000000 b28b949a1a3c8eb37ca6eefd024508fa8b253429 A      condor/condor-uninstall.sh\n\nOk, great. So it's the very first version of \"condor/condor-uninstall.sh\".\n\nIf you can find that original version, great. If not, you can get the \n*second* version by doing\n\n\tgit cat-file blob 9dbd5bb59198ab59e1850f838f2ed27c77364cde > second-version\n\nand if you remember what your changes were, try to just edit that back to \nthe exact thing it was in the first version, if you can (note that by \n\"exact\", I do mean *exact*. Whitespace and all).\n\n> When you say \"re-generate\", do you mean `git add <file> ; git commit\n> <file>`?  Or something a bit more clever?  I suspect you actually meant the\n> latter, since you suggest recreating it *exactly*.\n\nActually you can literally just do \n\n\tgit add my-regenerated-file\n\nand it would do the right thing. But it also changes your index, so a \nbetter way would often be to do\n\n\tgit hash-object -w <filename>\n\nwhich will take any random file, and hash it into the object database.\n\nSo if you were able to re-generate the original, you should now have a \n*non*corrupted .git/objects/b2/8b949a1a3c8eb37ca6eefd024508fa8b253429 \nfile, and git-fsck will be happy again!\n\nAnd after that, I'd really like to see both the corrupt and the \nnon-corrupt object, to try to figure out what the corruption is.\n\n> If I just recreate a version I'm happy with, can I add that to the repo and\n> go from there?\n\nWell, it's not so much a version _you_ are happy with: you'd have to be \nable to re-create the exact old version (with the exact same SHA1), in \norder for git to be happy.\n\n> No such luck, but I'll back up my repos in the future.  Any hint on what\n> might have caused this kind of corruption?  That repo was created on my\n> laptop and only edited there; it's not a clone from some other machine.\n> It's possible that I have Ctrl-C'd some git operation in the past -- could\n> that have caused it?\n\nNo, things like Ctrl-C are safe: we create new objects by writing them to \na temporary file, and then using an atomic rename() operation on them \n(actually, a \"link() + unlink()\", but we fall back to \"rename()\" if that \nfails - some filesystems cannot link files between directories).\n\nSo the only way to get corruption is literally with a broken filesystem, \nor memory corruption. Of course, if the OS's \"rename()\" is broken, and \nisn't atomic (ie if it's \"copy + delete\" operation).\n\nOf course, git bugs could do this, but quite frankly, this is (a) very \nsimple code, and (b) we really haven't had bugs in this area.\n\nGit does end up finding corruption that other VCS's don't. The strong \nhashes and the fact that fsck (and, in fact, even simple operations like \nclone) will check every single hash, means that single-bit corruption gets \nnoticed (and is a fatal error) every time. Other SCM's? Not so much.\n\n\t\t\tLinus\n"},{"id":"49322","messageId":"alpine.LFD.0.999.0708010929070.3582@woody.linux-foundation.org","threadId":"9332","inReplyTo":"alpine.LFD.0.999.0708010846360.3582@woody.linux-foundation.org","subject":"Re: Git clone error","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-08-01T16:36:47Z","receivedAt":"2007-08-01T16:36:47Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 1 Aug 2007, Linus Torvalds wrote:\n> \n> > If I just recreate a version I'm happy with, can I add that to the repo and\n> > go from there?\n> \n> Well, it's not so much a version _you_ are happy with: you'd have to be \n> able to re-create the exact old version (with the exact same SHA1), in \n> order for git to be happy.\n\nBtw, if you really cannot re-generate it, you'd basically need to create a \nwhole new git archive without that blob (or basically with that blob \nreplaced by another version).\n\nWe don't have wonderfully good support for that, because, quite frankly, \nwe've not had this happen before. I think every time before, people have \nhad the blob in some other copy of their git archive.\n\nBut the thing to use is \"git filter-branch\", which can take a git history \nand munge it arbitrarily. It would be the \"tree-filter\" that you'd use to \nreplace that one blob that you cannot regenerate with another (ie you \nmight decide to just replace the original version of the file with that \n*second* version, and regenerate the tree that way).\n\nI'm cc'ing Dscho explicitly to see if he can help you with the exact \nsyntax, and maybe we could even make this into a user-manual entry about \nhow to handle corruption. I don't think we have anything in the \ndocumentation about this - we only cover the trivial cases where the \nobjects are all good, but you've lost the pointers into it because you \nremoved a branch by mistake or something.\n\n\t\tLinus\n"},{"id":"49321","messageId":"846EABB5-19D2-45CA-BD83-4E289DA8508B@zib.de","threadId":"9332","inReplyTo":"alpine.LFD.0.999.0708010846360.3582@woody.linux-foundation.org","subject":"Re: Git clone error","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2007-08-01T16:37:21Z","receivedAt":"2007-08-01T16:37:21Z","isPatch":false,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Aug 1, 2007, at 6:19 PM, Linus Torvalds wrote:\n\n>\n> Memory and disk corruption is also a possibility, so running fsck  \n> (I have\n> *no* idea how you do that under OS X, but I bet others on the list  \n> know)\n> is a good idea.\n\nAppleJack is the easiest way I know of:\n\nhttp://applejack.sourceforge.net/\n\n\n\tSteffen\n"},{"id":"49329","messageId":"Pine.LNX.4.64.0708011802020.14781@racer.site","threadId":"9332","inReplyTo":"alpine.LFD.0.999.0708010929070.3582@woody.linux-foundation.org","subject":"Re: Git clone error","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-01T17:17:44Z","receivedAt":"2007-08-01T17:17:44Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 1 Aug 2007, Linus Torvalds wrote:\n\n> On Wed, 1 Aug 2007, Linus Torvalds wrote:\n> > \n> > > If I just recreate a version I'm happy with, can I add that to the repo and\n> > > go from there?\n> > \n> > Well, it's not so much a version _you_ are happy with: you'd have to \n> > be able to re-create the exact old version (with the exact same SHA1), \n> > in order for git to be happy.\n> \n> Btw, if you really cannot re-generate it, you'd basically need to create \n> a whole new git archive without that blob (or basically with that blob \n> replaced by another version).\n> \n> We don't have wonderfully good support for that, because, quite frankly, \n> we've not had this happen before. I think every time before, people have \n> had the blob in some other copy of their git archive.\n> \n> But the thing to use is \"git filter-branch\", which can take a git history \n> and munge it arbitrarily. It would be the \"tree-filter\" that you'd use to \n> replace that one blob that you cannot regenerate with another (ie you \n> might decide to just replace the original version of the file with that \n> *second* version, and regenerate the tree that way).\n> \n> I'm cc'ing Dscho explicitly to see if he can help you with the exact \n> syntax, and maybe we could even make this into a user-manual entry about \n> how to handle corruption. I don't think we have anything in the \n> documentation about this - we only cover the trivial cases where the \n> objects are all good, but you've lost the pointers into it because you \n> removed a branch by mistake or something.\n\nI doubt it would be that easy; the tree filter expects a _valid_ tree, \nwhich it checks out, and only then you can filter it.\n\nBut this is what I would do if I had the problem: I would try to create \na state which is as close to the corrupt revision as possible, \nuse a graft to replace the initial commit with that revision, and \nrewrite the branch. I'd probably start by doing something like this:\n\n\t$ git symbolic-ref HEAD refs/heads/recreate-first && rm .git/index\n\t$ git ls-tree -r --name-only <initial-commit> |\n\t\tgrep -v \"^condor/condor-uninstall.sh$\" |\n\t\txargs git checkout <initial-commit>\n\t$ git checkout <second-commit> condor/condor-uninstall.sh\n\t[possibly some minor hacking on the latter file to make it work]\n\t$ git commit -c <initial-commit>\n\nThis starts a new branch, which has no ancestor yet.  It takes all files \nexcept the corrupt one from the first commit, and a replacement of the \ncorrupt one from the second commit.  Then it takes all the meta-data from \nthe first commit to create a replacement for the first commit.\n\nNow I'd graft the second commit onto the first:\n\n\t$ git rev-parse <second-commit> recreate-first >> .git/info/grafts\n\nThis explicitely tells git to disregard the parent information given in \n<second-commit>, and to pretend that the recreated commit is its parent.\n\n\tBEWARE! Grafts are a powerful weapon, and you can spend tons of \n\ttime looking for an error, when all you did was grafting parts of \n\tthe history onto other parts of the history.  For example, I was \n\tsearching several nights for the bug preventing me to push one of \n\tmy repos, and it always gave an \"unpacking\" error.  Once I moved \n\tthe grafts out of the way, it miraculously worked.\n\nAfter that, just call git-filter-branch (not yet released, but will \nprobably be part of 1.5.3):\n\n\t$ git filter-branch <branchname>\n\nMany things can go wrong through that process, so you want to make sure \nthat all steps actually worked as intended (especially since I tested \nnone of this, but wrote it in the mail program)!\n\nHth,\nDscho\n"},{"id":"49346","messageId":"C2D647C0.2B60%denbuen@sandia.gov","threadId":"9332","inReplyTo":"Pine.LNX.4.64.0708011802020.14781@racer.site","subject":"Re: Git clone error","fromName":"Denis Bueno","fromEmail":"denbuen@sandia.gov","sentAt":"2007-08-01T20:22:56Z","receivedAt":"2007-08-01T20:22:56Z","isPatch":false,"sender":{"key":"denbuen@sandia.gov","avatar":null},"body":"On 08/01/2007 11:17, \"Johannes Schindelin\" <Johannes.Schindelin@gmx.de>\nwrote:\n> But this is what I would do if I had the problem: I would try to create\n> a state which is as close to the corrupt revision as possible,\n> use a graft to replace the initial commit with that revision, and\n> rewrite the branch. I'd probably start by doing something like this:\n> \n> $ git symbolic-ref HEAD refs/heads/recreate-first && rm .git/index\n> $ git ls-tree -r --name-only <initial-commit> |\n> grep -v \"^condor/condor-uninstall.sh$\" |\n> xargs git checkout <initial-commit>\n> $ git checkout <second-commit> condor/condor-uninstall.sh\n> [possibly some minor hacking on the latter file to make it work]\n> $ git commit -c <initial-commit>\n\nWow.  `commit' and `checkout' are the only two commands that I have ever\nheard of in that sequence.\n\nHow difficult would it be to create a new git repo which is exactly the same\nminus the initial condor-uninstall.sh commit?  That is, just to pretend the\ninitial import of condor-uninstall.sh never existed, and use the second\ncommit of the old repo the first commit of the new, and preserve the rest of\nthe history of the entire repo?  Or, to remove both condor-uninstall.sh\ncommits from the history -- deleting that history altogether -- and add it\nback as a completely new file?\n\nIf I get enough courage, I'll attempt to understand exactly what it is\nyou're doing in the commands above and try it out on (a copy of) the repo.\nMy willingness to part with the current history and just reinitialise the\nrepo with its current contents increases with time, though.\n\nThe real problem is that I'm sure I have no idea exactly what the first\nversion of the file looked like, and how it differed from the next one.\n\n                      Denis\n--\n\"If we wish to count lines of code, we should not regard them as lines\nproduced but as lines spent.\" -- Edsger Dijkstra\n"},{"id":"49349","messageId":"Pine.LNX.4.64.0708012211040.14781@racer.site","threadId":"9332","inReplyTo":"C2D647C0.2B60%denbuen@sandia.gov","subject":"Re: Git clone error","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-01T21:12:40Z","receivedAt":"2007-08-01T21:12:40Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 1 Aug 2007, Denis Bueno wrote:\n\n> On 08/01/2007 11:17, \"Johannes Schindelin\" <Johannes.Schindelin@gmx.de>\n> wrote:\n> > But this is what I would do if I had the problem: I would try to create\n> > a state which is as close to the corrupt revision as possible,\n> > use a graft to replace the initial commit with that revision, and\n> > rewrite the branch. I'd probably start by doing something like this:\n> > \n> > $ git symbolic-ref HEAD refs/heads/recreate-first && rm .git/index\n> > $ git ls-tree -r --name-only <initial-commit> |\n> > grep -v \"^condor/condor-uninstall.sh$\" |\n> > xargs git checkout <initial-commit>\n> > $ git checkout <second-commit> condor/condor-uninstall.sh\n> > [possibly some minor hacking on the latter file to make it work]\n> > $ git commit -c <initial-commit>\n> \n> Wow.  `commit' and `checkout' are the only two commands that I have ever\n> heard of in that sequence.\n> \n> How difficult would it be to create a new git repo which is exactly the same\n> minus the initial condor-uninstall.sh commit?  That is, just to pretend the\n> initial import of condor-uninstall.sh never existed, and use the second\n> commit of the old repo the first commit of the new, and preserve the rest of\n> the history of the entire repo?\n\nThat would be even easier.  Just graft \"nothingness\" as parent of the \nsecond commit:\n\n\t$ git rev-parse <second-commit> >> .git/info/grafts\n\nBut of course, you should use filter-branch nevertheless, since you would \nhave to do the same hack in _every_ repository.\n\nCiao,\nDscho\n"},{"id":"49430","messageId":"C2D74FA8.2C06%denbuen@sandia.gov","threadId":"9332","inReplyTo":"Pine.LNX.4.64.0708012211040.14781@racer.site","subject":"Re: Git clone error","fromName":"Denis Bueno","fromEmail":"denbuen@sandia.gov","sentAt":"2007-08-02T15:08:56Z","receivedAt":"2007-08-02T15:08:56Z","isPatch":false,"sender":{"key":"denbuen@sandia.gov","avatar":null},"body":"On 08/01/2007 15:12, \"Johannes Schindelin\" <Johannes.Schindelin@gmx.de>\nwrote:\n>> How difficult would it be to create a new git repo which is exactly the same\n>> minus the initial condor-uninstall.sh commit?  That is, just to pretend the\n>> initial import of condor-uninstall.sh never existed, and use the second\n>> commit of the old repo the first commit of the new, and preserve the rest of\n>> the history of the entire repo?\n> \n> That would be even easier.  Just graft \"nothingness\" as parent of the\n> second commit:\n> \n> $ git rev-parse <second-commit> >> .git/info/grafts\n\nI must be misunderstanding:\n\n    scripts[] > git fsck --full\n    error: b28b949a1a3c8eb37ca6eefd024508fa8b253429: object corrupt or\nmissing\n    missing blob b28b949a1a3c8eb37ca6eefd024508fa8b253429\n\n    # b2... should fill in your <second-commit>?\n\n    scripts[30] > git rev-parse b28b949a1a3c8eb37ca6eefd024508fa8b253429 >>\n.git/info/grafts\n\n    scripts[31] > git fsck --full\n    error: b28b949a1a3c8eb37ca6eefd024508fa8b253429: object corrupt or\nmissing\n    missing blob b28b949a1a3c8eb37ca6eefd024508fa8b253429\n\nIf I try to clone the repo, I get the same error.\n\n                      Denis\n--\n\"Program testing can be used to show the presence of bugs, but never to show\ntheir absence.\" -- Edsger Dijkstra\n"},{"id":"49444","messageId":"Pine.LNX.4.64.0708021806510.14781@racer.site","threadId":"9332","inReplyTo":"C2D74FA8.2C06%denbuen@sandia.gov","subject":"Re: Git clone error","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-02T17:08:54Z","receivedAt":"2007-08-02T17:08:54Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 2 Aug 2007, Denis Bueno wrote:\n\n> On 08/01/2007 15:12, \"Johannes Schindelin\" <Johannes.Schindelin@gmx.de>\n> wrote:\n> >> How difficult would it be to create a new git repo which is exactly the same\n> >> minus the initial condor-uninstall.sh commit?  That is, just to pretend the\n> >> initial import of condor-uninstall.sh never existed, and use the second\n> >> commit of the old repo the first commit of the new, and preserve the rest of\n> >> the history of the entire repo?\n> > \n> > That would be even easier.  Just graft \"nothingness\" as parent of the\n> > second commit:\n> > \n> > $ git rev-parse <second-commit> >> .git/info/grafts\n> \n> I must be misunderstanding:\n> \n>     scripts[] > git fsck --full\n>     error: b28b949a1a3c8eb37ca6eefd024508fa8b253429: object corrupt or\n> missing\n>     missing blob b28b949a1a3c8eb37ca6eefd024508fa8b253429\n> \n>     # b2... should fill in your <second-commit>?\n\nAh no.  Linus diagnosed that this blob is your condor-uninstall script in \nyour initial commit.  You should be able to get at it by calling \"git log \n--root\" and taking the last commit.  Just to make sure, \"git show \n<first-commit>:bla/condor-uninstall.sh\" should fail miserably, mentioning \na corrupt blob.\n\nThe second commit I was referring to is the second last commit in the \"git \nlog --root\" output.\n\nHth,\nDscho\n"},{"id":"49449","messageId":"alpine.LFD.0.999.0708021039450.8109@woody.linux-foundation.org","threadId":"9332","inReplyTo":"Pine.LNX.4.64.0708021806510.14781@racer.site","subject":"Re: Git clone error","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-08-02T17:40:45Z","receivedAt":"2007-08-02T17:40:45Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 2 Aug 2007, Johannes Schindelin wrote:\n> \n> Ah no.  Linus diagnosed that this blob is your condor-uninstall script in \n> your initial commit.\n\nWell, I'm not sure the commit was the initial one, but it was the one that \n*introduced* that file. It *may* be the initial one, of course (and quite \nlikely is, for an import), but..\n\n\t\tLinus\n"}]}