Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert does not produce errors for unknown files #58

Closed
zombiezen opened this issue Jul 12, 2018 · 0 comments
Closed

revert does not produce errors for unknown files #58

zombiezen opened this issue Jul 12, 2018 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@zombiezen
Copy link
Member

zombiezen commented Jul 12, 2018

This is an unfortunate consequence of how Git deals with pathspecs as filters. For some definitions of revert, it is technically correct, since it is ensuring that a non-existent file is non-existent in the working copy, but it's almost certainly not what anybody wants and is likely a typo.

This introduced in 1ff07cf. I don't have a good way of fixing this in general without dropping down to calling a Git subprocess for each argument, which does not perform well. I'll note it in the 0.6 release notes and try to figure out the right solution later. At worst, it's a slight annoyance rather than something that behaves radically incorrectly.

Steps to Reproduce

$ gg init
$ gg revert bar.txt

Expected Behavior

gg fails with an error that says that bar.txt is not a known file.

Actual Behavior

gg revert returns success and does nothing.

Version Info

gg built from source at 1ff07cfca9c38805dffd700cb665273f64b62181 on 2018-07-12T22:34:36Z
go: go1.10.3 gc linux/amd64
git version 2.18.0
@zombiezen zombiezen added the bug Something isn't working label Jul 12, 2018
@zombiezen zombiezen added this to the 0.8 milestone Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant