From ff63bc403dd8e7201e8408dd8cedbf26280e9640 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Mon, 19 Feb 2024 02:28:29 +0100 Subject: 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 Signed-off-by: Richard Purdie --- meta/lib/oe/patch.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index 70cdb1d9c0..3ded5f3601 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -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 -- cgit v1.2.3-54-g00ecf