{"thread":{"id":"50838","subject":"Problem with filename containing '?'","startedAt":"2019-03-29T13:19:45Z","lastAt":"2019-04-01T06:20:35Z","messageCount":3,"participants":["Kurt Ablinger","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"372698","messageId":"1c1c5d858d8b431fb96b1d48044c00b7@bs-ag.com","threadId":"50838","inReplyTo":null,"subject":"Problem with filename containing '?'","fromName":"Kurt Ablinger","fromEmail":"kurt.ablinger@bs-ag.com","sentAt":"2019-03-29T13:10:19Z","receivedAt":"2019-03-29T13:19:45Z","isPatch":false,"sender":{"key":"kurt.ablinger@bs-ag.com","avatar":null},"body":"Hello,\n\nin Linux the git-client accepts (add, commit, push) files with '?' (questionmark)  in its name.\n\nWhen cloning such a repository into Eclipse (eGit/jGit) the repository-clone is rejected with an 'Invalid Path'-message with the ?-filename.\n\nUnder Linux it is possible to create a clone (the same git-binary used to checkin the ?-file) without any message.\nBut the directory containing the ?-file is silently discarded whatever you checkout (master/HEAD, first or any other commit containing this file).\n\nGit-version is 2.17.0\nLinux - Cent/OS: 2.6.32-754.10.1.el6.x86_64 - GNU/Linux\n\nMore information needed ?\n\nGreetings and a have nice weekend\nKurt\n\n"},{"id":"372699","messageId":"20190329133349.GA21802@sigill.intra.peff.net","threadId":"50838","inReplyTo":"1c1c5d858d8b431fb96b1d48044c00b7@bs-ag.com","subject":"Re: Problem with filename containing '?'","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-03-29T13:33:49Z","receivedAt":"2019-03-29T13:33:53Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Mar 29, 2019 at 01:10:19PM +0000, Kurt Ablinger wrote:\n\n> in Linux the git-client accepts (add, commit, push) files with '?' (questionmark)  in its name.\n> \n> When cloning such a repository into Eclipse (eGit/jGit) the\n> repository-clone is rejected with an 'Invalid Path'-message with the\n> ?-filename.\n> \n> Under Linux it is possible to create a clone (the same git-binary used\n> to checkin the ?-file) without any message.\n> But the directory containing the ?-file is silently discarded whatever\n> you checkout (master/HEAD, first or any other commit containing this\n> file).\n\nIt seems to work fine for me with a few simple exercises:\n\n  git init repo\n  cd repo\n  mkdir subdir\n  echo foo >'subdir/bar?'\n  git add .\n  git commit -m 'file with question mark in name'\n\n  git clone --no-local . child\n  cd child\n  ls -l\n  echo changes >'subdir/bar?'\n  git commit -am 'changes'\n  git show\n\nIt also seems to clone fine with jgit:\n\n  jgit clone $PWD/repo jgit-clone\n\nCan you show us more exactly what you're running, and what doesn't work?\n\nAlso, one other question: are you sure it's actually a question mark in\nthe name? If there are non-ascii garbage characters, \"ls\" will typically\nshow a question mark when output is going to the terminal. E.g.:\n\n  $ echo foo >\"$(printf 'funny\\1char')\"\n  $ ls\n  funny?char\n  $ ls | cat -A\n  funny^Achar$\n  $ ls | xxd\n  00000000: 6675 6e6e 7901 6368 6172 0a              funny.char.\n\nIf it's some more exotic character, then that may be why jgit rejects\nit.\n\n-Peff\n"},{"id":"372854","messageId":"5b0bf4aab0e443408675e53ba2d39f62@bs-ag.com","threadId":"50838","inReplyTo":"20190329133349.GA21802@sigill.intra.peff.net","subject":"AW: Problem with filename containing '?'","fromName":"Kurt Ablinger","fromEmail":"kurt.ablinger@bs-ag.com","sentAt":"2019-04-01T06:20:29Z","receivedAt":"2019-04-01T06:20:35Z","isPatch":false,"sender":{"key":"kurt.ablinger@bs-ag.com","avatar":null},"body":"Good morning,\n\nsorry to waste your time - my check was incomplete - the file in question is there.\n\nBut the problem with eGit/jGit on Windows (Eclipse) persists. I did not check jGit in linux.\n\nThe problem seems to be, that linux accepts ? in filenames - but windows does not - so no problem wit git (native or java).\n\nAnyway - maybe this could be an option for a future version of git:\n\n\taccept only 'compatible' file/path-names\nor\n\tvalid file/path-name-pattern\n\nthis could be useful for usage on different platforms.\n\nSorry again, thanks and greetings\nKurt\n\n\n-----Ursprüngliche Nachricht-----\nVon: Jeff King <peff@peff.net> \nGesendet: Freitag, 29. März 2019 14:34\nAn: Kurt Ablinger <kurt.ablinger@bs-ag.com>\nCc: git@vger.kernel.org\nBetreff: Re: Problem with filename containing '?'\n\nOn Fri, Mar 29, 2019 at 01:10:19PM +0000, Kurt Ablinger wrote:\n\n> in Linux the git-client accepts (add, commit, push) files with '?' (questionmark)  in its name.\n> \n> When cloning such a repository into Eclipse (eGit/jGit) the \n> repository-clone is rejected with an 'Invalid Path'-message with the \n> ?-filename.\n> \n> Under Linux it is possible to create a clone (the same git-binary used \n> to checkin the ?-file) without any message.\n> But the directory containing the ?-file is silently discarded whatever \n> you checkout (master/HEAD, first or any other commit containing this \n> file).\n\nIt seems to work fine for me with a few simple exercises:\n\n  git init repo\n  cd repo\n  mkdir subdir\n  echo foo >'subdir/bar?'\n  git add .\n  git commit -m 'file with question mark in name'\n\n  git clone --no-local . child\n  cd child\n  ls -l\n  echo changes >'subdir/bar?'\n  git commit -am 'changes'\n  git show\n\nIt also seems to clone fine with jgit:\n\n  jgit clone $PWD/repo jgit-clone\n\nCan you show us more exactly what you're running, and what doesn't work?\n\nAlso, one other question: are you sure it's actually a question mark in the name? If there are non-ascii garbage characters, \"ls\" will typically show a question mark when output is going to the terminal. E.g.:\n\n  $ echo foo >\"$(printf 'funny\\1char')\"\n  $ ls\n  funny?char\n  $ ls | cat -A\n  funny^Achar$\n  $ ls | xxd\n  00000000: 6675 6e6e 7901 6368 6172 0a              funny.char.\n\nIf it's some more exotic character, then that may be why jgit rejects it.\n\n-Peff\n"}]}