Re: Todays git migration results

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Todays git migration results
Date: 2010-08-17 18:15:59
Message-ID: AANLkTimxvO9qmZRpA18P_b6AJKpzWxwAQWnhTSFTDmHK@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 17, 2010 at 11:54, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Tue, Aug 17, 2010 at 11:46 AM, Alex Hunsaker <badalex(at)gmail(dot)com> wrote:
>> On Tue, Aug 17, 2010 at 09:21, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> On Tue, Aug 17, 2010 at 10:51 AM, Alex Hunsaker <badalex(at)gmail(dot)com> wrote:
>>>> On Tue, Aug 17, 2010 at 08:17, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>>>> /me is very sorry master.  Please beat your unworthy servant only
>>>>> lightly...  or alternatively, buy me a faster machine.
>>>>
>>>> Well, I might be able to afford a beer.
>>>
>>> Done!
>>
>> Well on 2nd thought, maybe not... If people start collecting I'll be
>> broke (notably I owe tom quite a few :-).
>
> Cheapskate.

Its because i'm thinking of getting everyone on -hackers a pony instead!

>> Anyway find below version that passes any arguments through to git-log.
>
> Yeah, I don't think I want to go that route.  Arbitrary user-specified
> arguments to git-log might not be (probably aren't) sane in this
> context, and there's also a chance that might want to have arguments
> that are handled internally by the script, rather than passed through.

Yeah, I originally was just going to do --since. After seeing how
many args git-log can have-- It looked like people might request new
args into the foreseeable future.

Find --since below FWIW:

--
--- git-topo-order (1) 2010-08-17 09:44:18.069517261 -0600
+++ git-topo-order 2010-08-17 12:10:07.312355246 -0600
@@ -26,6 +26,12 @@
use strict;
use warnings;
require Date::Calc;
+use IPC::Open2;
+use Getopt::Long;
+
+# since gets passed through to git-log
+my $since;
+GetOptions('since=s'=>\$since);

my @BRANCHES = qw(master REL9_0_STABLE REL8_4_STABLE REL8_3_STABLE
REL8_2_STABLE REL8_1_STABLE REL8_0_STABLE REL7_4_STABLE);
@@ -34,11 +40,19 @@
my %all_commits_by_branch;

my %commit;
+my %position;
for my $branch (@BRANCHES) {
my $commitnum = 0;
- open(GITLOG, "git log --date=iso origin/$branch |")
+ $position{$branch} = 0;
+
+ my @args = qw(git log --date=iso);
+ push @args, "--since=$since" if($since);
+ push @args, "origin/$branch";
+
+ open2(my $git_out, my $git_in, @args)
|| die "can't run git log origin/$branch: $!";
- while (my $line = <GITLOG>) {
+
+ while (my $line = <$git_out>) {
if ($line =~ /^commit\s+(.*)/) {
push_commit(\%commit) if %commit;
%commit = (
@@ -60,10 +74,6 @@
}
}

-my %position;
-for my $branch (@BRANCHES) {
- $position{$branch} = 0;
-}
while (1) {
my $best_branch;
my $best_inversions;

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-08-17 18:19:00 Re: Writeable CTEs Desgin Doc on Wiki
Previous Message Robert Haas 2010-08-17 18:14:45 Re: refactoring comment.c