petervanderdoes / gitflow-avh

AVH Edition of the git extensions to provide high-level repository operations for Vincent Driessen's branching model
http://nvie.com/posts/a-successful-git-branching-model/
Other
5.42k stars 527 forks source link

Display git flow feature as a tree #260

Open ivan-pomortsev opened 8 years ago

ivan-pomortsev commented 8 years ago

Let's imagine that we need a lot of sub-sub-features and we do something like:

git flow feature start test-first
git flow feature start test-second feature/test-first
git flow feature start test-third feature/test-second

Then we execute "git flow feature list":

git flow feature list

And got that:

  test-first
  test-second
* test-third

Hope it could be very nice to get a tree as output of this command. Something like:

   test-first
      |- test-second
         |- * test-third
istrasci commented 6 years ago

+1 !! Just came to request this. Could also work for other branches besides features.

master
  |- hotfix/hotfix-1.1
  |- support/support-1.0
develop
  |- release/release-2.0
  |- feature/feature-1
  |- feature/feature-2
       |- * feature/feature-2-subfeature-1

...etc
Wirone commented 5 years ago

From Git's point of view feature based on other feature is just another branch with the same base (e.g. develop) where one branch is fully contained in second one. If you're nesting features, probably you're doing it wrong. I know sometimes it's required to start work on feature that depends on other feature which is not merged yet, but it should be edge case. If you're building some bigger feature and want to work on it step by step, you can create integration branch based on develop and then create all feature branches from this integration branch, merging them rapidly (even if some king of WIP status) so work on other sub-features is not blocked and then, when whole feature is ready, merge integration branch to develop. GitFlow is not closed box, it's a model/tool for automation - you can do anything you want to support your flow to achieve what you need. You don't have to stick only to built-in commands and conventions.

I'm :+1: for displaying base branch for each feature branch (because not every feature must fork from develop), but :-1: for displaying as tree.