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

Bug: problem with file named with dash character

From
DBDaniel Lyubomirov -|- Digitalus Bulgaria <daniel@digitalus.bg>
Date
Jun 27, 2012, 07:32 UTC
Message-ID
<80a7ce17-3ee7-4f09-b984-b6685e163b87@office.digitalus.nl>
In-Reply-To
<52ae7682-3e9a-4b52-bec1-08ba3aadffc0@office.digitalus.nl>
Hi,

Аccidentally my colleague created a file in the root dir of the git repo called - (just dash). As result for every commit having this file, diff , merge, cherry-pick maybe others just hang. I tried to make rebase interactive to edit the commit and remove the file but that fails too.

system: Fedora Linux 3.4.2-1.fc16.x86_64 git version: 1.7.7.6

How to reproduce the bug:
1. create a file named -
2. add the file in the index and commit
3. try diff with another commit, branch
So far i found following workarounds:
1. You can delete the file. Then the problem stays in the history only for the commits that have the file.
2. Use git filter-branch and deleted the file from the history. 
   git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch -- -" <problem commit>..HEAD
   But this changes the history.
Thanks for your work.

Regards, Daniel Lyubomirov

Next: faux@goeswhere.com
Message 1 of 13 in “Bug: problem with file named with dash character”
  1. Daniel Lyubomirov -|- Digitalus BulgariaJun 27, 2012
  2. faux@goeswhere.comJun 27, 2012
  3. Junio C HamanoJun 27, 2012
  4. Jeff KingJun 27, 2012
  5. Jeff KingJun 27, 2012
  6. Junio C HamanoJun 27, 2012
  7. Junio C HamanoJun 27, 2012
  8. Junio C HamanoJun 27, 2012
  9. Junio C HamanoJun 27, 2012
  10. Junio C HamanoJun 27, 2012
  11. Jeff KingJun 27, 2012
  12. Junio C HamanoJun 27, 2012
  13. Jeff KingJun 27, 2012

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.