Re: [PATCH] Add git-graft-ripple, a tool for permanently grafting history into a tree.
- From
Randal L. Schwartz <merlyn@stonehenge.com>
- Date
- Nov 23, 2005, 14:37 UTC
- Message-ID
- <861x17pgzg.fsf@blue.stonehenge.com>
- In-Reply-To
- <20051123135150.GA16995@mythryan2.michonline.com>
>>>>> "Ryan" == Ryan Anderson <ryan@michonline.com> writes:
Ryan> git_commit_tree():
Ryan> my $found; Ryan> do { Ryan> $found = 0; Ryan> if ($csets{$old}{comments} =~ /\s([a-f0-9]{40})\s/ && Ryan> exists $newcsets{$1}) {
Ryan> my $tcommit = $1;
Ryan> $found = 1; Ryan> $csets{$old}{comments} =~ s/$tcommit/$newcsets{$tcommit}/g; Ryan> } Ryan> } while ($found);
I hate artificial booleans. This is better written as:
{
last unless my ($tcommit) = $csets{$old}{comments} =~ /\s([a-f0-9]{40})\s/;
last unless exists $newcsets{$tcommit};
$csets{$old}{comments} =~ s/$tcommit/$newcsets{$tcommit}/g;
redo;
}-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!