Colons in filenames cause git delete

141 views
Skip to first unread message

t_pa...@zennet.com

unread,
Mar 9, 2015, 12:17:29 PM3/9/15
to tortoise...@googlegroups.com
Hello, using tortoisegit to clone a repo with colons in the filenames results in "deleted" files notifications. A `git commit` with no changes to the repo shows the files are removed. After performing a `git push`, the files are actually deleted! Worse, a `git revert` does not restore the original files?!

It is possible to change our workflow to remove colons from filenames, but this is not the preferred method. I believe this is better handled with an exception or warning, rather than deleting files. :) This seems to be similar to this issue: https://code.google.com/p/tortoisegit/issues/detail?id=1399

OS: Windows 7 enterprise, SP1
Git:
TortoiseGit 1.8.13.0 (C:\Program Files\TortoiseGit\bin) 
git version 1.9.5.msysgit.0 (C:\Program Files (x86)\Git\bin) 

Yue Lin Ho

unread,
Mar 10, 2015, 3:10:38 AM3/10/15
to tortoise...@googlegroups.com, t_pa...@zennet.com
Hi:

t_pa...@zennet.com於 2015年3月10日星期二 UTC+8上午12時17分29秒寫道:
Hello, using tortoisegit to clone a repo with colons in the filenames results in "deleted" files notifications. A `git commit` with no changes to the repo shows the files are removed. After performing a `git push`, the files are actually deleted! Worse, a `git revert` does not restore the original files?!


The filename with colon is not allowed in Windows, 
so that it can't be created/checkout in Windows.
That why git shows it is deleted.
Since it can't be created, the revert is also not working.

I am interesting in your case.
could you please create a dummy testing repository in public place, such as GitHub?
So that I can do more investigation. Thank you. ^_^
 
It is possible to change our workflow to remove colons from filenames, but this is not the preferred method. I believe this is better handled with an exception or warning, rather than deleting files. :) This seems to be similar to this issue: https://code.google.com/p/tortoisegit/issues/detail?id=1399


You can create a new issue for your wish.
(the issue 1399 is more about "crash", I think. :P )

Yue Lin Ho






 

t_pa...@zennet.com

unread,
Mar 12, 2015, 12:51:11 PM3/12/15
to tortoise...@googlegroups.com, t_pa...@zennet.com
Thanks for your reply. I have created a test repo on git hub so you can test. Please let me know how you find it.


One other problem is that I am unable to create a new issue. Everytime I click a new issue on google code, it says that my google user account isn't allowed or authorised to create an issue. That is why I brought it up here. I would greatly appreciate if you opened an issue or perhaps gave a mail address where I could send the issue to be created?

Thanks in advance.

Yue Lin Ho

unread,
Mar 16, 2015, 4:54:50 AM3/16/15
to tortoise...@googlegroups.com, t_pa...@zennet.com
Hi:

Could you tell me
1. why using colons?
2. concrete wish => please fill the following table, then I will create a new issue for you.


Summary:
<fill here>

Description:
What steps will reproduce the problem?
1. <fill here>
2. <fill here>
3. <fill here>

What is the expected output?
<fill here>

What do you see instead?
<fill here>

What version of TortoiseGit and msysgit are you using?
<fill here>

On what operating system?
<fill here>

Please provide any additional information below.
<fill here>



t_pa...@zennet.com於 2015年3月13日星期五 UTC+8上午12時51分11秒寫道:

t_pa...@zennet.com

unread,
Mar 16, 2015, 12:25:29 PM3/16/15
to tortoise...@googlegroups.com, t_pa...@zennet.com
Thanks for your response and help.

1. We do not have to use colons, but as you can see from the example, we would like the git repository to mirror the actual ifcfg files,which have a colon in them natively (on Linux). We can use a separate name, but I don't think that is the real issue. I think the real issue is that tortoisegit should handle the case gracefully with a warning, or refusal to continue (rather than silently deleting files and not restoring them :)

2. Answers inline, below:


On Monday, 16 March 2015 01:54:50 UTC-7, Yue Lin Ho wrote:
Hi:

Could you tell me
1. why using colons?
2. concrete wish => please fill the following table, then I will create a new issue for you.


Summary:
<fill here>
Tortoisegit does not handle colons in filenames because Windows cannot have a filename with colons. Cloning a repo with these kinds of files results in deleted files from the repo if a push is done by the user.


Description:
What steps will reproduce the problem?
1. <fill here>
2. <fill here>
3. <fill here>

1. Clone repo with colons in one or more filenames
2. Commit local changes with no modifications (notice files are marked for deletion)
3. Push changes to origin
4. Revert commit hash from #2
5. Push changes to origin (notice files are not restored)

What is the expected output?
<fill here>

Expected

a) that files should not be deleted. There should be some facility for either handling filenames with colons or preventing user from accidentally deleting files.  Or at least a popup with a "warning, do you want to continue?"
b) git-revert should restore previous hash, but does not, so files are difficult to recover gracefully.

What do you see instead?
<fill here>

Files are removed if they have colons. Only messaging is the commit list of changes to the files.
Files are not restored with a git-revert <- I think this is the real concern

What version of TortoiseGit and msysgit are you using?
<fill here>

TortoiseGit 1.8.13.0 (C:\Program Files\TortoiseGit\bin) 
git version 1.9.5.msysgit.0 (C:\Program Files (x86)\Git\bin) 

On what operating system?
<fill here>

 Windows 7 enterprise, SP1

Please provide any additional information below.
<fill here>


Yue Lin Ho

unread,
Mar 17, 2015, 2:20:12 AM3/17/15
to tortoise...@googlegroups.com, t_pa...@zennet.com
Hi:

I did some CLI tests:
 1. try to rename that file
 2. try to use "--assume-unchanged"
 3. try to unstage that file
All of them are failed.
Suppose it is the issue of upstream(Git for Windows).
So, I post the issue/question first on msysgit group, instead on TortoiseGit Issue Tracking.

Do you still want to create a new issue of tortoisegit?


t_pa...@zennet.com於 2015年3月17日星期二 UTC+8上午12時25分29秒寫道:

t_pa...@zennet.com

unread,
Mar 17, 2015, 11:50:09 AM3/17/15
to tortoise...@googlegroups.com, t_pa...@zennet.com
Oh, thank you for figuring that out. I did not realise this was a different team. :) I will go over to the msysgit team and come back if we need help.

-T.
Reply all
Reply to author
Forward
0 new messages