Re: cmd_cherry in builtin/log.c?

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

 



On Tue, Dec 7, 2010 at 3:39 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> 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.
--
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]