poky/scripts/lib/devtool
Peter Kjellerstedt 4cfd0f7e4e lib/oe/patch: Use git notes to store the filenames for the patches
The old way of keeping track of the filenames for the patches that
correspond to the commits was to add a special comment line to the end
of the commit message, e.g., "%% original patch: <filename>", using a
temporary git hook. This method had some drawbacks, e.g.:

* It caused problems if one wanted to push the commits upstream as the
  comment line had to be manually removed.
* The comment line would end up in patches if someone used git
  format-path rather than devtool finish to generate the patches.
* The comment line could interfere with global Git hooks used to
  validate the format of the Git commit message.
* When regenerating patches with `devtool finish --force-patch-refresh`,
  the process typically resulted in adding empty lines to the end of the
  commit messages in the updated patches.

A better way of keeping track of the patch filenames is to use Git
notes. This way the commit messages remain unaffected, but the
information is still shown when, e.g., doing `git log`. A special Git
notes space, refs/notes/devtool, is used to not intefere with the
default Git notes. It is configured to be shown in, e.g., `git log` and
to survive rewrites (i.e., `git commit --amend` and `git rebase`).

Since there is no longer any need for a temporary Git hook, the code
that manipulated the .git/hooks directory has also been removed. To
avoid potential problems due to global Git hooks, --no-verify was added
to the `git commit` command.

To not cause troubles for those who have done `devtool modify` for a
recipe with the old solution and then do `devtool finish` with the new
solution, the code will fall back to look for the old strings in the
commit message if no Git note can be found.

While not technically motivated like above, the way to keep track of
ignored commits is also changed to use Git notes to avoid having
different methods to store similar information.

(From OE-Core rev: f5e6183b9557477bef74024a587de0bfcc2b7c0d)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19 16:03:22 +00:00
..
ide_plugins devtool: new ide-sdk plugin 2024-02-18 07:34:42 +00:00
__init__.py devtool: Make use of oe.patch.GitApplyTree.commitIgnored() 2024-02-19 16:03:22 +00:00
build_image.py Convert to new override syntax 2021-08-02 15:44:10 +01:00
build_sdk.py devtool/build_sdk: Drop unused imports 2023-09-18 08:53:10 +01:00
build.py devtool: build: Also run deploy for devtool build if applicable 2019-08-21 21:52:59 +01:00
deploy.py devtool: refactor deploy-target 2024-02-02 10:38:28 +00:00
export.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
ide_sdk.py devtool: ide-sdk make deploy-target quicker 2024-02-18 07:34:42 +00:00
import.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
menuconfig.py meta: remove True option to getVar and getVarFlag calls (again) 2023-02-02 09:50:02 +00:00
package.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
runqemu.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00
sdk.py build-sysroots: target or native sysroot population need to be selected explicitly 2023-09-09 12:04:55 +01:00
search.py package/scripts: Fix FILES_INFO handling 2021-08-17 09:53:04 +01:00
standard.py lib/oe/patch: Use git notes to store the filenames for the patches 2024-02-19 16:03:22 +00:00
upgrade.py lib/oe/patch: Use git notes to store the filenames for the patches 2024-02-19 16:03:22 +00:00
utilcmds.py meta/lib+scripts: Convert to SPDX license headers 2019-05-09 16:31:55 +01:00