git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Problem with filename containing '?'
@ 2019-03-29 13:10 Kurt Ablinger
  2019-03-29 13:33 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Kurt Ablinger @ 2019-03-29 13:10 UTC (permalink / raw)
  To: git@vger.kernel.org

Hello,

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).

Git-version is 2.17.0
Linux - Cent/OS: 2.6.32-754.10.1.el6.x86_64 - GNU/Linux

More information needed ?

Greetings and a have nice weekend
Kurt


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with filename containing '?'
  2019-03-29 13:10 Problem with filename containing '?' Kurt Ablinger
@ 2019-03-29 13:33 ` Jeff King
  2019-04-01  6:20   ` AW: " Kurt Ablinger
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2019-03-29 13:33 UTC (permalink / raw)
  To: Kurt Ablinger; +Cc: git@vger.kernel.org

On Fri, Mar 29, 2019 at 01:10:19PM +0000, Kurt Ablinger wrote:

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* AW: Problem with filename containing '?'
  2019-03-29 13:33 ` Jeff King
@ 2019-04-01  6:20   ` Kurt Ablinger
  0 siblings, 0 replies; 3+ messages in thread
From: Kurt Ablinger @ 2019-04-01  6:20 UTC (permalink / raw)
  To: Jeff King; +Cc: git@vger.kernel.org

Good morning,

sorry to waste your time - my check was incomplete - the file in question is there.

But the problem with eGit/jGit on Windows (Eclipse) persists. I did not check jGit in linux.

The problem seems to be, that linux accepts ? in filenames - but windows does not - so no problem wit git (native or java).

Anyway - maybe this could be an option for a future version of git:

	accept only 'compatible' file/path-names
or
	valid file/path-name-pattern

this could be useful for usage on different platforms.

Sorry again, thanks and greetings
Kurt


-----Ursprüngliche Nachricht-----
Von: Jeff King <peff@peff.net> 
Gesendet: Freitag, 29. März 2019 14:34
An: Kurt Ablinger <kurt.ablinger@bs-ag.com>
Cc: git@vger.kernel.org
Betreff: Re: Problem with filename containing '?'

On Fri, Mar 29, 2019 at 01:10:19PM +0000, Kurt Ablinger wrote:

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-01  6:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29 13:10 Problem with filename containing '?' Kurt Ablinger
2019-03-29 13:33 ` Jeff King
2019-04-01  6:20   ` AW: " Kurt Ablinger

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).