How to see the commit path through git history or "how did it get to the current branch"?

I look at the commit history using gitkand git log, and I'm trying to figure out how a particular commit arrived on a particular branch. I can see the fixations in the story, so I know that they are there.

I want to understand how they merged (they had to stay on their branch). This is a very large project and there are hundreds of commits between the message in question and the current state of the branch, so I can not clearly decrypt through a limited DAG in gitk, and the commit will be masked in other branches and merges and commit messages.

To do this, I tried:

gitk {sha1hashIDstring}..branch_name
gitk {sha1hashIDstring}..branch_name --ancestry-path
git log {sha1hashIDstring}..branch_name --reverse
git log {sha1hashIDstring}..branch_name --merges --reverse
git log {sha1hashIDstring}..branch_name --ancestry-path --reverse
git log {sha1hashIDstring}..branch_name --ancestry-path --merges --reverse

And I do not understand the results. I ONLY want to see elements that include the specific commit in question, so I clearly see how it got into the industry in question. How to do it?

Example

What I'm looking for is gitkpreferable, but it git logwill be enough:

Message       Author         Date         #commit that merged branch z into current branch
Message       Author         Date         #commit that merged branch y into branch z
Message       Author         Date         #commit that merged branch x into branch y
Message       Author         Date         #commit that merged {sha1hashIDstring} commit/branch a into branch x
Message       Orig_Author    Date         #{sha1hashIDstring} original commit, on branch a

Additional Information

I still do not see the answers, so I will start generosity if no one comes, but maybe I will not explain the question correctly (I am open to suggestions for improvement and clarification).

The driver for this is that I can see the fix itself, and they tell me that it should not be on a particular branch. Here is what I see:

Message       Orig_Author    Date         #{sha1hashIDstring} commit
Message       Orig_Author    Date         #Merged into branch test_dec14 (includes original commit)
...
Message       Author         Date         # unrelated commits
Message       Author         Date         # more unrelated commits
# Stuff happened here ??? everything I do gives me hundreds of things here 
# Not all of them related to the {sha1hashIDstring} commit
# No idea how to see only the ones that are
...
Message       Author         Date         # final commit on test_jan15 branch

, test_dec14 test_jan15, , {sha1hashIDstring} commit test_jan15, . , , , .

+4
5

, " ?", git-when-merged.

Python script, readme:

, . commit, COMMIT . , , COMMIT .

, , , {sha1hashIDstring} test_jan15.

+2

"--decorate" git ?

.gitconfig:

[alias]

        k = log --graph --oneline --abbrev-commit  --decorate

, gitk, , "", .


-

tig. , gitk ( ;)). http://gitready.com/advanced/2009/07/31/tig-the-ncurses-front-end-to-git.html . , .

+1

- - . #vonC

git [] COMMIT [BRANCH...]

, . , COMMIT ().

, , COMMIT .

git-what-branch

, , Perl script , :

SYNOPSIS

git-what-branch [--allref] [--all] [--topo-order | --date-order ]
[--quiet] [--reference-branch=branchname] [--reference=reference]
<commit-hash/tag>...
OVERVIEW

( ) , . , , , .

, , ( - -).

(, ) , ( linux 8 , , 200 ) . -reference-branch -reference ( ).

**EXAMPLES**
 # git-what-branch --all 1f9c381fa3e0b9b9042e310c69df87eaf9b46ea4
 1f9c381fa3e0b9b9042e310c69df87eaf9b46ea4 first merged onto master using the following minimal temporal path:
   v2.6.12-rc3-450-g1f9c381 merged up at v2.6.12-rc3-590-gbfd4bda (Thu May  5 08:59:37 2005)
   v2.6.12-rc3-590-gbfd4bda merged up at v2.6.12-rc3-461-g84e48b6 (Tue May  3 18:27:24 2005)
   v2.6.12-rc3-461-g84e48b6 is on master
   v2.6.12-rc3-461-g84e48b6 is on v2.6.12-n
   [...]
+1

, "github", , "" "" ( ) .

, () , ...

0
source

All Articles