Skip to content

Commit

Permalink
amend: Fix double negative in no-edit
Browse files Browse the repository at this point in the history
Otherwise in order to run with edit false by
default and manually setting it to true, you'd be
passing in --no-no-edit which is silly.
  • Loading branch information
jerry-skydio committed Jul 19, 2023
1 parent e897c54 commit 6244864
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 6244864

Please sign in to comment.