Re: [IGNORE] Implement 'git rebase' in ruby

2013-06-11 Thread Paolo Ciarrocchi
On Mon, Jun 10, 2013 at 11:47 PM, Felipe Contreras
 wrote:
>
> This is not my first patch that gets rejected, but it's the first one
> that gets rejected by Junio without even looking at it. What is
> anybody supposed to think about that?

My very humble opinion: submit again the series without including in
the cover letter "This patch will not be applied"
and then handle the feedbacks.

In short, everybody should simply approach again your work with a "fresh mind".

regards,
--
Paolo
--
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  http://vger.kernel.org/majordomo-info.html


Re: [IGNORE] Implement 'git rebase' in ruby

2013-06-10 Thread Felipe Contreras
On Mon, Jun 10, 2013 at 3:07 PM, Ramkumar Ramachandra
 wrote:
> Felipe Contreras wrote:
>> I think that's the only way forward, since the Git project doesn't
>> wish to be improved.
>>
>> Perhaps it's time for me to create a pseudonym, and when you have to
>> do that to land clearly good patches, you know something is *REALLY*
>> wrong with the project.
>
> I ask only for your patience, Felipe.

How much time? A day? A week? A month? Not even a year would make my
patches to 'git cherry-pick' and 'git rebase' be magically applied.

This is not my first patch that gets rejected, but it's the first one
that gets rejected by Junio without even looking at it. What is
anybody supposed to think about that?

-- 
Felipe Contreras
--
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  http://vger.kernel.org/majordomo-info.html


Re: [IGNORE] Implement 'git rebase' in ruby

2013-06-10 Thread Ramkumar Ramachandra
Felipe Contreras wrote:
> I think that's the only way forward, since the Git project doesn't
> wish to be improved.
>
> Perhaps it's time for me to create a pseudonym, and when you have to
> do that to land clearly good patches, you know something is *REALLY*
> wrong with the project.

I ask only for your patience, Felipe.

Let's give it a few days to calm down, and discuss things rationally
with people.  The project does have some mental blocks, but it is not
an insurmountable problem.
--
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  http://vger.kernel.org/majordomo-info.html


Re: [IGNORE] Implement 'git rebase' in ruby

2013-06-10 Thread Felipe Contreras
On Mon, Jun 10, 2013 at 2:48 AM, Ramkumar Ramachandra
 wrote:
> Felipe Contreras wrote:
>>  git-rebase.rb | 2056 
>> +
>>  1 file changed, 2056 insertions(+)
>>  create mode 100755 git-rebase.rb
>
> I suggest putting this in contrib/ and cooking it.  As usual, my
> mantra is: let the patches decide what to do.  I'll help review and
> improve this soon.

What would be the point? There's only so much this script could do. I
was already relying on an improved 'git cherry-pick' that's never
going to happen.

I think it would be more interesting to fork Git, replace all the main
builtin commands with Ruby scripts that access libgit.a, and copy the
code to a libgit-ng library that has stuff that is worthy of being on
a library until the scripts don't access libgit.a any more. All the
time passing all tests in the test framework of course.

Then there would be a truly useful and stable Git library, and we
would have scripts that work on all platforms, including Windows,
without any forks, and the commands would be more maintainable, and
would gather the potential of so many Ruby developers, which if GitHub
is any indication; a lot of them love Git.

I think that's the only way forward, since the Git project doesn't
wish to be improved.

There's only one last patch series that I'll try to push to Git that
I've been cooking for years. Sadly, I don't think it's going to land,
despite it being clearly good, and a simple single patch doing the
trick, and it would be immensely useful for our users, who have
complained about that for years, and most Git developers have agreed
it needs to be done. Yet, if I send it, it would not land.

Perhaps it's time for me to create a pseudonym, and when you have to
do that to land clearly good patches, you know something is *REALLY*
wrong with the project.

-- 
Felipe Contreras
--
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  http://vger.kernel.org/majordomo-info.html


Re: [IGNORE] Implement 'git rebase' in ruby

2013-06-10 Thread Ramkumar Ramachandra
Felipe Contreras wrote:
>  git-rebase.rb | 2056 
> +
>  1 file changed, 2056 insertions(+)
>  create mode 100755 git-rebase.rb

I suggest putting this in contrib/ and cooking it.  As usual, my
mantra is: let the patches decide what to do.  I'll help review and
improve this soon.

Thanks.
--
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  http://vger.kernel.org/majordomo-info.html


[IGNORE] Implement 'git rebase' in ruby

2013-06-09 Thread Felipe Contreras
Ignore this patch. I was using this to test and improve 'git rebase', and I was
using the lessons learned to improve 'git rebase' shell script.

I was planning it to clean it even more, and simplify it using tricks specific
to Ruby.

But no more.

There's no point in trying to improve 'git rebase'. It will remain forever as a
barely maintainable mesh of shell scripts, that aren't even consistent among
themselves.

Maybe somebody in the future will find this useful. So here it is.

Signed-off-by: Felipe Contreras 
---
 git-rebase.rb | 2056 +
 1 file changed, 2056 insertions(+)
 create mode 100755 git-rebase.rb

diff --git a/git-rebase.rb b/git-rebase.rb
new file mode 100755
index 000..3ec1ad6
--- /dev/null
+++ b/git-rebase.rb
@@ -0,0 +1,2056 @@
+#!/usr/bin/env ruby
+
+require 'optparse'
+require 'fileutils'
+
+def `(cmd)
+  IO.popen(cmd) { |pipe| pipe.read.chomp }
+end
+
+class Array
+  def to_f
+File.join(self)
+  end
+end
+
+class CommandError < RuntimeError
+
+  attr_reader :command, :output
+
+  def initialize(command, output)
+@command = command
+@output = output
+  end
+
+  def to_s
+Array(@command).join(' ').inspect
+  end
+
+end
+
+def run(*args)
+  out = nil
+  if args.first.kind_of?(Hash)
+env = args.shift
+  else
+env = ENV
+  end
+
+  cmd = args.shift
+  opts = args.shift || {}
+
+  to_read = opts.delete(:read)
+  to_write = opts.delete(:write)
+  silent = opts.delete(:silent)
+
+  verbose = silent ? $verbose : !to_read
+
+  if to_write
+mode = 'r+'
+  elsif opts[:out]
+mode = 'w'
+  else
+mode = 'r'
+  end
+
+  opts[:err] = [:child, :out] unless verbose
+
+  IO.popen(env, cmd, mode, opts) do |pipe|
+if to_write
+  pipe.write(to_write)
+  pipe.close_write
+end
+out = pipe.read.chomp if not opts[:out]
+  end
+  if out and not out.empty?
+puts out if verbose or not $?.success?
+  end
+  raise CommandError.new(cmd, out) unless $?.success?
+  out
+end
+
+def die(*msg)
+  $stderr.puts(msg * "\n")
+  exit 1
+end
+
+def say(*msg)
+  puts msg * "\n" unless $GIT_QUIET
+end
+
+$GIT_DIR = File.absolute_path(`git rev-parse --git-dir`)
+$GIT_QUIET = nil
+
+$merge_dir = File.join($GIT_DIR, 'rebase-merge')
+$apply_dir = File.join($GIT_DIR, 'rebase-apply')
+$verbose = true
+
+ENV['GIT_REFLOG_ACTION'] ||= 'rebase'
+
+$opts = {}
+$opts[:diffstat] = true if `git config --bool rebase.stat` == 'true'
+$opts[:autosquash] = true if `git config --bool rebase.autosquash` == 'true'
+$opts[:autostash] = true if `git config --bool rebase.autostash` == 'true'
+$opts[:am] = []
+
+cmds = []
+strategy = nil
+strategy_opts = []
+rebase_root = nil
+force_rebase = false
+rerere_autoupdate = nil
+state_dir = nil
+preserve_merges = false
+keep_empty = false
+
+action = nil
+onto = nil
+revisions = nil
+head_name = nil
+orig_head = nil
+onto_name = nil
+switch_to = nil
+upstream = nil
+squash_onto = nil
+
+msgend = nil
+msgnum = nil
+last_count = nil
+
+rewritten = nil
+todo = nil
+done = nil
+dropped = nil
+msg = nil
+author_script = nil
+amend = nil
+rewritten_list = nil
+rewritten_pending = nil
+orig_reflog_action = nil
+comment_char = nil
+squash_msg = nil
+fixup_msg = nil
+
+pick_one_preserving_merges = nil
+interactive_rebase = nil
+
+optparser = OptionParser.new do |opts|
+  opts.program_name = 'git rebase'
+  opts.banner = 'usage: git rebase [-i] [options] [--exec ] [--onto 
] [] []
+   or: git rebase [-i] [options] [--exec ] [--onto ] --root 
[]
+   or: git-rebase --continue | --abort | --skip | --edit-todo'
+
+  opts.separator ''
+  opts.separator 'Available options are'
+
+  opts.on('--[no-]verify') do |v|
+$opts[:ok_to_skip_pre_rebase] = !v
+  end
+
+  opts.on('--autostash') do |v|
+$opts[:autostash] = v
+  end
+
+  opts.on('--onto BASE') do |v|
+onto = v
+  end
+
+  opts.on('-x', '--exec CMD') do |v|
+cmds << v
+  end
+
+  opts.on('-i', '--interactive') do
+interactive_rebase = :explicit
+$opts[:type] = :interactive
+  end
+
+  opts.on('-k', '--keep-empty') do
+keep_empty = true
+  end
+
+  opts.on('-p', '--preserve-merges') do
+preserve_merges = true
+interactive_rebase = :implied if not interactive_rebase
+$opts[:type] = :interactive
+  end
+
+  opts.on('--[no-]autosquash') do |v|
+$opts[:autosquash] = v
+  end
+
+  opts.on('-M') do
+# nothing
+  end
+
+  opts.on('-m', '--merge') do
+# nothing
+  end
+
+  opts.on('-X', '--strategy-option STRAT') do |v|
+strategy_opts << v
+strategy = 'recursive' if not strategy
+  end
+
+  opts.on('-s', '--strategy STRAT') do |v|
+strategy = v
+  end
+
+  opts.on('--[no-]stat') do |v|
+$opts[:diffstat] = v
+  end
+
+  opts.on('-n') do
+$opts[:diffstat] = false
+  end
+
+  opts.on('-v', '--verbose') do
+$opts[:verbose] = true
+  end
+
+  opts.on('-q', '--quiet') do
+$opts[:verbose] = false
+  end
+
+  opts.on('--whitespace KIND') do |v|
+$opts[:am] << '--whitespace=%s' % v
+case v