13

Actually am try to get a report on merge conflicts. I used 'git blame' to see who has changed what line, but i couldn't find the branch and repository name information.

Is there a way to find the repository name, branch name and author name of a file from 'git blame' or from commit ids' so that whenever a merge conflict occurs i can send an email to the authors who have touched that file/lines to resolve it.

oezi
  • 51,017
  • 10
  • 98
  • 115
Senthil A Kumar
  • 10,306
  • 15
  • 44
  • 55
  • Possible duplicate of [Finding what branch a git commit came from](http://stackoverflow.com/questions/2706797/finding-what-branch-a-git-commit-came-from) – Alex Kulinkovich Nov 26 '15 at 13:20

1 Answers1

10

git blame should only give you the revision and author, but:

  • as mentioned in "Git: Finding what branch a commit came from", you cannot easily pinpoint the branch where that commit has been made (branches can be renamed, moved, deleted...), even though git branch --contains <commit> is a start.
  • I doubt you can find the repository it came from (unless maybe by looking hard in the git log results, trying to find the parent of that commit comming from a ref/remotes namespace).

Now if you have a proper .mailmap at the toplevel of the repository, you will have the right email addresses as well.

In the simple form, each line in the file consists of a canonical real name of an author, a whitespace, and an email address used in the commit (enclosed by < and >) to map to the name. For example:

Proper Name <commit@email.xx>
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks a lot. So there is no direct way :( Can you educate me n how to backtrack a code/file. Git blame will tell the commit and author. Is there a way to backtrack from the commit id? – Senthil A Kumar May 17 '10 at 12:49
  • @Senthil: I answered the question VonC links to with a few ways you may be able to backtrack. – Cascabel May 17 '10 at 17:36
  • Thanks Jefromi got your link too :) (http://stackoverflow.com/questions/2706797/git-finding-what-branch-a-commit-came-from/2707110#2707110) @VonC thanks a lot, am settling with author name alone for merge conflicts – Senthil A Kumar May 18 '10 at 10:56