git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] builtin/trailers: don't always run all commands
@ 2016-04-06 19:13 Michael S. Tsirkin
  0 siblings, 0 replies; only message in thread
From: Michael S. Tsirkin @ 2016-04-06 19:13 UTC (permalink / raw
  To: git; +Cc: Junio C Hamano, Christian Couder, Michael S. Tsirkin,
	Matthieu Moy, git

If an explicit -t trailer is used, only parse
trailers from command line.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 trailer.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/trailer.c b/trailer.c
index 8e5be91..34654fc 100644
--- a/trailer.c
+++ b/trailer.c
@@ -676,10 +676,14 @@ static struct trailer_item *process_command_line_args(struct string_list *traile
 	struct trailer_item *item;
 
 	/* Add a trailer item for each configured trailer with a command */
-	for (item = first_conf_item; item; item = item->next) {
-		if (item->conf.command) {
-			struct trailer_item *new = new_trailer_item(item, NULL, NULL);
-			add_trailer_item(&arg_tok_first, &arg_tok_last, new);
+	if (!trailers->nr) {
+		for (item = first_conf_item; item; item = item->next) {
+			if (item->conf.command) {
+				struct trailer_item *new =
+					new_trailer_item(item, NULL, NULL);
+				add_trailer_item(&arg_tok_first,
+						 &arg_tok_last, new);
+			}
 		}
 	}
 
-- 
MST

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-06 19:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06 19:13 [PATCH] builtin/trailers: don't always run all commands Michael S. Tsirkin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).