Twenga / twgit

Twgit is a free and open source assisting tools for managing features, hotfixes and releases on Git repositories. It provides simple, high-level commands to adopt the branching model describes in our documentation. Supported OS: Debian/Ubuntu Linux, Mac OS X 10.8 (Mountain Lion) or lower.
http://twgit.twenga.com/
Other
111 stars 34 forks source link

Bug with release when using rebase on features #162

Open ltoussaint opened 8 years ago

ltoussaint commented 8 years ago

The is a bug when using rebase on a feature.

Use case

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

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

ltoussaint commented 8 years ago

Maybe we should think about including git pull --rebase=true in a future command twgit feature pull