Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 2/3] setup_revisions(): do not call get_pathspec() too early
Date: Fri, 20 Nov 2009 03:25:14 -0800	[thread overview]
Message-ID: <1258716315-2213-3-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1258716315-2213-1-git-send-email-gitster@pobox.com>

This is necessary because in the next patch I'll allow pathspecs to be fed
from the standard input, and pathspecs taken from the command line (and
converted via get_pathspec() already) in revs->prune_data too early gets
in the way when we want to append from the standard input.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 revision.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/revision.c b/revision.c
index f5b735f..4410a45 100644
--- a/revision.c
+++ b/revision.c
@@ -1230,6 +1230,7 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
 int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def)
 {
 	int i, flags, left, seen_dashdash, read_from_stdin;
+	const char **prune_data = NULL;
 
 	/* First, search for "--" */
 	seen_dashdash = 0;
@@ -1240,7 +1241,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
 		argv[i] = NULL;
 		argc = i;
 		if (argv[i + 1])
-			revs->prune_data = get_pathspec(revs->prefix, argv + i + 1);
+			prune_data = argv + i + 1;
 		seen_dashdash = 1;
 		break;
 	}
@@ -1321,12 +1322,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
 			for (j = i; j < argc; j++)
 				verify_filename(revs->prefix, argv[j]);
 
-			revs->prune_data = get_pathspec(revs->prefix,
-							argv + i);
+			prune_data = argv + i;
 			break;
 		}
 	}
 
+	if (prune_data)
+		revs->prune_data = get_pathspec(revs->prefix, prune_data);
+
 	if (revs->def == NULL)
 		revs->def = def;
 	if (revs->show_merge)
-- 
1.6.5.3.342.g14bb9

  parent reply	other threads:[~2009-11-20 11:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 11:25 [PATCH 0/3] "log --stdin" updates Junio C Hamano
2009-11-20 11:25 ` [PATCH 1/3] read_revision_from_stdin(): use strbuf Junio C Hamano
2009-11-20 11:25 ` Junio C Hamano [this message]
2009-11-20 11:25 ` [PATCH 3/3] Make --stdin option to "log" family read also pathspecs Junio C Hamano
2009-11-20 14:40 ` [PATCH 0/3] "log --stdin" updates Jeff King
2009-11-20 17:59   ` Junio C Hamano

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=1258716315-2213-3-git-send-email-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    /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