Generalization of the `.git/MERGE_MSG' path#1
Merged
PlaidCat merged 1 commit intoctrliq:mainlinefrom Jan 10, 2025
Merged
Conversation
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'.
gvrose8192
approved these changes
Jan 9, 2025
Contributor
gvrose8192
left a comment
There was a problem hiding this comment.
git-worktree - I confess I have never used it, but has some intriguing possibilities. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generalization of the
.git/MERGE_MSGpathIn general the
MERGE_MSGfile doesn't need to be located under the local.gitdirectory. In these cases the scriptciq-cherry-pick.pywill fail.An example would be a git repository created with
git-worktree. Assume the current directory contains a regular git repositorysome-projectwith a branchbranch-xand some commit with a hash ‹some-commit›. Without this change the last command would fail while it shouldn'tIn case of the
some-project-branch-xrepository theMERGE_MSGfile is undersome-project/.git/worktrees/some-project-branch-x/MERGE_MSG.While the
git worktreemay 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 theciq-cherry-pick.pyprogram. It may therefore be expected to be used more often than usual in conjunction with this tool.