git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git List <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 7/7] sha1_name: implement finding @{push}
Date: Fri, 24 May 2013 21:45:52 +0530	[thread overview]
Message-ID: <CALkWK0=XufbcwObBq7_MWX3jL63Nv3YeSvTUpOfXD+XoKkvMag@mail.gmail.com> (raw)
In-Reply-To: <CACsJy8CV192WVW8u6YRnbf6Ue6tFbzyiCARwicwzapSZucaaMw@mail.gmail.com>

Duy Nguyen wrote:
> On Thu, May 23, 2013 at 10:12 PM, Ramkumar Ramachandra
> <artagnon@gmail.com> wrote:
>> Try this now: configure your current branch's pushremote to push to
>> "refs/heads/*:refs/heads/rr/*".  Now, type 'git show @{p}'.  Voila!
>
> Voila what? Why not avoid guessing game and describe what the patch is for?

If you're on branch master, it'll output refs/heads/rr/master.  The
topic is about having a @{push} corresponding to @{upstream}

>> +static void find_push_ref(struct branch *branch) {
>> +       struct remote *remote = pushremote_get(NULL);
>> +       const struct refspec *pat = NULL;
>> +       char raw_ref[PATH_MAX];
>> +       struct ref *this_ref;
>> +       char *dst_name;
>> +       int len;
>> +
>> +       sprintf(raw_ref, "refs/heads/%s", branch->name);
>> +       len = strlen(raw_ref) + 1;
>> +       this_ref = xcalloc(1, sizeof(*this_ref) + len);
>> +       memcpy(this_ref->name, raw_ref, len);
>> +
>> +       dst_name = get_ref_match(remote->push, remote->push_refspec_nr,
>> +                               this_ref, MATCH_REFS_ALL, 0, &pat);
>> +       printf("dst_name = %s\n", dst_name);
>> +}
>> +
>
> Isn't this an abuse of extended sha-1 syntax? How can I combine this
> with other @{}, ^, ~...?

I'm unsure what you mean.  How can I be on branch master^1?  Did you
read the cover-letter?

  reply	other threads:[~2013-05-24 16:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23 15:12 [PATCH 0/7] Let's get that @{push}! Ramkumar Ramachandra
2013-05-23 15:12 ` [PATCH 1/7] sha1_name: abstract upstream_mark() logic Ramkumar Ramachandra
2013-05-23 15:12 ` [PATCH 2/7] sha1_name: factor out die_no_upstream() Ramkumar Ramachandra
2013-05-23 15:12 ` [PATCH 3/7] sha1_name: remove upstream_mark() Ramkumar Ramachandra
2013-05-23 15:12 ` [PATCH 4/7] remote: expose parse_push_refspec() Ramkumar Ramachandra
2013-05-23 15:12 ` [PATCH 5/7] remote: expose get_ref_match() Ramkumar Ramachandra
2013-05-23 15:12 ` [PATCH 6/7] sha1_name: prepare to introduce AT_KIND_PUSH Ramkumar Ramachandra
2013-05-24 13:22   ` Felipe Contreras
2013-05-24 13:27     ` Ramkumar Ramachandra
2013-05-23 15:12 ` [PATCH 7/7] sha1_name: implement finding @{push} Ramkumar Ramachandra
2013-05-24 16:09   ` Duy Nguyen
2013-05-24 16:15     ` Ramkumar Ramachandra [this message]
2013-05-24 16:21       ` Duy Nguyen
2013-05-24 16:29         ` Ramkumar Ramachandra
2013-05-24 18:01           ` Junio C Hamano
2013-05-24 18:21             ` Ramkumar Ramachandra
2013-05-24 19:12               ` 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='CALkWK0=XufbcwObBq7_MWX3jL63Nv3YeSvTUpOfXD+XoKkvMag@mail.gmail.com' \
    --to=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@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).