Skip to content

Commit

Permalink
log: Deprecate passing git options
Browse files Browse the repository at this point in the history
  • Loading branch information
craigds committed Nov 19, 2021
1 parent b7478bc commit 7cc5082
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion kart/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
from . import diff_estimation


class RemovalInKart012Warning(UserWarning):
pass


class PreserveDoubleDash(click.Command):
"""
Preserves the double-dash ("--") arg from user input.
Expand All @@ -35,7 +39,7 @@ def parse_args(self, ctx, args):
# which ideally we'd like them to stop doing.
warnings.warn(
"Using '--' twice is no longer needed, and will behave differently or fail in Kart 0.12",
UserWarning,
RemovalInKart012Warning,
)
else:
# Insert a second `--` arg.
Expand Down Expand Up @@ -84,6 +88,12 @@ def parse_extra_args(
# So we can assume it's a CLI flag, presumably for git rather than kart.
# It *could* be a path, but in that case the user should add a `--` before this option
# to disambiguate, and they haven't done so here.
issue_link = "https://github.com/koordinates/kart/issues/508"
warnings.warn(
f"{arg!r} is unknown to Kart and will be passed directly to git. "
f"This will be removed in Kart 0.12! Please comment on {issue_link} if you need to use this option.",
RemovalInKart012Warning,
)
other_args.append(arg)
continue

Expand Down

0 comments on commit 7cc5082

Please sign in to comment.