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

amend: Fix double negative in no-edit #118

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions revup/amend.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ async def get_has_unstaged() -> bool:
)

has_diff = has_staged or has_unstaged or args.drop
if not has_diff and args.no_edit:
if not has_diff and not args.edit:
return 0
if args.insert and args.no_edit:
if args.insert and not args.edit:
raise RevupUsageException("Can't skip wording an inserted commit!")

if args.drop and args.insert:
Expand Down Expand Up @@ -164,7 +164,7 @@ async def get_has_unstaged() -> bool:
stack[0].committer_date = ""
stack[0].commit_msg = ""

if not args.no_edit and not args.drop:
if args.edit and not args.drop:
new_msg = invoke_editor_for_commit_msg(
git_ctx,
git_ctx.editor,
Expand Down
2 changes: 1 addition & 1 deletion revup/revup.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ async def main() -> int:
restack_parser.add_argument("--topicless-last", "-t", action="store_true")

amend_parser.add_argument("ref_or_topic", nargs="?")
amend_parser.add_argument("--no-edit", "--skip-reword", "-s", action="store_true")
amend_parser.add_argument("--edit", "-s", default=True, action="store_true")
amend_parser.add_argument("--insert", "-i", action="store_true")
amend_parser.add_argument("--drop", "-d", action="store_true")
amend_parser.add_argument("--all", "-a", action="store_true")
Expand Down