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

setup: update error message to be more meaningful #393

Closed
wants to merge 1 commit into from

Conversation

sivaraam
Copy link
Member

The error message shown when a flag is found when expecting a
filename wasn't clear as it didn't communicate what was wrong
using the 'suitable' words in all cases.

    $ git ls-files
    README.md
    test-file

Correct case,

    $ git rev-parse README.md --flags
    README.md
    --flags
    fatal: bad flag '--flags' used after filename

Incorrect case,

    $ git grep "some random regex" -n
    fatal: bad flag '-n' used after filename

The above case is incorrect as "some random regex" isn't a filename
in this case.

Change the error message to be general and communicative. This results
in the following output,

    $ git rev-parse README.md --flags
    README.md
    --flags
    fatal: option '--flags' must come before non-option arguments

    $ git grep "some random regex" -n
    fatal: option '-n' must come before non-option arguments

Signed-off-by: Kaartic Sivaraam kaarticsivaraam91196@gmail.com

The error message shown when a flag is found when expecting a
filename wasn't clear as it didn't communicate what was wrong
using the 'suitable' words in *all* cases.

        $ git ls-files
        README.md
        test-file

Correct case,

        $ git rev-parse README.md --flags
        README.md
        --flags
        fatal: bad flag '--flags' used after filename

Incorrect case,

        $ git grep "some random regex" -n
        fatal: bad flag '-n' used after filename

The above case is incorrect as "some random regex" isn't a filename
in this case.

Change the error message to be general and communicative. This results
in the following output,

        $ git rev-parse README.md --flags
        README.md
        --flags
        fatal: option '--flags' must come before non-option arguments

        $ git grep "some random regex" -n
        fatal: option '-n' must come before non-option arguments

Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
@submitgit
Copy link
Member

@sivaraam sent this commit (5800c63...b7cd847) as a patch to the mailing list with submitGit - here on public-inbox, MARC

@sivaraam sivaraam closed this Jul 29, 2017
@sivaraam sivaraam deleted the setup-msg-fix-WIP$ branch September 16, 2017 10:53
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Jul 22, 2021
Add instructions for `apt-get` install to `README`
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Aug 10, 2021
Add instructions for `apt-get` install to `README`
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Aug 15, 2021
Add instructions for `apt-get` install to `README`
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Aug 17, 2021
Add instructions for `apt-get` install to `README`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants