This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Merging FSFChangeLog


Currently, there is a number of FSFChangeLog* files in the gcc
directory. I think the naming of the files is misleading. They are not
authored by the FSF (but by the GCC maintainers); although their
copyright is held by the FSF, the same is true for any other file in
GCC (in particular ChangeLog*). 

I understand the historical reasons for that situation; but I'd like
to see it stop, and have GCC continue with the tradition of numbered
changelogs (i.e. ChangeLog.10, ChangeLog.11, ChangeLog.12 and so on).

I have written a script to merge two ChangeLogs, by date, and I
volunteer to perform the actual merging. I understand that it is
confusing to give a total ordering to things that were not originally
ordered, but I feel that the current situation is more confusing.

In particular, I would perform the following changes:
- rename FSFChangeLog.10 to ChangeLog.10
- merge ChangeLog.0, ChangeLog.1, FSFChangeLog.11, and FSFChangeLog,
  and split them into ChangeLog.11, ChangeLog.12, and ChangeLog.13
  (or perhaps into four parts)

The current ChangeLog is not affected, as it is completely newer than
the newest FSFChangeLog entry.

I don't know whether it is meaningful to pull in older ChangeLogs
(i.e. before ChangeLog.9), I lean towards having the full change
history of GCC in CVS.

Maintainers, what do you think?

Martin

#! /usr/bin/env python

import string, sys

class Ignored(Exception):pass

class Date:
    def __init__(self,line):
        if line[:2] == "19":
            self.newstyle (line)
        elif string.find (line, "19") == -1:
            print "No date in",line[:-1]
            raise Ignored
        else:
            self.oldstyle(line)

    def newstyle(self,line):
        self.year = string.atoi (line[0:4])
        self.month = string.atoi (line[5:7])
        self.day = string.atoi (line[8:10])

    months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
              "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
    def oldstyle(self,line):
        fields = string.split (line)
        self.day = self.month = self.year = None
        for f in fields:
            if string.find(f, ":") >= 0:
                self.time = f
                continue
            if f[:2] == "19":
                self.year = string.atoi(f)
                if self.year > 1900:
                    continue
                self.year = None
            if not self.day:
                try:
                    self.day = string.atoi (f)
                    if self.day < 1 or self.day > 32:
                        self.day = None
                except ValueError:
                    pass
                if self.day:
                    continue
            if not self.month:
                try:
                    self.month = self.months.index (f) + 1
                except ValueError:
                    pass
        if self.day and self.month and self.year:
            return
        print "Incomplete date",line
        raise Ignored()

    def __cmp__(self, other):
        r = cmp(self.year, other.year)
        if r: return r
        r = cmp(self.month, other.month)
        if r: return r
        return cmp(self.day, other.day)

class Entry:
    def __init__ (self,lines):
        self.date = Date (lines[0])
        self.lines = lines

    def __cmp__(self, other):
        # Sort in reverse order
        r = cmp (self.date, other.date)
        if r: return -r
        return - cmp (self.lines, other.lines)

def parsefile (name):
    lines = open (name).readlines()
    result = []
    start = 0
    while start < len(lines):
        end = start + 1
        while end<len(lines) and (lines[end][0] in string.whitespace):
            end = end + 1
        try:
            result.append (Entry (lines[start:end]))
        except Ignored:
            pass
        start = end
    return result

entries = []

for name in sys.argv[1:]:
    entries = entries + parsefile (name)

entries.sort()

f = open ("Changelog.out", "w")
for e in entries:
    f.writelines (e.lines)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]