How do you calculate feature branch changes in Git?

Viewed 68

I would like to identify all the sum of all code changes made on a git feature branch.

Take the example below, how would you determine the real changes written for feature XYZ? D and G represent the only real changes. I thought I might be able to do this by measuring the difference between A and G but merge F inflates G with code that has nothing to do with feature XYZ.

I'm thinking I'll have to traverse this myself (I'd use GithPython) and sum the changes from A->D and F->G. Are there flaws to this strategy? Are there better ways?

                 D --- F -- G           featureXYZ_branch
                /     /      \
    HISTORY--- A -- B -- C -- D ----    master
1 Answers

You can see your changes between those two branches by following way:

git diff featureXYZ_branch master
  OR
git diff remotes/origin/featureXYZ_branch remotes/origin/master
Related