git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Problem with filename containing '?'

From
Jeff King <peff@peff.net>
Date
Mar 29, 2019, 13:33 UTC
Message-ID
<20190329133349.GA21802@sigill.intra.peff.net>
In-Reply-To
<1c1c5d858d8b431fb96b1d48044c00b7@bs-ag.com>
On Fri, Mar 29, 2019 at 01:10:19PM +0000, Kurt Ablinger wrote:
Show 11 quoted lines
> in Linux the git-client accepts (add, commit, push) files with '?' (questionmark)  in its name.
> 
> When cloning such a repository into Eclipse (eGit/jGit) the
> repository-clone is rejected with an 'Invalid Path'-message with the
> ?-filename.
> 
> Under Linux it is possible to create a clone (the same git-binary used
> to checkin the ?-file) without any message.
> But the directory containing the ?-file is silently discarded whatever
> you checkout (master/HEAD, first or any other commit containing this
> file).
It seems to work fine for me with a few simple exercises:
  git init repo
  cd repo
  mkdir subdir
  echo foo >'subdir/bar?'
  git add .
  git commit -m 'file with question mark in name'
  git clone --no-local . child
  cd child
  ls -l
  echo changes >'subdir/bar?'
  git commit -am 'changes'
  git show
It also seems to clone fine with jgit:
  jgit clone $PWD/repo jgit-clone
Can you show us more exactly what you're running, and what doesn't work?

Also, 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.:

  $ echo foo >"$(printf 'funny\1char')"
  $ ls
  funny?char
  $ ls | cat -A
  funny^Achar$
  $ ls | xxd
  00000000: 6675 6e6e 7901 6368 6172 0a              funny.char.

If it's some more exotic character, then that may be why jgit rejects it.

-Peff
Previous: Kurt AblingerNext: Kurt Ablinger
Message 2 of 3 in “Problem with filename containing '?'”
  1. Kurt AblingerMar 29, 2019
  2. Jeff KingMar 29, 2019
  3. AW: Problem with filename containing '?'Kurt Ablinger, Apr 1, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.