Re: [PATCH/RFC 0/7] Support for Ruby
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Sep 28, 2013, 23:06 UTC
- Message-ID
- <CAMP44s0JnG8wQ6DhHxbrdoxhdt3UTC8WG6R2yVmctGntEx0yzQ@mail.gmail.com>
- In-Reply-To
- <20130921235647.GC235845@vauxhall.crustytoothpaste.net>
On Sat, Sep 21, 2013 at 6:56 PM, brian m. carlson <sandals@crustytoothpaste.net> wrote:
> On Sat, Sep 21, 2013 at 05:52:05PM -0500, Felipe Contreras wrote: >> On Sat, Sep 21, 2013 at 4:29 PM, brian m. carlson >> <sandals@crustytoothpaste.net> wrote:
Show 12 quoted lines
>> Now, if anybody has ideas into how the bindings could be more object >> oriented, I'm all ears, but unfortunately what I foresee is that >> nobody will consider this proposal seriously. > > My concern is that the Ruby code will end up not being idiomatic, and > people will view it as bizarre and unmaintainable. > > for_each_ref could end up being something like REPOSITORY.refs.each, > which would be more idiomatic. repository.refs would probably be an > Enumerator in that case. If the decision is made to incorporate Ruby > code, I'm happy to submit some patches to help provide a sane interface, > even though I'm not that familiar with Ruby.
I think my proposed bindings are quite idiomatic.
git ruby - master origin/master <<EOF commits = ARGV.map { |id| Git::Commit.get(get_sha1(id)) } puts get_merge_bases(commits, 0).map { |commit| sha1_to_hex(commit.sha1) } EOF
-- Felipe Contreras