-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
Description
The is a bug when using rebase on a feature.
Use case
- Create release
- Create feature-1
- Commit on feature-1 and push it
- Merge feature-1 into release
- Create feature-2
- Need feature-2 to start from feature-1 and use rebase to do it
- Commit on feature-2 and push it (this need a pull before the push)
- Run twgit release list
In this case, we can see a warning on feature-2
Release: origin/release-1.1.0 (from v1.0.0)
commit 98f92985220d06ce165d2a5689ecd42bd42d00fb
Author: Laurent Toussaint <laurent.toussaint@twenga.com>
Date: Mon Jan 11 17:31:08 2016 +0100
Features:
- origin/feature-1 [merged]
- origin/feature-2 /!\ merged, then in progress.
But this feature is not merged into the release as we can see using git log on the release
The problem comes from the git pull creating a merge between the local feature and the distant one.
Ideally we should use the command git pull --rebase=true to prevent this error, but even using a simple git pull, we should not have this issue.
How to reproduce the issue bug
- twgit version 1.17.0
- git version 1.9.1
And run
twgit='twgit' \
&& cd /tmp && rm -rf /tmp/twgit \
&& mkdir -p /tmp/twgit/parent /tmp/twgit/local1 \
&& cd /tmp/twgit/parent && git init \
&& cd /tmp/twgit/local1 && $twgit init 1.0.0 /tmp/twgit/parent \
&& $twgit release start -I \
&& $twgit feature start 1 \
&& git commit --allow-empty -m "empty1" && git push origin feature-1 \
&& $twgit feature merge-into-release 1 \
&& $twgit feature start 2 \
&& git rebase feature-1 \
&& git commit --allow-empty -m "empty2" && git pull && git push origin feature-2 \
&& $twgit release list
How to fix it
Look at thiese functions
- get_features merged_in_progress $release_fullname (inc/twgit_release.inc.sh line 252)
- get_features merged_in_progress $super_branch (inc/common.inc.sh line 1171)
- Maybe other functions