Skip to content

Source control: wrong messages and other issues #2194

Open
@gene-pavlovsky

Description

@gene-pavlovsky

It seems that there are a lot of source control dialog related bugs, many of them cause by the complexity of the various copy/move/refactor actions possible in FD and the way events are raised and processed. It would be hard to get rid of every such bug. It was discussed previously that there shouldn't even be an option to offer to create commits for actions: #1932 (comment)
I'm obviously going back to setting the "never create a commit for moving, deleting, ..." option to true (should be true by default in my opinion).

Some of the issues I found:

  1. I renamed a file in the project panel, and then I've got this excellent suggestion asking me if I would like to create a commit for this action, with this as a message:
    Moved src\Foo.hx$renaming$ to src\foo.hx
    Doesn't look right, does it?
    It's worth to mention that this only happens when the rename involves only a case change, and the strange message comes from this line in RenameFile.cs: string tmpPath = oldPath + "$renaming$";
    Same cause as Renaming class: avoid replace existing file warning if only case is changed (on Windows). #1288

  2. Another case of wrong message: Just adding a new folder foo via the project panel, commit dialog offers to create a commit with this message: "Moved src\New Folder to src\foo".

  3. A freshly created directory src/foo/ contains several source files (not under source control yet). Moving src/foo/ into /src/bar/.
    Answer yes to update references dialog.
    A commit dialog shows this message: "Moved src\bar\foo\Client.hx to src\bar\foo\Client.hx" (note the old path is wrong - equal to the new path). If I answer yes, a similar dialog pops up for each of the source files. If I answer no, no more dialogs appear.

  4. Move src/bar/foo/ back to src/ (assuming in the previous step I answered yes to all the commit dialogs, so all the files are now committed).
    Answer yes to update references dialog.
    A commit dialog shows this unexpected message: "Deleted src\bar\foo\Client.hx". If I answer yes, a similar dialog pops up for each of the source files. After I answer yes to all of them, an exception occurs in ProcessRunner, when it tries to run git commit -m \"Deleted ...\". The process.StartInfo.WorkingDirectory is set to "C:\\...\\src\\bar\\foo" - a directory which no longer exists since it was already moved into src/, therefore the "The directory name is invalid" exception from process.Start()`.

  5. Reset --hard the repo back to beginning (no more src/foo/, src/bar/).
    Create src/foo/bar/ (empty). The icons in the project panel show these directories as if they are under source control and up to date (green mark). This is debatable but I think they should show as not under source control (and that's how TortoiseGit shows them - with no icon).
    Now copy some source files from src/ to src/foo/bar/.
    Move src/foo/bar/ to src/.
    No source control commit dialogs are shown, even though this case is quite similar to case 3 described above.

It's worth to also test what happens in all those cases when answering No to "update references" dialog.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions