Search code examples
gitmercurialbazaar

Is it possible and how "Giving credit for a change" for Mercurial/Git as in Bazaar?


Bazaar support adding meta data to commit to record who the actual author of a change is vs. the person who commits the change:

  $ bzr commit --author "Jane Rey <jrey@example.com>" \
               --author "John Doe <jdoe@example.com>"

After adding this meta data it accessible via bzr log, like:

------------------------------------------------------------
revno: 105661
fixes bug(s): http://debbugs.gnu.org/9414
author: Oleksandr Gavenko 
committer: Juri Linkov 
branch nick: trunk
timestamp: Mon 2011-09-05 12:55:11 +0300
message:
  * lisp/progmodes/grep.el (rgrep): Add "-type d".

It is possible embed such metadata in commit for Mercurial/Git?


Solution

  • In git you have the similar command:

    git commit --author="Name <name@example.com>"
    

    But it usually comes from pre-set config values.

    Hg has a similar flag for setting the user, but does not make a distinction between author and committer. But there is an extension to do that.

    Both git and hg do not have the concept of setting multiple authors for a commit. Though that is usually done in the commit message in some pre-determined way / convention in the team