]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
lib/oe/patch: Add GitApplyTree.commitIgnored()
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Mon, 19 Feb 2024 01:28:29 +0000 (02:28 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 19 Feb 2024 16:02:20 +0000 (16:02 +0000)
This function can be used to create a commit that devtool will ignore
when creating/updating the patches.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/patch.py

index 70cdb1d9c01adefac48bc6d3894572636cae9fd2..3ded5f36016952d6286f37a5ae03aec52637526e 100644 (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