diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2020-05-30 00:03:26 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-03 15:25:54 +0100 |
commit | c50c0d6144ad290168167ccef948c7b4ffc9665a (patch) | |
tree | 63d45a8de225155cfb840b8a4bf1231c14970161 | |
parent | 0a8252f0cb13e3dc16f70b984f9f98b845b163de (diff) | |
download | openembedded-core-contrib-c50c0d6144ad290168167ccef948c7b4ffc9665a.tar.gz |
lib/oe/patch: GitApplyTree: save 1 echo in commit-msg hook
* also remove the extra blank lines which is often added to patches
when refreshed with devtool (GitApplyTree.patch_line_prefix lines
are ignored when refreshing .patch files, but newly added blank
lines aren't - the leading blank line wasneeded for patches with
just the subject line (to prevent the GitApplyTree.patch_line_prefix
line ending appended to the commit summary), but we can add it
in prepareCommit instead
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oe/patch.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index fa92abe248..bb1c40aa1e 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -508,8 +508,7 @@ class GitApplyTree(PatchTree): with open(commithook, 'w') as f: # NOTE: the formatting here is significant; if you change it you'll also need to # change other places which read it back - f.write('echo >> $1\n') - f.write('echo "%s: $PATCHFILE" >> $1\n' % GitApplyTree.patch_line_prefix) + f.write('echo "\n%s: $PATCHFILE" >> $1' % GitApplyTree.patch_line_prefix) os.chmod(commithook, 0o755) shutil.copy2(commithook, applyhook) try: |