NAME

GITCVS::log

DESCRIPTION

This module provides very crude logging with a similar interface to Log::Log4perl

METHODS

new

Creates a new log object, optionally you can specify a filename here to indicate the file to log to. If no log file is specified, you can specify one later with method setfile, or indicate you no longer want logging with method nofile.

Until one of these methods is called, all log calls will buffer messages ready to write out.

setfile

This methods takes a filename, and attempts to open that file as the log file. If successful, all buffered data is written out to the file, and any further logging is written directly to the file.

nofile

This method indicates no logging is going to be used. It flushes any entries in the internal buffer, and sets a flag to ensure no further data is put there.

_logopen

Internal method. Returns true if the log file is open, false otherwise.

debug info warn fatal

These four methods are wrappers to _log. They provide the actual interface for logging data.

_log

This is an internal method called by the logging functions. It generates a timestamp and pushes the logged line either to file, or internal buffer.

DESTROY

This method simply closes the file handle if one is open

METHODS

new

tablename

update

gethead

getlog

getmeta

This function takes a filename (with path) argument and returns a hashref of metadata for that file.

commitmessage

this function takes a commithash and returns the commit message for that commit

gethistory

This function takes a filename (with path) argument and returns an arrayofarrays containing revision,filehash,commithash ordered by revision descending

gethistorydense

This function takes a filename (with path) argument and returns an arrayofarrays containing revision,filehash,commithash ordered by revision descending.

This version of gethistory skips deleted entries -- so it is useful for annotate. The 'dense' part is a reference to a '--dense' option available for git-rev-list and other git tools that depend on it.

in_array()

from Array::PAT - mimics the in_array() function found in PHP. Yuck but works for small arrays.

safe_pipe_capture

an alternative to `command` that allows input to be passed as an array to work around shell problems with weird characters in arguments

mangle_dirname

create a string from a directory name that is suitable to use as part of a filename, mainly by converting all chars except \w.- to _

mangle_tablename

create a string from a that is suitable to use as part of an SQL table name, mainly by converting all chars except \w to _