|
|
|
@ -169,26 +169,26 @@ func (r EnrichedRecord) ToString() (string, error) { |
|
|
|
// Enriched - returnd enriched record
|
|
|
|
// Enriched - returnd enriched record
|
|
|
|
func Enriched(r Record) EnrichedRecord { |
|
|
|
func Enriched(r Record) EnrichedRecord { |
|
|
|
record := EnrichedRecord{Record: r} |
|
|
|
record := EnrichedRecord{Record: r} |
|
|
|
|
|
|
|
// normlize git remote
|
|
|
|
|
|
|
|
record.GitOriginRemote = NormalizeGitRemote(record.GitOriginRemote) |
|
|
|
|
|
|
|
record.GitOriginRemoteAfter = NormalizeGitRemote(record.GitOriginRemoteAfter) |
|
|
|
// Get command/first word from commandline
|
|
|
|
// Get command/first word from commandline
|
|
|
|
var err error |
|
|
|
var err error |
|
|
|
record.Command, record.FirstWord, err = GetCommandAndFirstWord(r.CmdLine) |
|
|
|
err = r.Validate() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
record.Errors = append(record.Errors, "GetCommandAndFirstWord error:"+err.Error()) |
|
|
|
record.Errors = append(record.Errors, "Validate error:"+err.Error()) |
|
|
|
// rec, _ := record.ToString()
|
|
|
|
// rec, _ := record.ToString()
|
|
|
|
// log.Println("Invalid command:", rec)
|
|
|
|
// log.Println("Invalid command:", rec)
|
|
|
|
record.Invalid = true |
|
|
|
record.Invalid = true |
|
|
|
return record |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
err = r.Validate() |
|
|
|
record.Command, record.FirstWord, err = GetCommandAndFirstWord(r.CmdLine) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
record.Errors = append(record.Errors, "Validate error:"+err.Error()) |
|
|
|
record.Errors = append(record.Errors, "GetCommandAndFirstWord error:"+err.Error()) |
|
|
|
// rec, _ := record.ToString()
|
|
|
|
// rec, _ := record.ToString()
|
|
|
|
// log.Println("Invalid command:", rec)
|
|
|
|
// log.Println("Invalid command:", rec)
|
|
|
|
record.Invalid = true |
|
|
|
record.Invalid = true // should this be really invalid ?
|
|
|
|
} |
|
|
|
} |
|
|
|
record.GitOriginRemote = NormalizeGitRemote(record.GitOriginRemote) |
|
|
|
|
|
|
|
return record |
|
|
|
return record |
|
|
|
// TODO: Detect and mark simple commands r.Simple
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Merge two records (part1 - collect + part2 - postcollect)
|
|
|
|
// Merge two records (part1 - collect + part2 - postcollect)
|
|
|
|
|