I am using a successful git branching model, where you have master branch only consisting from merge commits with version tags, and all the development goes on develop branch.
The develop branch also consists of merge commits (feature branches) and ordinary commits (small individual changes).
When I perform a new version release, I want git to make me a chengelog. git merge develop --log does this, but this "unrolls" merge commits on develop, resulting in a flat history.
I want to make 'git merge --log' use only commits on develop, is this possible?
Examples:
What I atually get now when merging:
Merge branch 'develop' into master
* develop:
fix 1 on branch develop
fix 2 on branch develop
fix 1 on branch b1
fix 2 on branch b1
fix 3 on branch b1
fix 1 on branch b2
fix 2 on branch b2
fix 1 on branch b3
What I want it to be:
Merge branch 'develop' into master
* develop:
fix 1 on branch develop
fix 2 on branch develop
Merge branch 'b1' into develop
Merge branch 'b2' into develop
Merge branch 'b3' into develop
To get the log you want for an inflight merge, use
or to see what that'd get from an existing merge use
merge^1..merge^2as your range.The quickest way to get to a smoketest is probably
git merge --log=1to generate the right boilerplate, then in vim it'd beto fill in the log the way you want. To automate it you'll need to use the
prepare-commit-msghook, something along the lines ofedit: on GNU/anything, the hook gets simpler because the sed's buffier: