For example, in this commit tree:

* ccfd449 Require to return undef if no digits found * 93dd5ff Merge pull request #4 from KES777/clean_api |\ | * 39d82d1 Fix tests for debugging debugger internals | * ed67179 Move &push_frame out of core | * 2fd84b5 Do not lose info about call point | * 3ab09a2 Improve debugger output: Show info about emitted events | * a435005 Merge branch 'redesign_interactions' into clean_api | |\ | | * a06cc29 Code comments | | * d5d6266 Remove copy/paste code | | * c0118fa Allow command to choose how continue interaction | | * 19cb534 Emit &interact event 

I want to find that the c0118fa commit was made to the redesign_interactions branch.

What command can this be done?

  • What does not suit to skip the output through grep c0118fa (or through find c0118fa for Windows)? - PinkTux
  • 3
    in general, no way. A branch (branch) in git is a pointer to a commit, not a chain of commits (as, for example, in svn or mercurial). - aleksandr barakin
  • @PinkTux And what will it do? to see info about commit I can git show c0118fa - Eugen Konkov
  • In which thread was the commit a06cc29 Code comments - in redesign_interactions or KES777/clean_api ? - Nick Volynkin
  • @NickVolynkin: a06cc29 was made in redesign_interactions - Eugen Konkov

1 answer 1

In, I think I found what I need:

 git log <SHA1>..HEAD --ancestry-path --merges 

For example:

  c---e---g--- feature (уже удалена) / \ -a---b---d---f---h---j--- master git log e..master --ancestry-path --merges commit h Merge: gf Author: Eugen Konkov <> Date: Sat Oct 1 00:54:18 2016 +0300 Merge branch 'feature' into master 

From the merge commit h comment, you can see that the required commit e was made in the feature branch that was merged into master

  • It will work only if it was a merge commit. And this is one of the weighty arguments for doing a merge --no-ff , not a rebase . - Nick Volynkin
  • @NickVolynkin: I always do merge --no-ff even if there was one commit in a branch, since I do not want to lose this information. And in general the opponent of the direct story: exactly zero is gained from it. rebase I only do in two cases: 1. pull -v --rebase to get new changes in the branch and get rid of the "fake" слияний ; 2. When I discover that some changes needed to be added to the n-commit'e ( git rebase <SHA1>^ ). Naturally, all these actions are done before the local changes are published on the remote server. - Eugen Konkov
  • one
    I agree with everything. Plus put a long time ago) - Nick Volynkin
  • @NickVolynkin: :-D - Eugen Konkov