git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bert Wesarg" <bert.wesarg@googlemail.com>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	git@vger.kernel.org, "Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [PATCH] for-each-ref: `:short` format for `refname`
Date: Mon, 1 Sep 2008 19:52:03 +0200	[thread overview]
Message-ID: <36ca99e90809011052s568fa6e4y89e56769f63806c1@mail.gmail.com> (raw)
In-Reply-To: <36ca99e90809010713h7c673d10j6addd1624a655371@mail.gmail.com>

On Mon, Sep 1, 2008 at 16:13, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> On Mon, Sep 1, 2008 at 15:15, SZEDER Gábor <szeder@ira.uka.de> wrote:
>> However, if we consider possible use cases other than bash completion,
>> I don't know which one is more useful.  For example, if you have two
>> branches 'foo/bar' and 'foo/baz', then 'git merge $(git for-each-ref
>> --format=%(refbasename) refs/heads/foo)' will work as expected, but
>> 'refname:short' not, as it will output only 'bar' and 'baz' which 'git
>> merge' can not find.
> Yeah, thats an disadvantage and I thought about this, too. But I have
> no particular opinion about it.
Ok, I have a new idea, which could be made all happy:

IMHO the goal of this new format for refname should be, that it can be
used as an ref on the command line. This isn't given with my current
:short proposal (which I call :strip as of now), as Gábor showed. What
we need is the reverse of what happened with refnames given on the
command line to commands like checkout/merge/... The only thing that
comes near to this is this from refs.c:

    const char *ref_rev_parse_rules[] = {
            "%.*s",
            "refs/%.*s",
            "refs/tags/%.*s",
            "refs/heads/%.*s",
            "refs/remotes/%.*s",
            "refs/remotes/%.*s/HEAD",
            NULL
    };

Which doesn't look very useful, because every ref from for_each_ref
would match rule one. So we probably need to try the reverse of this
list. Now my knowledge from git internals is really low, I don't know
if this is sane. I know that this can't be bijective but at least the
bash completion would be happy with this idea.

Comments, thoughts, brown paper bags...

Thanks,
Bert

  reply	other threads:[~2008-09-01 17:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7vprnpbqmo.fsf@gitster.siamese.dyndns.org>
2008-08-31 12:41 ` [PATCH] for-each-ref: `:short` format for `refname` Bert Wesarg
2008-09-01 13:15   ` SZEDER Gábor
2008-09-01 14:13     ` Bert Wesarg
2008-09-01 17:52       ` Bert Wesarg [this message]
2008-09-01 19:10         ` Shawn O. Pearce
2008-09-01 21:10           ` Bert Wesarg
2008-09-01 21:28             ` Junio C Hamano
2008-09-01 21:44               ` Bert Wesarg
2008-09-02  7:26                 ` Bert Wesarg
2008-09-02 14:39                   ` Shawn O. Pearce
2008-09-02 21:57                     ` [PATCH v2] " Bert Wesarg
2008-09-02 23:10                       ` Junio C Hamano
2008-09-03  8:33                         ` Bert Wesarg
2008-09-03  8:42                           ` [PATCH v3] " Bert Wesarg
2008-09-03 15:18                             ` Shawn O. Pearce
2008-09-03 16:33                               ` Bert Wesarg
2008-09-03 16:56                                 ` Bert Wesarg
2008-09-03 18:36                             ` Junio C Hamano
2008-09-05 21:16                               ` [PATCH v4] " Bert Wesarg
2008-09-05 22:20                                 ` Junio C Hamano
2008-09-06 18:16                                   ` Bert Wesarg
2008-09-08 22:57                                 ` Junio C Hamano
2008-09-08 23:04                                   ` Shawn O. Pearce
2008-09-09  6:52                                   ` Bert Wesarg
2008-09-09  8:05                                     ` Junio C Hamano
2008-09-09  8:57                                       ` Bert Wesarg

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=36ca99e90809011052s568fa6e4y89e56769f63806c1@mail.gmail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    --cc=szeder@ira.uka.de \
    /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).