Skip to content

Make default diff mode --git when using no arguments#1856

Merged
mtdowling merged 1 commit intomainfrom
git-diff-default-mode
Jul 13, 2023
Merged

Make default diff mode --git when using no arguments#1856
mtdowling merged 1 commit intomainfrom
git-diff-default-mode

Conversation

@mtdowling
Copy link
Copy Markdown
Member

Issue #, if available:

Description of changes:

Rather than fail when smithy diff is called with no arguments, we will insteadd assume that the caller meant smithy diff --mode git and use git mode against HEAD.

So now:

smithy diff # mode is --diff
smithy diff --old some-file --new some-file # mode is --arbitary
smithy diff --old some-file # Fails due to --arbitrary missing --new
smithy diff --new some-file # Fails due to --arbitrary missing --old

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Rather than fail when `smithy diff` is called with no arguments, we
will insteadd assume that the caller meant `smithy diff --mode git`
and use `git` mode against HEAD.

So now:

```
smithy diff # mode is --diff
smithy diff --old some-file --new some-file # mode is --arbitary
smithy diff --old some-file # Fails due to --arbitrary missing --new
smithy diff --new some-file # Fails due to --arbitrary missing --old
```
@mtdowling mtdowling requested a review from a team as a code owner July 13, 2023 18:01
@mtdowling mtdowling merged commit 0b93610 into main Jul 13, 2023
@mtdowling mtdowling deleted the git-diff-default-mode branch September 11, 2023 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants