Skip to content

Conversation

@pvts-mat
Copy link
Contributor

@pvts-mat pvts-mat commented Jan 7, 2025

Generalization of the .git/MERGE_MSG path

In general the MERGE_MSG file doesn't need to be located under the local .git directory. In these cases the script ciq-cherry-pick.py will fail.

An example would be a git repository created with git-worktree. Assume the current directory contains a regular git repository some-project with a branch branch-x and some commit with a hash ‹some-commit›. Without this change the last command would fail while it shouldn't

cd some-project
git worktree add ../some-project-branch-x  branch-x
cd ../some-project-branch-x
python3 ‹kernel-src-tree-tools-dir›/ciq-cherry-pick.py --sha ‹some-commit›

In case of the some-project-branch-x repository the MERGE_MSG file is under some-project/.git/worktrees/some-project-branch-x/MERGE_MSG.

While the git worktree may seem an exotic feature of git, it lends itself perfectly to making the same logical change across multiple branches, like the task of backporting bug fixes to different Rocky versions - a motivation for the ciq-cherry-pick.py program. It may therefore be expected to be used more often than usual in conjunction with this tool.

In general the `MERGE_MSG' file doesn't need to be located under the
local `.git' directory. In these cases the script `ciq-cherry-pick.py'
will fail.

An example would be a git repository created with `git-worktree'. Assume
the current directory contains a regular git repository `some-project'
with a branch `branch-x' and some commit with a hash
‹some-commit›. Without this change the last command would fail while it
shouldn't

,----
| cd some-project
| git worktree add ../some-project-branch-x  branch-x
| cd ../some-project-branch-x
| python3 ‹kernel-src-tree-tools-dir›/ciq-cherry-pick.py --sha ‹some-commit›
`----

In case of the `some-project-branch-x' repoitory the `MERGE_MSG' file is
under `some-project/.git/worktrees/some-project-branch-x/MERGE_MSG'.
Copy link
Contributor

@gvrose8192 gvrose8192 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git-worktree - I confess I have never used it, but has some intriguing possibilities. Thanks!

Copy link
Collaborator

@bmastbergen bmastbergen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@PlaidCat PlaidCat merged commit b46c37b into ctrliq:mainline Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants