git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/44] Ruby support
@ 2013-09-28 22:03 Felipe Contreras
  2013-09-28 22:03 ` [PATCH v2 01/44] Add support for ruby commands Felipe Contreras
                   ` (44 more replies)
  0 siblings, 45 replies; 62+ messages in thread
From: Felipe Contreras @ 2013-09-28 22:03 UTC (permalink / raw)
  To: git; +Cc: Ramkumar Ramachandra, Felipe Contreras

This is a different patch series that tries a different approach.

First, this series allows external scripts to also access libgit through Ruby
bindings:

  git ruby <<EOF
  for_each_ref() do |name, sha1, flags|
    puts "%s: %s" % [name, sha1_to_hex(sha1)]
  end
  EOF

This way third party script writers can write Ruby code that resembles Git's
internal C code, but in a much simpler way.

Since the importance of the contrib area is fading, and it's important to move
all Git commands to C, it's helpful to have tools that allows third parties to
rewrite scripts that are easier to rewrite to C.

In addition, this would help Git developers to create quick prototypes and test
new code.

Finally, and perhaps most importantly, Ruby scripts can be intermediaries
between perl/shell scripts, and the final desired C code.

I already argued this, but here is a clear demonstration.

I took git-request-pull.sh, converted it to Ruby and incrementally moodified it
until the resulting code was essentially what the code would look like in C,
and then, finally, the rewrite to C, which follows the exact same logic of the
Ruby script.

In the progress of doing this, it was clear the shell script was buggy, so it
was fixed, and the C code needed fixes as well.

If we are serious about converting *all scripts* to C, clearly a powerful tool
is needed, and Ruby bindings fit the bill.

Ruby scripts could be provided alongside the perl/shell alternatives, so people
that build with NO_RUBY=y don't loose any functionality. And eventually the
Ruby scripts (and originals) get removed once the conversion to C is completed.

Even if Ruby is not used as an intermediary tool, and no official Git scripts are
converted to C this way, the bindings would still be useful to third parties.

Who wouldn't benefit from adding this support?

Felipe Contreras (44):
  Add support for ruby commands
  ruby: add support for internal ruby programs
  request-pull: fix annotated tag check
  request-pull: fix for specific branch
  request-pull: use appropriate ref
  request-pull: fix exact match checking
  request-pull: trivial simplification
  request-pull: t: trivial whitespace style fixes
  request-pull: t: add missing cat
  ruby: rewrite 'request-pull'
  ruby: request-pull: rewrite perl script
  ruby: request-pull: trivial simplifications
  ruby: bind setup_git_directory()
  ruby: bind dwim_ref()
  ruby: request-pull: use native dwim_ref()
  ruby: bind git_config()
  ruby: request-pull: use native git_config()
  ruby: bind read_ref()/peel_ref()
  ruby: bind get_sha1()
  ruby: request-pull: simplify tag fetching
  ruby: request-pull: use get_sha1()
  ruby: add Commit class
  ruby: bind get_merge_bases()
  ruby: request-pull: use get_merge_bases()
  ruby: request-pull: trivial cleanups
  ruby: bind remote and transport stuff
  ruby: request-pull: use native remote and transport
  ruby: bind find_unique_abbrev()
  ruby: request-pull: use native commit info
  ruby: bind read_sha1_file()
  ruby: request-pull: use read_sha1_file()
  revision: add missing include
  shortlog: add missing declaration
  shortlog: split builtin from common code
  ruby: add RevInfo and DiffOptions
  ruby: bind shortlog()
  ruby: request-pull: use shortlog()
  ruby: bind diff_tree_sha1()
  ruby: bind log_tree_diff_flush()
  ruby: request-pull: use native diff_tree stuff
  ruby: request-pull: remove rescue block
  ruby: remove GIT_PAGER from environment
  ruby: add simpler option parser
  request-pull: rewrite to C

 .gitignore              |   1 +
 Makefile                |  31 ++-
 builtin.h               |   1 +
 builtin/request-pull.c  | 275 +++++++++++++++++++++++
 builtin/shortlog.c      | 184 +--------------
 git-rb-setup.rb         | 109 +++++++++
 git-request-pull.sh     | 162 --------------
 git.c                   |   1 +
 revision.h              |   1 +
 ruby.c                  | 584 ++++++++++++++++++++++++++++++++++++++++++++++++
 shortlog.c              | 181 +++++++++++++++
 shortlog.h              |   8 +
 t/t10000-ruby.sh        | 233 +++++++++++++++++++
 t/t5150-request-pull.sh |  81 +++++--
 14 files changed, 1492 insertions(+), 360 deletions(-)
 create mode 100644 builtin/request-pull.c
 create mode 100644 git-rb-setup.rb
 delete mode 100755 git-request-pull.sh
 create mode 100644 ruby.c
 create mode 100644 shortlog.c
 create mode 100755 t/t10000-ruby.sh

-- 
1.8.4-fc

^ permalink raw reply	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2013-09-29  6:06 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-28 22:03 [PATCH v2 00/44] Ruby support Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 01/44] Add support for ruby commands Felipe Contreras
2013-09-29  4:30   ` Ramkumar Ramachandra
2013-09-29  4:47     ` Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 02/44] ruby: add support for internal ruby programs Felipe Contreras
2013-09-29  4:40   ` Ramkumar Ramachandra
2013-09-29  4:56     ` Felipe Contreras
2013-09-29  5:07       ` Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 03/44] request-pull: fix annotated tag check Felipe Contreras
2013-09-29  4:41   ` Ramkumar Ramachandra
2013-09-28 22:03 ` [PATCH v2 04/44] request-pull: fix for specific branch Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 05/44] request-pull: use appropriate ref Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 06/44] request-pull: fix exact match checking Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 07/44] request-pull: trivial simplification Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 08/44] request-pull: t: trivial whitespace style fixes Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 09/44] request-pull: t: add missing cat Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 10/44] ruby: rewrite 'request-pull' Felipe Contreras
2013-09-29  4:59   ` Ramkumar Ramachandra
2013-09-28 22:03 ` [PATCH v2 11/44] ruby: request-pull: rewrite perl script Felipe Contreras
2013-09-29  5:04   ` Ramkumar Ramachandra
2013-09-28 22:03 ` [PATCH v2 12/44] ruby: request-pull: trivial simplifications Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 13/44] ruby: bind setup_git_directory() Felipe Contreras
2013-09-29  5:11   ` Ramkumar Ramachandra
2013-09-29  5:40     ` Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 14/44] ruby: bind dwim_ref() Felipe Contreras
2013-09-29  5:17   ` Ramkumar Ramachandra
2013-09-29  5:24     ` Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 15/44] ruby: request-pull: use native dwim_ref() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 16/44] ruby: bind git_config() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 17/44] ruby: request-pull: use native git_config() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 18/44] ruby: bind read_ref()/peel_ref() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 19/44] ruby: bind get_sha1() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 20/44] ruby: request-pull: simplify tag fetching Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 21/44] ruby: request-pull: use get_sha1() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 22/44] ruby: add Commit class Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 23/44] ruby: bind get_merge_bases() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 24/44] ruby: request-pull: use get_merge_bases() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 25/44] ruby: request-pull: trivial cleanups Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 26/44] ruby: bind remote and transport stuff Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 27/44] ruby: request-pull: use native remote and transport Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 28/44] ruby: bind find_unique_abbrev() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 29/44] ruby: request-pull: use native commit info Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 30/44] ruby: bind read_sha1_file() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 31/44] ruby: request-pull: use read_sha1_file() Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 32/44] revision: add missing include Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 33/44] shortlog: add missing declaration Felipe Contreras
2013-09-28 22:03 ` [PATCH v2 34/44] shortlog: split builtin from common code Felipe Contreras
2013-09-28 22:04 ` [PATCH v2 35/44] ruby: add RevInfo and DiffOptions Felipe Contreras
2013-09-28 22:04 ` [PATCH v2 36/44] ruby: bind shortlog() Felipe Contreras
2013-09-28 22:04 ` [PATCH v2 37/44] ruby: request-pull: use shortlog() Felipe Contreras
2013-09-28 22:04 ` [PATCH v2 38/44] ruby: bind diff_tree_sha1() Felipe Contreras
2013-09-28 22:04 ` [PATCH v2 39/44] ruby: bind log_tree_diff_flush() Felipe Contreras
2013-09-28 22:04 ` [PATCH v2 40/44] ruby: request-pull: use native diff_tree stuff Felipe Contreras
2013-09-28 22:04 ` [PATCH v2 41/44] ruby: request-pull: remove rescue block Felipe Contreras
2013-09-28 22:04 ` [PATCH v2 42/44] ruby: remove GIT_PAGER from environment Felipe Contreras
2013-09-28 23:27   ` Stefan Beller
2013-09-28 23:33     ` Felipe Contreras
2013-09-28 22:04 ` [PATCH v2 43/44] ruby: add simpler option parser Felipe Contreras
2013-09-28 22:04 ` [PATCH v2 44/44] request-pull: rewrite to C Felipe Contreras
2013-09-29  6:05   ` Ramkumar Ramachandra
2013-09-29  4:13 ` [PATCH v2 00/44] Ruby support Ramkumar Ramachandra
2013-09-29  4:20   ` Felipe Contreras

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).