git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Ramkumar Ramachandra <artagnon@gmail.com>
Subject: Re: [PATCH v2 5/8] contrib: cc-cmd: add option to parse from committish
Date: Fri, 19 Apr 2013 13:29:10 -0500	[thread overview]
Message-ID: <CAMP44s0ASLAaRMbGHsahHONzuGMC96rw5m72fM5EWpkYp==5uA@mail.gmail.com> (raw)
In-Reply-To: <7vtxn21jvt.fsf@alter.siamese.dyndns.org>

On Fri, Apr 19, 2013 at 12:59 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> For example master..feature-a.
>>
>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>> ---
>>  contrib/cc-cmd/git-cc-cmd | 36 ++++++++++++++++++++++++++++++++++--
>>  1 file changed, 34 insertions(+), 2 deletions(-)
>>
>> diff --git a/contrib/cc-cmd/git-cc-cmd b/contrib/cc-cmd/git-cc-cmd
>> index f13ed8f..462f22c 100755
>> --- a/contrib/cc-cmd/git-cc-cmd
>> +++ b/contrib/cc-cmd/git-cc-cmd
>> @@ -5,11 +5,13 @@ require 'optparse'
>>  $since = '3-years-ago'
>>  $min_percent = 5
>>  $show_commits = false
>> +$files = []
>> +$rev_args = []
>>
>>  begin
>>    OptionParser.new do |opts|
>>      opts.program_name = 'git cc-cmd'
>> -    opts.banner = 'usage: git cc-cmd [options] <files>'
>> +    opts.banner = 'usage: git cc-cmd [options] <files | rev-list options>'
>>
>>      opts.on('-p', '--min-percent N', Integer, 'Minium percentage of role participation') do |v|
>>        $min_percent = v
>> @@ -134,10 +136,40 @@ class Commits
>>      end
>>    end
>>
>> +  def from_rev_args(args)
>> +    return if args.empty?
>> +    source = nil
>> +    File.popen(%w[git rev-list --reverse] + args) do |p|
>> +      p.each do |e|
>> +        id = e.chomp
>> +        @main_commits[id] = true
>> +        File.popen(%w[git --no-pager show -C --oneline] + [id]) do |p|
>
> When you know you are sending its output to a pipe, does --no-pager matter,
> or is there anything more subtle going on here?
>
> An extra --no-pager does not hurt, but it just caught/distracted my
> attention while reading this patch.

It probably doesn't matter, I might have been using something else
when I copied that code.

-- 
Felipe Contreras

  reply	other threads:[~2013-04-19 18:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  5:14 [PATCH v2 0/8] New git-cc-cmd helper Felipe Contreras
2013-04-19  5:14 ` [PATCH v2 1/8] Add new git-cc-cmd helper to contrib Felipe Contreras
2013-04-19 13:26   ` Ramkumar Ramachandra
2013-04-19 16:30     ` Felipe Contreras
2013-04-19 17:08   ` Junio C Hamano
2013-04-19 17:35     ` Felipe Contreras
2013-04-19 19:24       ` Junio C Hamano
2013-04-19 19:35         ` Felipe Contreras
2013-04-19 19:56           ` Junio C Hamano
2013-04-19 20:05         ` Johannes Sixt
2013-04-20 20:22           ` Junio C Hamano
2013-04-22  7:30             ` Jeremy Rosen
2013-04-19 20:08       ` Junio C Hamano
2013-04-19  5:14 ` [PATCH v2 2/8] contrib: cc-cmd: add option parsing Felipe Contreras
2013-04-19  5:14 ` [PATCH v2 3/8] contrib: cc-cmd: add support for multiple patches Felipe Contreras
2013-04-19  5:14 ` [PATCH v2 4/8] contrib: cc-cmd: add option to show commits Felipe Contreras
2013-04-19  5:14 ` [PATCH v2 5/8] contrib: cc-cmd: add option to parse from committish Felipe Contreras
2013-04-19 17:59   ` Junio C Hamano
2013-04-19 18:29     ` Felipe Contreras [this message]
2013-04-19  5:14 ` [PATCH v2 6/8] contrib: cc-cmd: parse committish like format-patch Felipe Contreras
2013-04-19  5:14 ` [PATCH v2 7/8] contrib: cc-cmd: fix parsing of rev-list args Felipe Contreras
2013-04-19  5:14 ` [PATCH v2 8/8] contrib: cc-cmd: add option to fetch aliases Felipe Contreras

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='CAMP44s0ASLAaRMbGHsahHONzuGMC96rw5m72fM5EWpkYp==5uA@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).