trevorr / vss2git

Migrate Visual SourceSafe repositories to Git
Apache License 2.0
153 stars 116 forks source link

git was told to move a file, but the file already exists #22

Open Ma-XX-oN opened 8 years ago

Ma-XX-oN commented 8 years ago

Still going through the repository and found another issue, where a file is attempted to be moved, but it already exists. Here is part of the log:

Replaying changeset 45064 from 01/04/2002 16:33:02
d:\Users\maxxon\Desktop\vss2git\CaseWare\4.3\Cwin32\cwmfc: Rename CoolTree.cpp to cwuitree.cpp
Executing: C:\Program Files\Git\cmd\git.exe mv -- d:\Users\maxxon\Desktop\vss2git\CaseWare\4.3\Cwin32\cwmfc\CoolTree.cpp d:\Users\maxxon\Desktop\vss2git\CaseWare\4.3\Cwin32\cwmfc\cwuitree.cpp
!fatal: destination exists, source=CaseWare/4.3/Cwin32/cwmfc/CoolTree.cpp, destination=CaseWare/4.3/Cwin32/cwmfc/cwuitree.cpp
ERROR: git returned exit code 128
Executable: C:\Program Files\Git\cmd\git.exe
Arguments: mv -- d:\Users\maxxon\Desktop\vss2git\CaseWare\4.3\Cwin32\cwmfc\CoolTree.cpp d:\Users\maxxon\Desktop\vss2git\CaseWare\4.3\Cwin32\cwmfc\cwuitree.cpp
Stdout:
Stderr: fatal: destination exists, source=CaseWare/4.3/Cwin32/cwmfc/CoolTree.cpp, destination=CaseWare/4.3/Cwin32/cwmfc/cwuitree.cpp
Hpdi.Vss2Git.ProcessExitException: git returned exit code 128
   at Hpdi.Vss2Git.GitWrapper.FailExitCode(String exec, String args, String stdout, String stderr, Int32 exitCode) in d:\Users\maxxon\Documents\Visual Studio 2013\Projects\vss2git-master\vss2git-master\Vss2Git\GitWrapper.cs:line 301
   at Hpdi.Vss2Git.GitWrapper.ExecuteUnless(ProcessStartInfo startInfo, String unless) in d:\Users\maxxon\Documents\Visual Studio 2013\Projects\vss2git-master\vss2git-master\Vss2Git\GitWrapper.cs:line 296
   at Hpdi.Vss2Git.GitWrapper.GitExec(String args) in d:\Users\maxxon\Documents\Visual Studio 2013\Projects\vss2git-master\vss2git-master\Vss2Git\GitWrapper.cs:line 263
   at Hpdi.Vss2Git.GitWrapper.Move(String sourcePath, String destPath) in d:\Users\maxxon\Documents\Visual Studio 2013\Projects\vss2git-master\vss2git-master\Vss2Git\GitWrapper.cs:line 144
   at Hpdi.Vss2Git.GitExporter.CaseSensitiveRename(String sourcePath, String destPath, RenameDelegate renamer) in d:\Users\maxxon\Documents\Visual Studio 2013\Projects\vss2git-master\vss2git-master\Vss2Git\GitExporter.cs:line 752
   at Hpdi.Vss2Git.GitExporter.ReplayRevision(VssPathMapper pathMapper, Revision revision, GitWrapper git, LinkedList`1 labels) in d:\Users\maxxon\Documents\Visual Studio 2013\Projects\vss2git-master\vss2git-master\Vss2Git\GitExporter.cs:line 375
   at Hpdi.Vss2Git.GitExporter.<>c__DisplayClass11.<ReplayChangeset>b__d() in d:\Users\maxxon\Documents\Visual Studio 2013\Projects\vss2git-master\vss2git-master\Vss2Git\GitExporter.cs:line 247
   at Hpdi.Vss2Git.GitExporter.AbortRetryIgnore(ThreadStart work, MessageBoxButtons buttons) in d:\Users\maxxon\Documents\Visual Studio 2013\Projects\vss2git-master\vss2git-master\Vss2Git\GitExporter.cs:line 594

I removed the destination file manually with git and continued on. I think that is the correct course of action.

Maxx

wqweto commented 8 years ago

This is fixed by this PR on the rustyx fork.

VasiliPupkin256 commented 6 years ago

But rusty doesn't pull his fork to trevorr

VasiliPupkin256 commented 6 years ago

wqweto, your fix is bad. This is a result of reckless commit combination done by vss2git. It should not combining commits if the last commit removes or overwrite a file changed by the previous commit

wqweto commented 6 years ago

You are right, of course. This was a quick fix to get something working.

The root cause of the issue seems to be that vss2git does not handle folder renames (VSS calls these "projects") very well.