Changeset 24449 in webkit


Ignore:
Timestamp:
Jul 19, 2007 10:24:03 AM (17 years ago)
Author:
aroben
Message:

Make commit-log-editor work with git

Reviewed by Sam.

  • Scripts/commit-log-editor: Use VCSUtils and accept a git-style commit message template. Also removed the unused $breakPoint variable.
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r24448 r24449  
     12007-07-19  Adam Roben  <aroben@apple.com>
     2
     3        Make commit-log-editor work with git
     4
     5        Reviewed by Sam.
     6
     7        * Scripts/commit-log-editor: Use VCSUtils and accept a git-style
     8        commit message template. Also removed the unused $breakPoint variable.
     9
    1102007-07-19  Adam Roben  <aroben@apple.com>
    211
  • trunk/WebKitTools/Scripts/commit-log-editor

    r17203 r24449  
    11#!/usr/bin/perl -w
    22
    3 # Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
     3# Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
    44#
    55# Redistribution and use in source and binary forms, with or without
     
    3232use FindBin;
    3333use lib $FindBin::Bin;
     34use VCSUtils;
    3435use webkitdirs;
    3536
     
    5859}
    5960
    60 my $breakPoint = 0;
     61my $inChangesToBeCommitted = !isGit();
    6162my @changeLogs = ();
    6263my $logContents = "";
     64my $existingLog = 0;
    6365open LOG, $log or die;
    6466while (<LOG>) {
    65     $breakPoint = /^--This line, and those below, will be ignored--$/ unless $breakPoint;
     67    if (isGit()) {
     68        if (/^# Changes to be committed:$/) {
     69            $inChangesToBeCommitted = 1;
     70        } elsif ($inChangesToBeCommitted && /^# \S/) {
     71            $inChangesToBeCommitted = 0;
     72        }
     73    }
     74
    6675    $logContents .= $_;
    67     push @changeLogs, $1 if /^M....(.*ChangeLog)$/ && !/-ChangeLog/;
     76    $existingLog = isGit() && !/^#/ unless $existingLog;
     77
     78    push @changeLogs, makeFilePathRelative($1) if $inChangesToBeCommitted && (/^M....(.*ChangeLog)$/ || /^#\tmodified:   (.*ChangeLog)/) && !/-ChangeLog/;
    6879}
    6980close LOG;
     81
     82# Don't change anything if there's already a log message
     83# (as can happen with git-commit --amend)
     84exec $editor, @ARGV if $existingLog;
    7085
    7186my %changeLogSort;
Note: See TracChangeset for help on using the changeset viewer.