Skip to content

Commit

Permalink
Minor fixes to git-cherry-plan
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnks committed Dec 14, 2023
1 parent 2ba1c78 commit 43d4c92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions devel_doc/git-cherry-plan
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Plan(object):

# Patterns for matching a commit line and the footer
self.re_commit = re.compile(
'^(....) (.{{{abbrev}}}) (.+)$'.format(abbrev=self.abbrev))
'^([^#]...) (.{{{abbrev}}}) (.+)$'.format(abbrev=self.abbrev))
self.re_footer = re.compile(
'^# Rebase .{{{abbrev}}}\\.\\.'.format(abbrev=self.abbrev))

Expand Down Expand Up @@ -147,7 +147,7 @@ class Plan(object):
# Parse a commit
command, hash, subject = m.groups()
if command not in COMMANDS:
raise UnknownCommandError(command)
raise UnknownCommandError(line)
hash = rev_parse(hash, False)
commit = Commit(COMMANDS[command], hash, subject, self.abbrev)

Expand Down Expand Up @@ -365,7 +365,8 @@ FOOTER = '''
#
# These lines MUST NOT be re-ordered; they are executed from top to bottom.
#
# vim:syntax=gitrebase'''
# vim:syntax=gitrebase
'''

# Map command markers in a plan file to the constants
COMMANDS = {
Expand Down
5 changes: 5 additions & 0 deletions devel_doc/gitconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[cherryPlan]
backportPatterns = ^\\(backported from commit (.*)\\)$
# The following are only here to match existing commits on rpm-4.18.x
backportPatterns = ^\\(backport of (.*)\\)$
backportPatterns = ^Backported from commit (.*)$
backportPatterns = ^\\(cherry pick of (.*)\\.\\)$
backportPatterns = ^\\(cherry pick of commit (.*)\\)$
[cherryPlan "automark"]
pick = test,documentation,build
[changelog]
Expand Down

0 comments on commit 43d4c92

Please sign in to comment.