git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thiago Farina <tfransosi@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>, rene.scharfe@lsrfire.ath.cx
Subject: Re: cmd_cherry in builtin/log.c?
Date: Wed, 8 Dec 2010 09:57:59 -0200	[thread overview]
Message-ID: <AANLkTik7+WAk0mx0G7b565eCihB5SGNBDuYLdfPzq7pr@mail.gmail.com> (raw)
In-Reply-To: <20101207173923.GA21483@burratino>

On Tue, Dec 7, 2010 at 3:39 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Hi,
>
> Thiago Farina wrote:
>
>> I was looking into builtin/log.c to see how it does --reverse and I
>> saw that cmd_cherry is there.
>>
>> I'm wondering, why is it there?
>
> Good question.  So let's check.
>
>  $ git log --oneline -Scmd_cherry builtin/log.c
>  81b50f3 Move 'builtin-*' into a 'builtin/' subdirectory
>
> That wasn't too helpful.  Okay, okay.
>
>  $ git log --oneline -Scmd_cherry -- builtin-log.c
>  81b50f3 Move 'builtin-*' into a 'builtin/' subdirectory
>  e827633 Built-in cherry
>
> Running "git show e827633" reveals that the core of the original
> script is
>
>        for c in $inup
>        do
>                git-diff-tree -p $c
>        done | git-patch-id |
>        while read id name
>        do
>                echo $name >>$patch/$id
>        done
>
> while the core of the builtin version is
>
>        get_patch_ids(&revs, &patch_id_opts, prefix);
>
> The latter function is static, introduced by v1.4.1~12^2~5
> (format-patch: introduce "--ignore-if-in-upstream", 2006-06-25).
>
> So the answer is that "git cherry" is considered a variant on
> "git log" (like format-patch, show, and whatchanged) and that it uses
> "git log" internals.
>

Yup, thanks for digging into it. Now makes sense.

  parent reply	other threads:[~2010-12-08 11:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07 16:02 cmd_cherry in builtin/log.c? Thiago Farina
2010-12-07 17:39 ` Jonathan Nieder
2010-12-07 18:57   ` René Scharfe
2010-12-07 20:30     ` Junio C Hamano
2010-12-09 21:14       ` René Scharfe
2010-12-08 11:57   ` Thiago Farina [this message]
2010-12-08 18:09     ` Jonathan Nieder

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=AANLkTik7+WAk0mx0G7b565eCihB5SGNBDuYLdfPzq7pr@mail.gmail.com \
    --to=tfransosi@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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).