{"thread":{"id":"18828","subject":"git-stash fails on OSX 10.5","startedAt":"2009-04-10T16:44:36Z","lastAt":"2009-04-13T18:13:05Z","messageCount":5,"participants":["Jacob Kaplan-Moss","Junio C Hamano","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"111014","messageId":"be4ebbe10904100944p6ec2c0dao8607fcff75d2754e@mail.gmail.com","threadId":"18828","inReplyTo":null,"subject":"git-stash fails on OSX 10.5","fromName":"Jacob Kaplan-Moss","fromEmail":"jacob@jacobian.org","sentAt":"2009-04-10T16:44:36Z","receivedAt":"2009-04-10T16:44:36Z","isPatch":false,"sender":{"key":"jacob@jacobian.org","avatar":"https://gravatar.com/avatar/edd353047f46c68c4099a01b982122d8eb25102b56412f3850f766f0cc4c5e57?d=mp&s=160"},"body":"Hi folks --\n\nI'm stumped; git-stash simply won't work on my machine. On any\nrepository I've tried, with various permutations, I keep getting::\n\n    $ git stash\n    cp: `.../.git/index': No such file or directory\n    Cannot save the current worktree state\n\nI spent about an hour in #git this morning trying to track it down\n(log: http://colabti.org/irclogger/irclogger_log/git?date=2009-04-10#l1946).\nI've tried stashing with and without content added to the index; I've\nalso tried entirely removing .git/index and then recreating it via git\nreset. No dice.\n\nI'm entirely willing to entertain the possibility that this is my\nfault, but I am fairly familiar with git (been using it for about a\nyear) and so if it is fault it's gotta be something pretty subtle.\n\nI'm concerned by the fact that it doesn't work on *any* repository on\nmy machine, though. I think that points to a systematic problem.\n\nI'm on OS X 10.5.6; Git is 1.6.2.2, built and installed from source,\nthough the same problem happened with the old 1.6.0 I had yesterday,\nand also the 1.6.2.1 I installed via the OSX package.\n\nThanks!\n\nJacob\n"},{"id":"111016","messageId":"7vy6u8whbp.fsf@gitster.siamese.dyndns.org","threadId":"18828","inReplyTo":"be4ebbe10904100944p6ec2c0dao8607fcff75d2754e@mail.gmail.com","subject":"Re: git-stash fails on OSX 10.5","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-10T17:26:34Z","receivedAt":"2009-04-10T17:26:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacob Kaplan-Moss <jacob@jacobian.org> writes:\n\n> Hi folks --\n>\n> I'm stumped; git-stash simply won't work on my machine. On any\n> repository I've tried, with various permutations, I keep getting::\n>\n>     $ git stash\n>     cp: `.../.git/index': No such file or directory\n>     Cannot save the current worktree state\n\nAre you exporting \n\n\tGIT_INDEX_FILE=.../.git/index\n\ninto the environment, and that path perhaps does not exist?\n\nOtherwise the above error message wouldn't have said \".../.git/index\"; it\nis coming from the only invocation of \"cp\" command in git-stash.sh\n"},{"id":"111019","messageId":"be4ebbe10904101114w33c807d1je19b0c949e9a2009@mail.gmail.com","threadId":"18828","inReplyTo":"7vy6u8whbp.fsf@gitster.siamese.dyndns.org","subject":"Re: git-stash fails on OSX 10.5","fromName":"Jacob Kaplan-Moss","fromEmail":"jacob@jacobian.org","sentAt":"2009-04-10T18:14:33Z","receivedAt":"2009-04-10T18:14:33Z","isPatch":false,"sender":{"key":"jacob@jacobian.org","avatar":"https://gravatar.com/avatar/edd353047f46c68c4099a01b982122d8eb25102b56412f3850f766f0cc4c5e57?d=mp&s=160"},"body":"On Fri, Apr 10, 2009 at 12:26 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Otherwise the above error message wouldn't have said \".../.git/index\"; it\n> is coming from the only invocation of \"cp\" command in git-stash.sh\n\nSorry; I trimmed the error message to omit the details of where the\nrepository is since this happens regardless of the repo. The error\ngives the full path to the file, i.e. \"cp:\n`/Users/jacob/Projects/uri/.git/index': No such file or directory\".\n\nJacob\n"},{"id":"111204","messageId":"76718490904131057k2801a62bn14825b055b345dfe@mail.gmail.com","threadId":"18828","inReplyTo":"be4ebbe10904101114w33c807d1je19b0c949e9a2009@mail.gmail.com","subject":"Re: git-stash fails on OSX 10.5","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-04-13T17:57:04Z","receivedAt":"2009-04-13T17:57:04Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Fri, Apr 10, 2009 at 2:14 PM, Jacob Kaplan-Moss <jacob@jacobian.org> wrote:\n> Sorry; I trimmed the error message to omit the details of where the\n> repository is since this happens regardless of the repo. The error\n> gives the full path to the file, i.e. \"cp:\n> `/Users/jacob/Projects/uri/.git/index': No such file or directory\".\n\n1) Does \"ls -l /Users/jacob/Projects/uri/.git/index\" work?\n2) Does \"cp -v /Users/jacob/Projects/uri/.git/index /tmp/\" work?\n3) Anything unusual for OS X? e.g., Are you using FileVault? Are you\nusing a filesystem other than case-insensitive HFS+? Is your cp\ncommand something other than /bin/cp?\n\nj.\n"},{"id":"111207","messageId":"be4ebbe10904131113q5b221fe9kf7e0a0fe3bb7fdc6@mail.gmail.com","threadId":"18828","inReplyTo":"76718490904131057k2801a62bn14825b055b345dfe@mail.gmail.com","subject":"Re: git-stash fails on OSX 10.5","fromName":"Jacob Kaplan-Moss","fromEmail":"jacob@jacobian.org","sentAt":"2009-04-13T18:13:05Z","receivedAt":"2009-04-13T18:13:05Z","isPatch":false,"sender":{"key":"jacob@jacobian.org","avatar":"https://gravatar.com/avatar/edd353047f46c68c4099a01b982122d8eb25102b56412f3850f766f0cc4c5e57?d=mp&s=160"},"body":"Hey Jay --\n\nThanks for the questions; they helped me figure out a bit more:\n\nOn Mon, Apr 13, 2009 at 12:57 PM, Jay Soffian <jaysoffian@gmail.com> wrote:\n> 3) Anything unusual for OS X? e.g., Are you using FileVault? Are you\n> using a filesystem other than case-insensitive HFS+? Is your cp\n> command something other than /bin/cp?\n\nThe filesystem is case-*sensitive* HFS+:\n\n$ diskutil info disk0s2\n...\n   File System:              Case-sensitive Journaled HFS+\n\n... and cp is GNU cp, not Apple's:\n\n$ which cp\n/usr/local/bin/cp\n\nLooks like if I use Apple's cp then stash works again:\n\n$ mv /usr/local/bin/cp /usr/local/bin/cp~\n$ which cp\n/bin/cp\n$ git stash\nSaved working directory and index state \"WIP on master: 504b9bd\nUpdated README.\"HEAD is now at 504b9bd Updated README.\n(To restore them type \"git stash apply\")\n\nSo clearly there's some interaction between git-stash,\ncase-sensitivity, and GNU cp. Given that GNU cp works correctly when I\ndo it by hand (i.e. \"cp -v /Users/jacob/Projects/uri/.git/index /tmp/\"\nworks), I suspect that git-stash is getting the case wrong somewhere\nand Apple's cp is automatically correcting for that error.\n\nThat's my theory, anyway; my bash-fu isn't that good, so I've not been\nable to figure out a way to patch git-stash to work around the\nproblem. I've got a strange setup, I guess, so I understand if this is\na \"just don't do that\" kind of situation.\n\nThanks!\n\nJacob\n"}]}