mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-14 08:57:58 +00:00
5c8fdd91dc
Sometimes a commit should have notes enclosed with it rather than withing the cover letter -- possibly even because there is no cover letter. Add a 'Commit-notes' tag, similar to the 'Series-notes' one; lines between this tag and the next END line are inserted in the patch right after the '---' commit delimiter. Change-Id: I01e99ae125607dc6dec08f3be8a5a0b37f0a483d Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Signed-off-by: Simon Glass <sjg@chromium.org> (Updated README)
74 lines
2.1 KiB
Python
74 lines
2.1 KiB
Python
# Copyright (c) 2011 The Chromium OS Authors.
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0+
|
|
#
|
|
|
|
import re
|
|
|
|
# Separates a tag: at the beginning of the subject from the rest of it
|
|
re_subject_tag = re.compile('([^:\s]*):\s*(.*)')
|
|
|
|
class Commit:
|
|
"""Holds information about a single commit/patch in the series.
|
|
|
|
Args:
|
|
hash: Commit hash (as a string)
|
|
|
|
Variables:
|
|
hash: Commit hash
|
|
subject: Subject line
|
|
tags: List of maintainer tag strings
|
|
changes: Dict containing a list of changes (single line strings).
|
|
The dict is indexed by change version (an integer)
|
|
cc_list: List of people to aliases/emails to cc on this commit
|
|
notes: List of lines in the commit (not series) notes
|
|
"""
|
|
def __init__(self, hash):
|
|
self.hash = hash
|
|
self.subject = None
|
|
self.tags = []
|
|
self.changes = {}
|
|
self.cc_list = []
|
|
self.notes = []
|
|
|
|
def AddChange(self, version, info):
|
|
"""Add a new change line to the change list for a version.
|
|
|
|
Args:
|
|
version: Patch set version (integer: 1, 2, 3)
|
|
info: Description of change in this version
|
|
"""
|
|
if not self.changes.get(version):
|
|
self.changes[version] = []
|
|
self.changes[version].append(info)
|
|
|
|
def CheckTags(self):
|
|
"""Create a list of subject tags in the commit
|
|
|
|
Subject tags look like this:
|
|
|
|
propounder: fort: Change the widget to propound correctly
|
|
|
|
Here the tags are propounder and fort. Multiple tags are supported.
|
|
The list is updated in self.tag.
|
|
|
|
Returns:
|
|
None if ok, else the name of a tag with no email alias
|
|
"""
|
|
str = self.subject
|
|
m = True
|
|
while m:
|
|
m = re_subject_tag.match(str)
|
|
if m:
|
|
tag = m.group(1)
|
|
self.tags.append(tag)
|
|
str = m.group(2)
|
|
return None
|
|
|
|
def AddCc(self, cc_list):
|
|
"""Add a list of people to Cc when we send this patch.
|
|
|
|
Args:
|
|
cc_list: List of aliases or email addresses
|
|
"""
|
|
self.cc_list += cc_list
|