Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
add default arguments for diff and pr-diff if no arg given (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
PCSwingle authored Nov 21, 2023
1 parent b4a88c4 commit 5661c91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mentat/diff_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ def __init__(

meta = get_treeish_metadata(git_root, target)
name += f'{meta["hexsha"][:8]}: {meta["summary"]}'
if target == "HEAD":
name = "HEAD (last commit)"

self.target = target
self.name = name
Expand Down
2 changes: 2 additions & 0 deletions mentat/terminal/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ def run_cli():
parser.add_argument(
"--diff",
"-d",
nargs="?",
type=str,
default=None,
const="HEAD",
help="A git tree-ish (e.g. commit, branch, tag) to diff against",
)
parser.add_argument(
Expand Down

0 comments on commit 5661c91

Please sign in to comment.