jacogr / atom-git-control

Not maintained :(
MIT License
227 stars 70 forks source link

Compare doesn't work with deleted/moved/renamed files in the commit? #123

Open dflock opened 8 years ago

dflock commented 8 years ago

I get this output clicking Compare:

> git status --porcelain --untracked-files=all
> git fetch --prune
M  phemi_builder/README.md
M  phemi_builder/build_release.yml
A  phemi_builder/host_vars/bell.yml
M  phemi_builder/inventory/builder.ini
D  phemi_builder/package_build/tasks/main.yml
R  phemi_builder/roles/build_images/tasks/main.yml -> phemi_builder/roles/images_build/tasks/main.yml
R  phemi_builder/roles/save_images/tasks/main.yml -> phemi_builder/roles/images_save/tasks/main.yml
R  phemi_builder/roles/init_phemi_builder/files/id_rsa.phemi-builder -> phemi_builder/roles/init_phemi_builder/files/id_rsa
R  phemi_builder/roles/init_phemi_builder/files/id_rsa.phemi-builder.pub -> phemi_builder/roles/init_phemi_builder/files/id_rsa.pub
M  phemi_builder/roles/init_phemi_builder/tasks/main.yml
A  phemi_builder/roles/package_build/tasks/main.yml
A  phemi_builder/roles/upload_build/tasks/main.yml
A  phemi_builder/roles/workspace_folders/tasks/main.yml
R  phemi_builder/roles/setup_workspace/tasks/main.yml -> phemi_builder/roles/workspace_vars/tasks/main.yml
> git --no-pager diff phemi_builder/README.md phemi_builder/build_release.yml phemi_builder/host_vars/bell.yml phemi_builder/inventory/builder.ini phemi_builder/package_build/tasks/main.yml phemi_builder/roles/build_images/tasks/main.yml phemi_builder/roles/save_images/tasks/main.yml phemi_builder/roles/init_phemi_builder/files/id_rsa.phemi-builder phemi_builder/roles/init_phemi_builder/files/id_rsa.phemi-builder.pub phemi_builder/roles/init_phemi_builder/tasks/main.yml phemi_builder/roles/package_build/tasks/main.yml phemi_builder/roles/upload_build/tasks/main.yml phemi_builder/roles/workspace_folders/tasks/main.yml phemi_builder/roles/setup_workspace/tasks/main.yml

fatal: phemi_builder/package_build/tasks/main.yml: no such path in the working tree.
Use 'git <command> -- <path>...' to specify paths that do not exist locally.
'git --no-pager diff phemi_builder/README.md phemi_builder/build_release.yml phemi_builder/host_vars/bell.yml phemi_builder/inventory/builder.ini phemi_builder/package_build/tasks/main.yml phemi_builder/roles/build_images/tasks/main.yml phemi_builder/roles/save_images/tasks/main.yml phemi_builder/roles/init_phemi_builder/files/id_rsa.phemi-builder phemi_builder/roles/init_phemi_builder/files/id_rsa.phemi-builder.pub phemi_builder/roles/init_phemi_builder/tasks/main.yml phemi_builder/roles/package_build/tasks/main.yml phemi_builder/roles/upload_build/tasks/main.yml phemi_builder/roles/workspace_folders/tasks/main.yml phemi_builder/roles/setup_workspace/tasks/main.yml' exited with error code 128
MarcelMue commented 8 years ago

Okay, this seems to be because GIT tries to access a path that has been deleted as it wants to compare a file at that location.

I think the -N flag added to the git diff could solve this problem. PR once again welcome but it should be a "simple" change if it works.

pinx commented 8 years ago

+1

Phoscur commented 8 years ago

Ran into this today, got the working tree full of untracked files and lots of changes, trying to review my changes, I can't see the diff of another file, when I have selected one for commit.

Should'nt we just see the compare/diff of a file by default when selecting it?

ProPuke commented 7 years ago

This is a critical bug

It wipes files if you try viewing the changes to a rename.

Clicking the "view changes" button on a rename blindly executes:

git --no-pager diff oldFilename -> newFilename

This pipes the output of git --no-pager diff oldFilename - (which is empty on stdout) into newFilename, erasing it.

I've just lost some work to this :(

At the very least all commandline arguments need to be properly escaped, to avoid accidental side effects like this.