Git log excluding branch

Consider the following commit history:

1---R---3---5---P-> # patch-v1.1 \ \ 2---4---+---8---+---10---R-> # release-v2.0 \ / 6---7---9 # feature-foo --> time # 1 - 10 are commits # P is a patch release commit # R are major release commits # + marks a merge commit 

I want to generate a change log for release-v2.0 , but since P (patch-v1.1) has already been released, it should not be part of the change log v2.0 . Can I configure the git log command only on the list of commits 2, 4, 6 .. 11 (i.e. it commits from release-v2.0 and feature-foo )?

+5
source share
1 answer

Use git log R --not P Same as git log P..R from @ micha-wiedenmann comment, but I find that the previous syntax says more. And yes, it will include 2, 4, 6, 7, 9 , since it does not matter when they were chronologically (in terms of time), but where they are in the DAG. With R --not P you basically create a complement P in R in terms of set theory.

+5
source

Source: https://habr.com/ru/post/1244137/


All Articles