link_issue: Linking issues in commit messages

Description Usage Arguments Details Value

Description

Trac ticket IDs are often referenced in git commit messages as e.g. #123. Assuming that tickets have been converted to issues and pushed to GitHub this function can be used in a script with git filter-branch to rewrite commit messages and replacing ticket references with issue references.

Usage

1
link_issue(ticket_id, db)

Arguments

ticket_id

character string of the form #123

db

data frame mapping tickets to issues, see Details

Details

The data frame must contain columns trac_ticket_id and gh_issue_number containing Trac ticket ID and corresponding GH issue number.

If the ticket_id number is found in db it is replaced with a string #XXX where XXX is the corresponding issue number. Original Trac ticket ID is also displayed in square brackets. If ticket_id is not found in db, the original reference is replaced with trac ticket info in square brackets.

Value

String with ticket reference replaced with GH reference (if found in db).


mbojan/trac2gh documentation built on May 22, 2019, 12:56 p.m.