X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-push.c;h=3cb1ee46d1da898c2be5666a93002ca43df80093;hb=264b774ba6b27cc07ef4c33d52e491d9abf029bb;hp=67f6d96fbeb180b6438172207ff5290c7344cc67;hpb=1d7d6ad539fabd49421d8ef7b27c0f287430bc7d;p=git.git diff --git a/builtin-push.c b/builtin-push.c index 67f6d96fb..3cb1ee46d 100644 --- a/builtin-push.c +++ b/builtin-push.c @@ -10,7 +10,7 @@ #include "parse-options.h" static const char * const push_usage[] = { - "git push [--all | --mirror] [--dry-run] [--porcelain] [--tags] [--receive-pack=] [--repo=] [-f | --force] [-v] [ ...]", + "git push [--all | --mirror] [-n | --dry-run] [--porcelain] [--tags] [--receive-pack=] [--repo=] [-f | --force] [-v] [ ...]", NULL, }; @@ -157,10 +157,10 @@ static int do_push(const char *repo, int flags) continue; error("failed to push some refs to '%s'", url[i]); - if (nonfastforward) { - printf("To prevent you from losing history, non-fast-forward updates were rejected.\n" - "Merge the remote changes before pushing again.\n" - "See 'non-fast forward' section of 'git push --help' for details.\n"); + if (nonfastforward && advice_push_nonfastforward) { + printf("To prevent you from losing history, non-fast-forward updates were rejected\n" + "Merge the remote changes before pushing again. See the 'non-fast forward'\n" + "section of 'git push --help' for details.\n"); } errs++; } @@ -182,7 +182,7 @@ int cmd_push(int argc, const char **argv, const char *prefix) OPT_BIT( 0 , "mirror", &flags, "mirror all refs", (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)), OPT_BOOLEAN( 0 , "tags", &tags, "push tags"), - OPT_BIT( 0 , "dry-run", &flags, "dry run", TRANSPORT_PUSH_DRY_RUN), + OPT_BIT('n' , "dry-run", &flags, "dry run", TRANSPORT_PUSH_DRY_RUN), OPT_BIT( 0, "porcelain", &flags, "machine-readable output", TRANSPORT_PUSH_PORCELAIN), OPT_BIT('f', "force", &flags, "force updates", TRANSPORT_PUSH_FORCE), OPT_BOOLEAN( 0 , "thin", &thin, "use thin pack"),