From: Jacob Keller <jacob.e.keller@intel.com>
To: git@vger.kernel.org
Cc: Jacob Keller <jacob.keller@gmail.com>
Subject: [PATCH] describe: bail of --contains --all is used with --exclude or --match
Date: Tue, 26 Feb 2019 13:53:48 -0800 [thread overview]
Message-ID: <20190226215348.5119-1-jacob.e.keller@intel.com> (raw)
From: Jacob Keller <jacob.keller@gmail.com>
If you try to use git describe --contains with --all, the exclude and
match patterns are silently ignored.
This results in unexpected behavior, as you may try to provide patterns
and expect it to change the result.
Check for this, and have describe die when it encounters this, instead
of silently ignoring the provided options.
Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
---
I just found this while trying to use it, the patterns weren't being applied
properly.
This is pretty quick/dirty, I haven't had time to write a test, or anything.
builtin/describe.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/builtin/describe.c b/builtin/describe.c
index 1409cedce2fb..1bf4b6e3d0ae 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -589,6 +589,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
argv_array_pushf(&args, "--refs=refs/tags/%s", item->string);
for_each_string_list_item(item, &exclude_patterns)
argv_array_pushf(&args, "--exclude=refs/tags/%s", item->string);
+ } else {
+ if (patterns.nr || exclude_patterns.nr)
+ die(_("--contains with --all does not support --match or --exclude"));
}
if (argc)
argv_array_pushv(&args, argv);
--
2.18.0.219.gaf81d287a9da
next reply other threads:[~2019-02-26 21:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-26 21:53 Jacob Keller [this message]
2019-02-26 23:34 ` [PATCH] describe: bail of --contains --all is used with --exclude or --match Eric Sunshine
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=20190226215348.5119-1-jacob.e.keller@intel.com \
--to=jacob.e.keller@intel.com \
--cc=git@vger.kernel.org \
--cc=jacob.keller@gmail.com \
/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).