Re: [PATCH 0/2] [RFD] Using gitrevisions :/search style with other operators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kevin Ballard <kevin@xxxxxx> writes:

> 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?

Both feels like a very made-up example to me.

The reason you can so sure that you can to give nth(2) not nth(3) nor
nth(1) and run "merge" in the example is probably because you looked at
the output from "git log --first-parent --oneline origin..origin/pu", no?

  d414638 Merge branch 'rj/msvc-fix' into pu
  e5f5e49 Merge branch 'ak/describe-exact' into pu
  439932d Merge branch 'jn/svn-fe' into pu
  d60b33b Merge branch 'pd/bash-4-completion' into pu
  09cbbde Merge branch 'tf/commit-list-prefix' into pu
  1b2ea00 Merge branch 'mg/cvsimport' into pu
  c6d41f4 Merge branch 'nd/maint-relative' into pu
  81f395e Merge branch 'ab/i18n' into pu
  9f5471f Merge branch 'nd/setup' into pu
  06f74a4 Merge branch 'yd/dir-rename' into pu
  d8a2ec8 Merge branch 'en/object-list-with-pathspec' into pu

After looking at this output, do you really want to say ":nth(2)/nd/"
instead of 9f5471f?

To come up with the "(2)" part you need to carefully scan the other lines
and make sure that there is only one "nd/" after what you want, and the
string does not appear in an unexpected places.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]