git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Kevin Ballard <kevin@sb.org>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Jakub Narebski <jnareb@gmail.com>,
	git@vger.kernel.org, Yann Dirson <dirson@bertin.fr>
Subject: Re: [PATCH 0/2] [RFD] Using gitrevisions :/search style with other operators
Date: Fri, 10 Dec 2010 16:30:17 -0500	[thread overview]
Message-ID: <20101210213017.GA14256@sigill.intra.peff.net> (raw)
In-Reply-To: <66D6F30D-4707-4057-BB46-57B2DF01F479@sb.org>

On Fri, Dec 10, 2010 at 01:21:15PM -0800, Kevin Ballard wrote:

> On Dec 10, 2010, at 11:03 AM, Jonathan Nieder wrote:
> 
> > - What is the intended use for this family of modifiers?  I sort
> >   of understand ^{:i/... } for people that forget what case they
> >   have used, but why the :nth and others?
> 
> In my particular case, I was glancing through the logs, and I wanted to grab
> the second branch that someone else had made that was merged into pu. I would
> have loved to be able to run something like
> 
>   git merge origin/pu^{:nth(2)/nd/}
> 
> While we're speaking of modifiers, could we use one that says "only search
> the first parent hierarchy", e.g. something equivalent to git log's --first-parent
> flag?

As neat as this modifier syntax is getting, are we perhaps just
recreating the wheel?

How about:

  git merge `git rev-list -2 --grep=nd/ origin/pu | tail -1`

for the nth one, and:

  git merge `git rev-list --first-parent -1 --grep=nd/ origin/pu`

for a first parent search (I will leave combining them as an exercise to
the reader).

It's not that I'm opposed to a handy ref-specifying syntax. I just
wonder if it is really worth building in all of these obscure scenarios.

-Peff

  reply	other threads:[~2010-12-10 21:30 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08 14:58 [PATCH 0/2] [RFD] Using gitrevisions :/search style with other operators Nguyễn Thái Ngọc Duy
2010-12-08 14:58 ` [PATCH 1/2] get_sha1_oneline: allow to input commit_list Nguyễn Thái Ngọc Duy
2010-12-08 15:11   ` Thiago Farina
2010-12-08 14:58 ` [PATCH 2/2] get_sha1: support ref^{/regex} syntax Nguyễn Thái Ngọc Duy
2010-12-08 22:50   ` Junio C Hamano
2010-12-08 18:06 ` [PATCH 0/2] [RFD] Using gitrevisions :/search style with other operators Jonathan Nieder
2010-12-08 19:51   ` Jakub Narebski
2010-12-09  1:28     ` Nguyen Thai Ngoc Duy
2010-12-09  1:54       ` Jakub Narebski
2010-12-09  1:59         ` Jonathan Nieder
2010-12-09  2:02           ` Kevin Ballard
2010-12-09  2:06             ` Nguyen Thai Ngoc Duy
2010-12-09  2:11               ` Jonathan Nieder
2010-12-09  6:22           ` Junio C Hamano
2010-12-09 11:38             ` Jakub Narebski
2010-12-10 13:25             ` Nguyen Thai Ngoc Duy
2010-12-10 19:03               ` Jonathan Nieder
2010-12-10 19:26                 ` Jakub Narebski
2010-12-10 21:21                 ` Kevin Ballard
2010-12-10 21:30                   ` Jeff King [this message]
2010-12-10 23:08                   ` Junio C Hamano
2010-12-10 23:11                     ` Kevin Ballard
2010-12-10 23:36                       ` Junio C Hamano
2010-12-09  5:15     ` Junio C Hamano
2010-12-08 19:47 ` Jakub Narebski
2010-12-08 20:40   ` Jonathan Nieder
2010-12-09  0:30   ` Nguyen Thai Ngoc Duy
2010-12-09  0:44     ` Jakub Narebski
2010-12-09  1:42       ` Nguyen Thai Ngoc Duy
2010-12-09  1:46         ` Kevin Ballard
2010-12-09 11:43         ` Jakub Narebski
2010-12-09 11:53           ` Nguyen Thai Ngoc Duy

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=20101210213017.GA14256@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=dirson@bertin.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=kevin@sb.org \
    --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).