lib/oe/patch: Add GitApplyTree.commitIgnored()

This function can be used to create a commit that devtool will ignore
when creating/updating the patches.

(From OE-Core rev: 94f0838b9223b7ece7affaa707e54a5d784da25e)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Peter Kjellerstedt
2024-02-19 02:28:29 +01:00
committed by Richard Purdie
parent 24433ce8f9
commit ff63bc403d

View File

@@ -460,6 +460,16 @@ class GitApplyTree(PatchTree):
cmd.append('--date="%s"' % date)
return (tmpfile, cmd)
@staticmethod
def commitIgnored(subject, dir=None, files=None, d=None):
if files:
runcmd(['git', 'add'] + files, dir)
message = "%s\n\n%s" % (subject, GitApplyTree.ignore_commit_prefix)
cmd = ["git"]
GitApplyTree.gitCommandUserOptions(cmd, d=d)
cmd += ["commit", "-m", message, "--no-verify"]
runcmd(cmd, dir)
@staticmethod
def extractPatches(tree, startcommits, outdir, paths=None):
import tempfile