Is it possible to merge a tag to a branch when the changes are already incorporated into the branch? I'm trying to populate the Precedes
line in gitk
Edit: When I do git merge <TAG>
it fails to merge since the branch doesn't have any differences.
Edit2: We are using a gitflow process where we have master, develop, and PTR branches. Our process is to make a release branch from develop. Once tested the release branch is squashed and merged to master. The squashed commit is tagged on master. Then tag is then merged back to the release branch and then merged to develop. The issue we're running into is commits on release do not Precede the tag. It makes it difficult to verify if a commit was part of a build
when the changes are already incorporated into the branch?
That means:
-x--x--x--x--x (master)
/
-y--y--y--y--y (abranch)
|
(tagT)
Since the tag reference a commit which was already merged to master, ant git merge <atag>
will be a no-op.
And the tag won't be part of the master branch, it remains part of abranch.
That means git branch --contain <aTag>
won't include master
.
See also "Verify if a tag was done in the master branch".
In the new gitflow context provided by the OP:
Our process is to make a
release
branch fromdevelop
.
Once tested therelease
branch is squashed and merged tomaster
The squashed commit is tagged onmaster
(aTag)
|
-m--m--m--m--m--R (master, with release squashed-commit)
r--r--r--r (release)
/
-d--d--d (develop)
Then tag is then merged back to the
release
branch and then merged todevelop
(aTag)
|
-m--m--m--m--m--R (master, with release squashed-commit)
\------------\
r--r--r--r-----r' (release) \
/ \
-d--d--d---------------------------d' (develop)
The issue we're running into is commits on
release
do not Precede the tag. It makes it difficult to verify if a commit was part of a build
From the schema:
aTag
is reachable from the second parent (git describe aCommit^2
)Then that commit is part of the "aTag
" build.
The problem, indeed:
The problem is in gitk,
r1
,r2
,r3
,r4
do not show aPrecedes: <tag>
that was merged inr'
I agree. Gitk won't be able to show that tag.
I would put a tag to r'
, with a similar name as aTag
, in order to get a better idea of the "Precedes
" part in Gitk.