{"thread":{"id":"39652","subject":"'git status -z' missing separators on OSX","startedAt":"2015-06-16T23:21:56Z","lastAt":"2015-06-17T21:32:34Z","messageCount":3,"participants":["Tad Hardesty","Jeff King","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"263981","messageId":"5580AF94.6090801@platymuus.com","threadId":"39652","inReplyTo":null,"subject":"'git status -z' missing separators on OSX","fromName":"Tad Hardesty","fromEmail":"tad@platymuus.com","sentAt":"2015-06-16T23:21:56Z","receivedAt":"2015-06-16T23:21:56Z","isPatch":false,"sender":{"key":"tad@platymuus.com","avatar":null},"body":"I have been experiencing a problem where git on OSX prints incorrect\noutput to the `git status -z` command, where instead of NUL separators\nrecords are simply not separated. This is causing problems with IDE\nintegration. While I have a workaround involving manually replacing \\n\nwith \\0, it would be nice to identify and fix the root issue.\n\nHere's a terminal session showing the problem:\n~$ mkdir test && cd test\n~/test$ git init\nInitialized empty Git repository in /Users/thardesty/test/.git/\n~/test (master #)$ touch a b\n~/test (master #)$ ls\na b\n~/test (master #)$ git status -z | hexdump -C\n00000000  3f 3f 20 61 3f 3f 20 62                           |?? a?? b|\n00000008\n~/test (master #)$ git add a b\n~/test (master #)$ git status -z | hexdump -C\n00000000  41 20 20 61 41 20 20 62                           |A  aA  b|\n00000008\n~/test (master #)$ git status --porcelain | hexdump -C\n00000000  41 20 20 61 0a 41 20 20  62 0a                    |A  a.A  b.|\n0000000a\n~/test (master #)$ git --version\ngit version 2.4.3\n~/test (master #)$ uname -a\nDarwin HA002070 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05\nPDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64\n\nAs shown, --porcelain prints a newline but -z yields no separator at all.\n\nThe Mac is running OS X Yosemite 10.10.3. I have tried git 2.3.2 from\nApple, git 2.4.2 from brew, and git 2.4.3 from brew, git-scm.org, and\nself-compiled, and these all exhibit the problem. Some helpful folks on\nthe #git IRC tried the commands for me and didn't see any problems, but\nI temporarily blanked all my configuration files and that didn't help. I\ndouble-checked and git on Linux has the correct behavior.\n\nThanks for any help.\n"},{"id":"263985","messageId":"20150617033211.GA24673@peff.net","threadId":"39652","inReplyTo":"5580AF94.6090801@platymuus.com","subject":"Re: 'git status -z' missing separators on OSX","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-06-17T03:32:12Z","receivedAt":"2015-06-17T03:32:12Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 16, 2015 at 06:21:56PM -0500, Tad Hardesty wrote:\n\n> ~/test (master #)$ git status -z | hexdump -C\n> 00000000  41 20 20 61 41 20 20 62                           |A  aA  b|\n> 00000008\n\nThat's really weird. I don't have a Yosemite box available, but I can't\nreproduce on the Mavericks box I have access to. Still, I'd suspect\nsomething weird in your config (e.g., something that is inserting itself\non the output pipe of \"git status\").\n\nYou said you blanked your config, but can you do \"git config --list\"\nto double-check? Also, try running with GIT_TRACE=1, which would show if\ngit is starting a pager between your processes which might be eating the\nNUL.\n\nCan you also double-check that you have no aliases for \"git\" (try \"type\ngit\"). We have sometimes seen weird behavior when people have aliased\n\"git\" to \"hub\".\n\nIs it only \"git status\" that is affected? Does \"git log --oneline -1 -z\"\nend in a NUL (it should)?\n\n-Peff\n"},{"id":"264091","messageId":"CAPig+cQtHjF=KiK0V3+t6bnULVeOOkyhovto=CPfmvNPVkxGLA@mail.gmail.com","threadId":"39652","inReplyTo":"20150617033211.GA24673@peff.net","subject":"Re: 'git status -z' missing separators on OSX","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-06-17T21:32:34Z","receivedAt":"2015-06-17T21:32:34Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Jun 16, 2015 at 11:32 PM, Jeff King <peff@peff.net> wrote:\n> On Tue, Jun 16, 2015 at 06:21:56PM -0500, Tad Hardesty wrote:\n>> ~/test (master #)$ git status -z | hexdump -C\n>> 00000000  41 20 20 61 41 20 20 62                           |A  aA  b|\n>> 00000008\n>\n> That's really weird. I don't have a Yosemite box available, but I can't\n> reproduce on the Mavericks box I have access to. Still, I'd suspect\n> something weird in your config (e.g., something that is inserting itself\n> on the output pipe of \"git status\").\n\nI also am unable to reproduce this behavior (using Yosemite).\n\b\n"}]}