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

git gui bug: filenames starting with ~

From
PCPeter Cordes <peter@cordes.ca>
Date
Mar 29, 2015, 00:25 UTC
Message-ID
<20150329002535.GA3933@cordes.ca>
  I didn't check if git claims to support arbitrary filenames.  If a
leading ~ isn't allowed, then this isn't a bug.

I'm using git-gui version 0.19.GITGUI, from git version 2.3.4, from the Ubuntu PPA. git 2:2.3.4-1avh1~utopic1

steps to reproduce:

mkdir -p git-shellmeta && cd git-shellmeta git init touch '~bin' '~xyz' git gui &

In the gui, ~bin appears in the list of files with unstaged changes. However, instead of appearing as a file, the diff pane shows Git Repository (subproject)

Selecting ~xyz pops up a dialog saying: 

Error loading file: user "xyz" doesn't exist

So I guess username expansion is happening somewhere it shouldn't.

The home directory of the "bin" user on my system is /bin, which is not a (subdir of a) git repo. The message that ~bin is a subproject is another symptom of this bug.

PS. no, I didn't name that ~bin file. Someone else left it lying around in a directory.

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter@cor , des.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BC
Message 1 of 1 in “git gui bug: filenames starting with ~”
  1. Peter CordesMar 29, 2015

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.