I often use git log <options> BASE..TARGET
to show a range of commits.
What this does, based on my previous experience and understanding:
- Include TARGET and all its ancestors.
- Exclude BASE and all its ancestors, even if they are ancestors of TARGET.
Sometimes I would like to achieve the following instead:
- Include TARGET and all its ancestors.
- Exclude BASE_0 and all its ancestors, even if they are ancestors of TARGET.
- Exclude BASE_1 and all its ancestors, even if they are ancestors of TARGET.
- Exclude BASE_2 and all its ancestors, even if they are ancestors of TARGET.
- ...
A typical use case would be to find commits that are in (= ancestors of) a given feature branch, but are neither in (= ancestors of) master nor a specific other feature branch.
Obviously, the range A..B syntax won't cut it here. Instead, there would need to be a parameter like --exclude-ancestors-of=A_0,A_1,A_2
, with a syntax that allows multiple refs.
Is this possible somehow?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…