-
Notifications
You must be signed in to change notification settings - Fork 110
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
ENH: Complain like Git if to-be-removed sibling is unknown #4257
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4257 +/- ##
==========================================
- Coverage 89.43% 88.74% -0.69%
==========================================
Files 275 282 +7
Lines 36182 36891 +709
==========================================
+ Hits 32358 32739 +381
- Misses 3824 4152 +328
Continue to review full report at Codecov.
|
As far as I can see, the failing tests don't seem to be related to the change in this PR... |
datalad/distribution/siblings.py
Outdated
@@ -301,6 +301,10 @@ def __call__( | |||
@staticmethod | |||
def custom_result_renderer(res, **kwargs): | |||
from datalad.ui import ui | |||
# should we attempt to remove an unknown sibling, complain like Git does | |||
if res['status'] == 'notneeded' and res['action'] == 'remove-sibling': | |||
ui.message('fatal: No such remote: {name}'.format(**dict(res))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks like an improvement to me. I have the following suggestions, some nit-picks:
-
You could just use
**res
instead of passingres
todict
. -
While I think we should complain in the spirit of
git remote rm
, I think it'd be better to not complain exactly like it. In particular, I'd say we should drop "fatal: " and replace "remote" with "sibling". -
The message should include some indication of the path so that recursive operation gives a clearer message:
% datalad subdatasets subdataset(ok): subds (dataset) % datalad siblings -r remove -s nonexistent fatal: No such remote: nonexistent fatal: No such remote: nonexistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these comments, I think I have addressed them now.
Yep, this is unlikely to cause issues given that functionally this is just adding a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thx! I took the liberty to add the standard warning color to the output.
uhhh, cool, color! |
Travis failure is unrelated and there is no chance that the type of change I made would fail in this test run only. |
fixes #4249