git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jay Soffian <jaysoffian@gmail.com>
Cc: Daniel Barkalow <barkalow@iabervon.org>, git@vger.kernel.org
Subject: Re: [PATCH 0/5] Extend pattern refspecs
Date: Sun, 08 Mar 2009 00:31:13 -0800	[thread overview]
Message-ID: <7vocwcl8ku.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <76718490903052119y4d6a7e0ck24bfeb1c0964e413@mail.gmail.com> (Jay Soffian's message of "Fri, 6 Mar 2009 00:19:42 -0500")

Jay Soffian <jaysoffian@gmail.com> writes:

> This series and js/remote-improvements (e5dcbfd) in pu may not get
> along completely. "git remote show" tries to show how the refspecs
> expand out.

I've created an "early semantic conflict resolution" topic branch that is
a cross between this series and js/remote-improvements, like so:

    $ git checkout -b xx/db-refspec-vs-js-remote db/refspec-wildcard-in-the-middle
    $ git merge js/remote-improvements
    $ git apply evil-fixup.diff
    $ git commit --amend -a -m "Evil merge."

with the following "fixup-as-an-evil-merge patch", which I'd appreciate if
you two can sanity check.

The result will be queued at the tip of 'pu', and hopefully I can merge it
to 'next' when this series goes to 'next'.  Similarly, whichever one goes
first to 'master' can be merged straight, but the merge of the other one
needs to merge this branch as well.

diff --git a/builtin-remote.c b/builtin-remote.c
index 7e82a52..3e4a41b 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -359,14 +358,9 @@ static int get_push_ref_states_noquery(struct ref_states *states)
 	}
 	for (i = 0; i < remote->push_refspec_nr; i++) {
 		struct refspec *spec = remote->push + i;
-		char buf[PATH_MAX];
 		if (spec->matching)
 			item = string_list_append("(matching)", &states->push);
-		else if (spec->pattern) {
-			snprintf(buf, (sizeof(buf)), "%s*", spec->src);
-			item = string_list_append(buf, &states->push);
-			snprintf(buf, (sizeof(buf)), "%s*", spec->dst);
-		} else if (strlen(spec->src))
+		else if (strlen(spec->src))
 			item = string_list_append(spec->src, &states->push);
 		else
 			item = string_list_append("(delete)", &states->push);
@@ -374,10 +368,7 @@ static int get_push_ref_states_noquery(struct ref_states *states)
 		info = item->util = xcalloc(sizeof(struct push_info), 1);
 		info->forced = spec->force;
 		info->status = PUSH_STATUS_NOTQUERIED;
-		if (spec->pattern)
-			info->dest = xstrdup(buf);
-		else
-			info->dest = xstrdup(spec->dst ? spec->dst : item->string);
+		info->dest = xstrdup(spec->dst ? spec->dst : item->string);
 	}
 	return 0;
 }
@@ -390,7 +381,7 @@ static int get_head_names(const struct ref *remote_refs, struct ref_states *stat
 
 	refspec.force = 0;
 	refspec.pattern = 1;
-	refspec.src = refspec.dst = "refs/heads/";
+	refspec.src = refspec.dst = "refs/heads/*";
 	states->heads.strdup_strings = 1;
 	get_fetch_map(remote_refs, &refspec, &fetch_map_tail, 0);
 	matches = guess_remote_head(find_ref_by_name(remote_refs, "HEAD"),

  parent reply	other threads:[~2009-03-08  8:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06  4:56 [PATCH 0/5] Extend pattern refspecs Daniel Barkalow
2009-03-06  5:19 ` Jay Soffian
2009-03-06  6:07   ` Daniel Barkalow
2009-03-06  6:52     ` Jay Soffian
2009-03-06  7:03       ` Daniel Barkalow
2009-03-06  7:59         ` Jay Soffian
2009-03-08  8:31   ` Junio C Hamano [this message]
2009-03-08  8:49     ` Daniel Barkalow
2009-03-09 15:46       ` Jay Soffian

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=7vocwcl8ku.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@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).