[PATCH 0/9] following http redirects

2013-09-28 Thread Jeff King
Git's http handling takes care of redirects by setting CURLOPT_FOLLOWLOCATION, and just assuming curl will handle the details. For the most part, this works, but there are a few downsides: 1. We do extra round-trips for subsequent requests, as we always feed curl the original URL, and it

[PATCH 5/9] http: provide effective url to callers

2013-09-28 Thread Jeff King
When we ask curl to access a URL, it may follow one or more redirects to reach the final location. We have no idea this has happened, as curl takes care of the details and simply returns the final content to us. The final URL that we ended up with can be accessed via CURLINFO_EFFECTIVE_URL. Let's

[PATCH 4/9] http: hoist credential request out of handle_curl_result

2013-09-28 Thread Jeff King
When we are handling a curl response code in http_request or in the remote-curl RPC code, we use the handle_curl_result helper to translate curl's response into an easy-to-use code. When we see an HTTP 401, we do one of two things: 1. If we already had a filled-in credential, we mark it as

[PATCH 3/9] http: refactor options to http_get_*

2013-09-28 Thread Jeff King
Over time, the http_get_strbuf function has grown several optional parameters. We now have a bitfield with multiple boolean options, as well as an optional strbuf for returning the content-type of the response. And a future patch in this series is going to add another strbuf option. Treating

[PATCH 6/9] http: update base URLs when we see redirects

2013-09-28 Thread Jeff King
If a caller asks the http_get_* functions to go to a particular URL and we end up elsewhere due to a redirect, the effective_url field can tell us where we went. It would be nice to remember this redirect and short-cut further requests for two reasons: 1. It's more efficient. Otherwise we

[PATCH 7/9] remote-curl: make refs_url a strbuf

2013-09-28 Thread Jeff King
In the discover_refs function, we use a strbuf named buffer for multiple purposes. First we build the info/refs URL in it, and then detach that to a bare pointer. Then, we use the same strbuf to store the result of fetching the refs. Let's instead keep a separate refs_url strbuf. This is less

[PATCH 9/9] remote-curl: rewrite base url from info/refs redirects

2013-09-28 Thread Jeff King
For efficiency and security reasons, an earlier commit in this series taught http_get_* to re-write the base url based on redirections we saw while making a specific request. This commit wires that option into the info/refs request, meaning that a redirect from

[PATCH 8/9] remote-curl: store url as a strbuf

2013-09-28 Thread Jeff King
We use a strbuf to generate the string containing the remote URL, but then detach it to a bare pointer. This makes it harder to later manipulate the URL, as we have forgotten the length (and the allocation semantics are not as clear). Let's instead keep the strbuf around. As a bonus, this

Re: [PATCH] repack: Add --version parameter

2013-09-28 Thread Stefan Beller
On 09/26/2013 12:17 PM, Felipe Contreras wrote: On Thu, Sep 26, 2013 at 3:32 AM, Stefan Beller static const char *const git_repack_usage[] = { @@ -22,6 +23,9 @@ static int repack_config(const char *var, const char *value, void *cb) delta_base_offset = git_config_bool(var,

Re: [PATCH] repack: Add --version parameter

2013-09-28 Thread Stefan Beller
On 09/26/2013 01:42 PM, Duy Nguyen wrote: On Thu, Sep 26, 2013 at 3:32 PM, Stefan Beller stefanbel...@googlemail.com wrote: This is just a direct translation of http://article.gmane.org/gmane.comp.version-control.git/235396 So I don't consider this is ready for inclusion. Some notes: We

Re: [ANNOUNCE] Git v1.8.4.1

2013-09-28 Thread Steffen Prohaska
Hello Jonathan, On Sep 27, 2013, at 8:52 PM, Jonathan Nieder jrnie...@gmail.com wrote: The latest maintenance release Git v1.8.4.1 is now available. I can't find the following three minor doc fixes http://article.gmane.org/gmane.comp.version-control.git/235234

Re: Local tag killer

2013-09-28 Thread Michael Haggerty
On 09/26/2013 12:54 AM, Nicolas Pitre wrote: On Tue, 24 Sep 2013, Jeff King wrote: I think most of this problem is the way that we fetch tags straight into the refs/tags hierarchy. You would not do: [remote origin] fetch = +refs/heads/*:refs/heads/* prune = true unless you wanted to

Re: [PATCH] clone: tighten local paths with colons check a bit

2013-09-28 Thread Torsten Bögershausen
On 2013-09-27 23.56, Jonathan Nieder wrote: Nguyễn Thái Ngọc Duy wrote: commit 6000334 (clone: allow cloning local paths with colons in them - 2013-05-04) is added to make it possible to specify a path that has colons in it without file://, e.g. ../foo:bar/somewhere. But the check is a bit

[PATCH] rebase -i: respect to core.abbrev

2013-09-28 Thread Kirill A. Shutemov
git rebase -i collapses ids on todo list to 7 hexdigits. Let's use core.abbrev config option instead, if it's set. Signed-off-by: Kirill A. Shutemov kirill.shute...@linux.intel.com --- git-rebase--interactive.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH] clone: local URLs are not for ssh

2013-09-28 Thread Torsten Bögershausen
git clone /foo/bar:baz or git clone ../foo/bar:baz are meant to clone from the local file system, and not to clone from a remote server over git-over-ssh. Signed-off-by: Torsten Bögershausen tbo...@web.de --- connect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

RE: [PATCH] rebase -i: respect to core.abbrev

2013-09-28 Thread Kirill A. Shutemov
Kirill A. Shutemov wrote: git rebase -i collapses ids on todo list to 7 hexdigits. Let's use core.abbrev config option instead, if it's set. Signed-off-by: Kirill A. Shutemov kirill.shute...@linux.intel.com --- git-rebase--interactive.sh | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH] mingw-multibyte: fix memory acces violation and path length limits.

2013-09-28 Thread Wataru Noguchi
fix: Git for Windows crashes when clone Japanese multibyte repository. Reproduce condition: - Japanese Base Encoding is Shift-JIS. - It happens Japanese multibyte directory name and too-long directory path - Linux(ex. Ubuntu 13.04 amd64) can clone normally. - example repository is here: git

Re: Local tag killer

2013-09-28 Thread Johan Herland
On Sat, Sep 28, 2013 at 2:20 PM, Michael Haggerty mhag...@alum.mit.edu wrote: I just reviewed that old thread to determine its relevance to the present discussion. For the benefit of the other readers, here is a summary of the main points that I got out of it. I want to thank you immensely

[PATCH 00/10] trivial style and other fixes

2013-09-28 Thread Felipe Contreras
Felipe Contreras (10): transport-helper: trivial style fix describe: trivial style fixes pretty: trivial style fix revision: trivial style fixes revision: add missing include shortlog: add missing declaration diff: trivial style fix run-command: trivial style fixes revision:

[PATCH 05/10] revision: add missing include

2013-09-28 Thread Felipe Contreras
Otherwise we might not have 'struct diff_options'. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- revision.h | 1 + 1 file changed, 1 insertion(+) diff --git a/revision.h b/revision.h index e7f1d21..89132df 100644 --- a/revision.h +++ b/revision.h @@ -5,6 +5,7 @@ #include

[PATCH 09/10] revision: trivial style fixes

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- revision.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/revision.c b/revision.c index 3ebd558..4049867 100644 --- a/revision.c +++ b/revision.c @@ -1503,7 +1503,7 @@ struct cmdline_pathspec { static void

[PATCH 08/10] run-command: trivial style fixes

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- run-command.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/run-command.c b/run-command.c index 1b7f88e..3914d9c 100644 --- a/run-command.c +++ b/run-command.c @@ -406,13 +406,12 @@ fail_pipe:

[PATCH 01/10] transport-helper: trivial style fix

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- transport-helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/transport-helper.c b/transport-helper.c index b32e2d6..673b7c2 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -269,6 +269,7 @@ static const char

[PATCH 04/10] revision: trivial style fixes

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- revision.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/revision.c b/revision.c index 0173e01..3ebd558 100644 --- a/revision.c +++ b/revision.c @@ -2971,7 +2971,7 @@ static struct commit

[PATCH 03/10] pretty: trivial style fix

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- pretty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pretty.c b/pretty.c index b4e32b7..962e82b 100644 --- a/pretty.c +++ b/pretty.c @@ -497,7 +497,7 @@ void pp_user_info(struct pretty_print_context *pp,

[PATCH 10/10] setup: trivial style fixes

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.c b/setup.c index f08dd64..c717db4 100644 --- a/setup.c +++ b/setup.c @@ -566,7 +566,7 @@ static const char *setup_git_directory_gently_1(int

[PATCH 06/10] shortlog: add missing declaration

2013-09-28 Thread Felipe Contreras
Otherwise we would have to include commit.h. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- shortlog.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shortlog.h b/shortlog.h index de4f86f..54bc07c 100644 --- a/shortlog.h +++ b/shortlog.h @@ -19,6 +19,8 @@ struct shortlog {

[PATCH 02/10] describe: trivial style fixes

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- builtin/describe.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/builtin/describe.c b/builtin/describe.c index b9d3603..6f62109 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -9,7 +9,7 @@

[PATCH 07/10] diff: trivial style fix

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- builtin/diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/diff.c b/builtin/diff.c index 2fb8c5d..adb93a9 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -169,7 +169,7 @@ static int

[PATCH v2 03/44] request-pull: fix annotated tag check

2013-09-28 Thread Felipe Contreras
The was just not doing anything, reporting an appropriately tagged ref worked only by luck. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.sh | 2 +- t/t5150-request-pull.sh | 15 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git

[PATCH v2 02/44] ruby: add support for internal ruby programs

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Makefile | 9 + ruby.c | 19 ++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2fdee15..27e61c0 100644 --- a/Makefile +++ b/Makefile @@ -429,6 +429,7 @@

[PATCH v2 00/44] Ruby support

2013-09-28 Thread 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

[PATCH v2 04/44] request-pull: fix for specific branch

2013-09-28 Thread Felipe Contreras
Wether we use a symbolic ref, or we specify the branch directly shouldn't really matter, we would want the branch description either way. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.sh | 13 + t/t5150-request-pull.sh | 32

[PATCH v2 01/44] Add support for ruby commands

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: With this support, third parties would be able to write scripts more easily and access libgit facilities. Also, it could help developers by allowing easier prototyping git ruby actual EOF

[PATCH v2 05/44] request-pull: use appropriate ref

2013-09-28 Thread Felipe Contreras
Are you sure you pushed 'HEAD'? doesn't say anything helpful. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-request-pull.sh b/git-request-pull.sh index 3c9a982..3e510ca 100755 ---

[PATCH v2 17/44] ruby: request-pull: use native git_config()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.rb | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/git-request-pull.rb b/git-request-pull.rb index 416f880..0f85024 100755 --- a/git-request-pull.rb +++ b/git-request-pull.rb @@ -14,6

[PATCH v2 11/44] ruby: request-pull: rewrite perl script

2013-09-28 Thread Felipe Contreras
Ruby can do it just fine, no need for perl. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: I'm mostly ignoring the comment, my hope is that it would be redundant, as the code would be self-documenting. git-request-pull.rb | 65

[PATCH v2 07/44] request-pull: trivial simplification

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.sh | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/git-request-pull.sh b/git-request-pull.sh index c970244..d8b4c3c 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -86,25

[PATCH v2 15/44] ruby: request-pull: use native dwim_ref()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: Our first real usage of the bindings doesn't look too different from what it would look like in C. In Ruby all variables are pointers to objects, and there's no concept of pointer to variables, so what in C

[PATCH v2 08/44] request-pull: t: trivial whitespace style fixes

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- t/t5150-request-pull.sh | 14 -- 1 file changed, 14 deletions(-) diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh index 73f0369..9375912 100755 --- a/t/t5150-request-pull.sh +++ b/t/t5150-request-pull.sh @@

[PATCH v2 18/44] ruby: bind read_ref()/peel_ref()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- ruby.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/ruby.c b/ruby.c index 36de943..92c636c 100644 --- a/ruby.c +++ b/ruby.c @@ -65,12 +65,30 @@ static VALUE git_rb_git_config(VALUE self) return

[PATCH v2 20/44] ruby: request-pull: simplify tag fetching

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: For the moment we use str[10..-1] to denote the equivalent of str + 10 in C, even though Ruby has nicer constructs than that. git-request-pull.rb | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-)

[PATCH v2 06/44] request-pull: fix exact match checking

2013-09-28 Thread Felipe Contreras
It obviously never worked, refs don't start with '/'. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.sh | 10 -- t/t5150-request-pull.sh | 21 + 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/git-request-pull.sh

[PATCH v2 12/44] ruby: request-pull: trivial simplifications

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: Let's start deviating from the original script. There are no functional changes though. git-request-pull.rb | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git

[PATCH v2 19/44] ruby: bind get_sha1()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- ruby.c | 11 +++ t/t1-ruby.sh | 8 2 files changed, 19 insertions(+) diff --git a/ruby.c b/ruby.c index 92c636c..45111e6 100644 --- a/ruby.c +++ b/ruby.c @@ -81,6 +81,16 @@ static VALUE

[PATCH v2 13/44] ruby: bind setup_git_directory()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- ruby.c | 16 t/t1-ruby.sh | 13 + 2 files changed, 29 insertions(+) diff --git a/ruby.c b/ruby.c index 339e376..c2ef72e 100644 --- a/ruby.c +++ b/ruby.c @@ -12,6 +12,21 @@ static inline

[PATCH v2 09/44] request-pull: t: add missing cat

2013-09-28 Thread Felipe Contreras
Otherwise we wouldn't know why it failed. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- t/t5150-request-pull.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh index 9375912..60a38be 100755 --- a/t/t5150-request-pull.sh +++

[PATCH v2 10/44] ruby: rewrite 'request-pull'

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: The objective is to be as close to the original as possible, to minimize regressions, even if the style is not very Ruby-ish. Makefile| 3 +- git-rb-setup.rb | 17 ++ git-request-pull.rb | 146

[PATCH v2 16/44] ruby: bind git_config()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: Our first usage of Ruby blocks. Notice how the code inside the block is in the same scope as the code outside. cb_data = config git_config() do |key, value| puts %s: %s=%s % [cb_data, key,

[PATCH v2 25/44] ruby: request-pull: trivial cleanups

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: The fist override of a native class, which is one of the strong points of Ruby. We could use skip_prefix(str, prefix) like in C, but str.skip_prefix(prefix) is more natrual in Ruby. git-rb-setup.rb | 6

[PATCH v2 24/44] ruby: request-pull: use get_merge_bases()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: Now headrev and baserev become Git::Commit objects, fortunately 'puts(#{commit})' or 'printf(%s\n, commit) convert the commit to a String (commit.to_s()), which is the hex sha1, so the rest of the script doesn't

[PATCH v2 28/44] ruby: bind find_unique_abbrev()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- ruby.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/ruby.c b/ruby.c index ee548dc..7496c18 100644 --- a/ruby.c +++ b/ruby.c @@ -258,6 +258,13 @@ static VALUE git_rb_ref_old_sha1(VALUE self) return

[PATCH v2 40/44] ruby: request-pull: use native diff_tree stuff

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: We finally got rid of all the system() calls, and thus all the forks. git-request-pull.rb | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/git-request-pull.rb b/git-request-pull.rb

[PATCH v2 31/44] ruby: request-pull: use read_sha1_file()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-request-pull.rb b/git-request-pull.rb index 5f40901..233981f 100755 --- a/git-request-pull.rb +++ b/git-request-pull.rb @@ -165,7 +165,8 @@

[PATCH v2 42/44] ruby: remove GIT_PAGER from environment

2013-09-28 Thread Felipe Contreras
We are not calling any git commands any more. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/git-request-pull.rb b/git-request-pull.rb index fde8d1a..941ff72 100755 --- a/git-request-pull.rb +++

[PATCH v2 29/44] ruby: request-pull: use native commit info

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: We could use a bit more of the internal parsing in C, or we could export more, but there's no need to, parse_buffer() is relatively simple in Ruby. git-request-pull.rb | 47

[PATCH v2 21/44] ruby: request-pull: use get_sha1()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: To minimize the changes in the rest of the script, the sha1 is converted by to a hex. git-request-pull.rb | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/git-request-pull.rb

[PATCH v2 23/44] ruby: bind get_merge_bases()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: We could call it get_merge_bases_many(), but the fact that it's awkward to pass arrays in C is a limitation we don't have in Ruby. We can pass as many commits as we want easily. ruby.c | 36

[PATCH v2 38/44] ruby: bind diff_tree_sha1()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- ruby.c | 12 1 file changed, 12 insertions(+) diff --git a/ruby.c b/ruby.c index d59aafd..b491754 100644 --- a/ruby.c +++ b/ruby.c @@ -360,6 +360,17 @@ static VALUE git_rb_shortlog(VALUE self, VALUE commits)

[PATCH v2 27/44] ruby: request-pull: use native remote and transport

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.rb | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/git-request-pull.rb b/git-request-pull.rb index 79a26dc..869f160 100755 --- a/git-request-pull.rb +++

[PATCH v2 41/44] ruby: request-pull: remove rescue block

2013-09-28 Thread Felipe Contreras
We are not calling any git commands any more. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.rb | 61 - 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/git-request-pull.rb b/git-request-pull.rb

[PATCH v2 39/44] ruby: bind log_tree_diff_flush()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- ruby.c | 12 1 file changed, 12 insertions(+) diff --git a/ruby.c b/ruby.c index b491754..71d5cb6 100644 --- a/ruby.c +++ b/ruby.c @@ -8,6 +8,7 @@ #include revision.h #include diff.h #include shortlog.h +#include

[PATCH v2 22/44] ruby: add Commit class

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: The Commit class inherits from the Object class, so commit.sha1() just works, even though it's an Object method. For now we don't define initializers or allocators, so Git::Commit.new() cannot really be

[PATCH v2 35/44] ruby: add RevInfo and DiffOptions

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: This time we use an initializer and alloc function, so we could do: ri = Git::RevInfo.new() ri.setup(args) Or: ri = Git::RevInfo.setup(args) The effect is the same. Also,

[PATCH v2 32/44] revision: add missing include

2013-09-28 Thread Felipe Contreras
Otherwise we might not have 'struct diff_options'. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- revision.h | 1 + 1 file changed, 1 insertion(+) diff --git a/revision.h b/revision.h index 95859ba..4aa5c5a 100644 --- a/revision.h +++ b/revision.h @@ -5,6 +5,7 @@ #include

[PATCH v2 43/44] ruby: add simpler option parser

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: We could use Git's internap parseopt, but the resulting code in Ruby wouldn't look very good, and the complexity to bind it wouldn't be trivial either (I tried). Instead, let's use the advantage of Ruby

[PATCH v2 44/44] request-pull: rewrite to C

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Makefile | 3 +- builtin.h | 1 + builtin/request-pull.c | 275 + git-request-pull.rb| 199 --- git.c

[PATCH v2 36/44] ruby: bind shortlog()

2013-09-28 Thread Felipe Contreras
Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Notes: There's no need to bind all the shortlog functions, we can easily pass all the commits we want in Ruby. ruby.c | 17 + 1 file changed, 17 insertions(+) diff --git a/ruby.c b/ruby.c index

Re: [PATCH v3] build: add default aliases

2013-09-28 Thread Felipe Contreras
On Tue, Sep 24, 2013 at 1:39 PM, Jonathan Nieder jrnie...@gmail.com wrote: Jeff King wrote: On Sat, Sep 21, 2013 at 02:20:21PM -0500, Felipe Contreras wrote: For now simply add a few common aliases. co = checkout ci = commit rb = rebase st = status Are these the best definitions

Re: [PATCH/RFC 0/7] Support for Ruby

2013-09-28 Thread Felipe Contreras
On Mon, Sep 23, 2013 at 1:17 PM, Felipe Contreras felipe.contre...@gmail.com wrote: Junio C Hamano wrote: In other words, now the Git user and developer community are strong and thriving, we should strive to make the core smaller, not larger, and encourage people to form more third party

Re: [PATCH/RFC 0/7] Support for Ruby

2013-09-28 Thread Felipe Contreras
On Sun, Sep 22, 2013 at 8:41 PM, brian m. carlson sand...@crustytoothpaste.net wrote: On Sun, Sep 22, 2013 at 05:00:44PM -0700, Junio C Hamano wrote: - Moving away from higher-level scripting languages such as shell and Perl. Recent clean --interactive may have added some code that could be

Re: [PATCH/RFC 0/7] Support for Ruby

2013-09-28 Thread Felipe Contreras
On Sat, Sep 21, 2013 at 6:56 PM, brian m. carlson sand...@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 sand...@crustytoothpaste.net wrote: Now, if anybody has ideas into how the bindings could

Re: [msysGit] [PATCH] mingw-multibyte: fix memory acces violation and path length limits.

2013-09-28 Thread Johannes Schindelin
Hi, On Sun, 29 Sep 2013, Wataru Noguchi wrote: --- a/convert.c +++ b/convert.c @@ -724,6 +724,11 @@ static void convert_attrs(struct conv_attrs *ca, const char *path) { int i; static struct git_attr_check ccheck[NUM_CONV_ATTRS]; + + if (NUM_CONV_ATTRS != 0) { +

Re: [PATCH v2 42/44] ruby: remove GIT_PAGER from environment

2013-09-28 Thread Stefan Beller
On 09/29/2013 12:04 AM, Felipe Contreras wrote: We are not calling any git commands any more. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/git-request-pull.rb b/git-request-pull.rb index

Re: [PATCH v2 42/44] ruby: remove GIT_PAGER from environment

2013-09-28 Thread Felipe Contreras
On Sat, Sep 28, 2013 at 6:27 PM, Stefan Beller stefanbel...@googlemail.com wrote: On 09/29/2013 12:04 AM, Felipe Contreras wrote: We are not calling any git commands any more. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- git-request-pull.rb | 2 -- 1 file changed, 2

Re: [PATCH] clone: local URLs are not for ssh

2013-09-28 Thread Duy Nguyen
On Sun, Sep 29, 2013 at 2:37 AM, Torsten Bögershausen tbo...@web.de wrote: git clone /foo/bar:baz or git clone ../foo/bar:baz are meant to clone from the local file system, and not to clone from a remote server over git-over-ssh. I don't think this is necessary. Commit 6000334 should detect

Re: [PATCH] rebase -i: respect to core.abbrev

2013-09-28 Thread Eric Sunshine
On Sat, Sep 28, 2013 at 5:10 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: collapse_todo_ids() uses `git rev-parse --short=7' to abbrev commit ids. Let's drop argument from --short to use default (7) or config value instead. Signed-off-by: Kirill A. Shutemov

Re: [PATCH v3] build: add default aliases

2013-09-28 Thread Michael Haggerty
On 09/29/2013 12:41 AM, Felipe Contreras wrote: On Tue, Sep 24, 2013 at 1:39 PM, Jonathan Nieder jrnie...@gmail.com wrote: On Sat, Sep 21, 2013 at 02:20:21PM -0500, Felipe Contreras wrote: For now simply add a few common aliases. co = checkout ci = commit rb = rebase st = status

Re: [PATCH v2 00/44] Ruby support

2013-09-28 Thread Felipe Contreras
On Sat, Sep 28, 2013 at 11:13 PM, Ramkumar Ramachandra artag...@gmail.com wrote: Felipe Contreras wrote: Felipe Contreras (44): Thanks! In the meantime, can you publish this work somewhere so we can easily try it out? Sure: https://github.com/felipec/git/commits/fc/ruby -- Felipe Contreras

Re: [PATCH v2 00/44] Ruby support

2013-09-28 Thread Ramkumar Ramachandra
Felipe Contreras wrote: Felipe Contreras (44): Thanks! In the meantime, can you publish this work somewhere so we can easily try it out? -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH v2 02/44] ruby: add support for internal ruby programs

2013-09-28 Thread Ramkumar Ramachandra
Felipe Contreras wrote: +$(RUBY_PROGRAMS): git-ruby$X + $(QUIET_BUILT_IN)$(RM) $@ \ + ln lt; $@ 2/dev/null || \ + ln -s lt; $@ 2/dev/null || \ + cp lt; $@ Why so many fallbacks? Will the hard-link (the first ln) ever fail? diff --git a/ruby.c b/ruby.c index

Re: Delivery reports about your e-mail [BOUNCE]

2013-09-28 Thread noreply
Sorry, but spammers are using a...@purpletech.com and I'm not, so I'm retiring it. If you really want to reach me, you can find out my real email address at http://alexchaffee.com -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to

Re: [PATCH v2 01/44] Add support for ruby commands

2013-09-28 Thread Felipe Contreras
On Sat, Sep 28, 2013 at 11:30 PM, Ramkumar Ramachandra artag...@gmail.com wrote: Felipe Contreras wrote: +test_expect_success 'argument passing' ' + cat script -EOF + p($0) + p(ARGV) + EOF + git ruby script foo bar actual + cat expected -EOF +

Re: [PATCH v2 02/44] ruby: add support for internal ruby programs

2013-09-28 Thread Felipe Contreras
On Sat, Sep 28, 2013 at 11:40 PM, Ramkumar Ramachandra artag...@gmail.com wrote: Felipe Contreras wrote: +$(RUBY_PROGRAMS): git-ruby$X + $(QUIET_BUILT_IN)$(RM) $@ \ + ln lt; $@ 2/dev/null || \ + ln -s lt; $@ 2/dev/null || \ + cp lt; $@ Why so many fallbacks? Will

Re: [PATCH v2 10/44] ruby: rewrite 'request-pull'

2013-09-28 Thread Ramkumar Ramachandra
Felipe Contreras wrote: Makefile| 3 +- git-rb-setup.rb | 17 ++ git-request-pull.rb | 146 +++ git-request-pull.sh | 160 Excellent: git-request-pull is now an ELF

Re: [PATCH v2 11/44] ruby: request-pull: rewrite perl script

2013-09-28 Thread Ramkumar Ramachandra
Felipe Contreras wrote: git-request-pull.rb | 65 + 1 file changed, 30 insertions(+), 35 deletions(-) Arguably, more pretty and terse. Again, all tests pass. Looks reasonable. -- To unsubscribe from this list: send the line unsubscribe git

Re: [PATCH v2 02/44] ruby: add support for internal ruby programs

2013-09-28 Thread Felipe Contreras
On Sat, Sep 28, 2013 at 11:56 PM, Felipe Contreras felipe.contre...@gmail.com wrote: On Sat, Sep 28, 2013 at 11:40 PM, Ramkumar Ramachandra diff --git a/ruby.c b/ruby.c index ee6a0e7..339e376 100644 --- a/ruby.c +++ b/ruby.c @@ -52,5 +52,22 @@ static int run_ruby_command(const char *cmd,

Re: [PATCH v2 13/44] ruby: bind setup_git_directory()

2013-09-28 Thread Ramkumar Ramachandra
Felipe Contreras wrote: +static inline VALUE cstr_to_str(const char *str) +{ + if (str == NULL) + return Qnil; + return rb_str_new2(str); +} + +static VALUE git_rb_setup_git_directory(VALUE self) +{ + int nongit_ok; + const char *prefix; +

Re: [PATCH v2 14/44] ruby: bind dwim_ref()

2013-09-28 Thread Ramkumar Ramachandra
Felipe Contreras wrote: static void git_ruby_init(void) { rb_define_global_function(setup_git_directory, git_rb_setup_git_directory, 0); rb_define_global_function(for_each_ref, git_rb_for_each_ref, 0); + rb_define_global_function(dwim_ref, git_rb_dwim_ref, 1); }

Re: [PATCH v2 14/44] ruby: bind dwim_ref()

2013-09-28 Thread Felipe Contreras
On Sun, Sep 29, 2013 at 12:17 AM, Ramkumar Ramachandra artag...@gmail.com wrote: Felipe Contreras wrote: static void git_ruby_init(void) { rb_define_global_function(setup_git_directory, git_rb_setup_git_directory, 0); rb_define_global_function(for_each_ref,

Re: [PATCH v2 13/44] ruby: bind setup_git_directory()

2013-09-28 Thread Felipe Contreras
On Sun, Sep 29, 2013 at 12:11 AM, Ramkumar Ramachandra artag...@gmail.com wrote: Felipe Contreras wrote: +static inline VALUE cstr_to_str(const char *str) +{ + if (str == NULL) + return Qnil; + return rb_str_new2(str); +} + +static VALUE