git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bo Yang <struggleyb.nku@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, trast@student.ethz.ch, dirson@bertin.fr
Subject: [PATCH] Warn the users when more than 3 '-C' given.
Date: Sat, 10 Apr 2010 19:51:48 +0800	[thread overview]
Message-ID: <1270900308-20147-1-git-send-email-struggleyb.nku@gmail.com> (raw)

Output a warning message to users when there are more than
3 '-C' options given. And ignore the numeric argument value
provided by the additional '-C' options.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
---
 builtin/blame.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/builtin/blame.c b/builtin/blame.c
index fc15863..e8ed547 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -2165,6 +2165,15 @@ static int blame_copy_callback(const struct option *option, const char *arg, int
 	int *opt = option->value;
 
 	/*
+	 * Warn the users when more than 3 '-C' options are given and
+	 * ignore the corresponding numeric argument of it.
+	 */
+	if (*opt & PICKAXE_BLAME_COPY_HARDEST) {
+		warning("The additional '-C' above 3 is not supported.");
+		return 0;
+	}
+
+	/*
 	 * -C enables copy from removed files;
 	 * -C -C enables copy from existing files, but only
 	 *       when blaming a new file;
-- 
1.7.0.2.273.gc2413.dirty

             reply	other threads:[~2010-04-10 11:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-10 11:51 Bo Yang [this message]
2010-04-10 19:12 ` [PATCH] Warn the users when more than 3 '-C' given Junio C Hamano
2010-04-12  6:48   ` Yann Dirson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1270900308-20147-1-git-send-email-struggleyb.nku@gmail.com \
    --to=struggleyb.nku@gmail.com \
    --cc=dirson@bertin.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=trast@student.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).