Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you tag someone in a git commit message?

Tags:

git

Occasionally I would like to call people out in my git commit messages. And also it would let people know they should look at the commit.

Example: "Fix issues caused by +JoeSchmoe"

like image 440
penner Avatar asked Jan 26 '15 18:01

penner


2 Answers

I've tried github for this, yes, it works. when you type @mention in commit message, then you can click the name to navigate to the guy's profile

like image 127
hongfengzhou Avatar answered Nov 15 '22 06:11

hongfengzhou


How you do this depends on how you use Git. There is no built in way to do this within Git, since Git doesn't do any kind of notification.

One option would be to simply set up your own convention, and use your own scripts to extract such commits or send the appropriate notifications in something like a post-receive hook.

However, there are existing conventions for how this works in two common Git based workflows: patches sent via email, and GitHub.

In the patches sent via email workflow, used by the Linux kernel and Git project itself, what you do is add lines at the end of the message of the form:

Cc: Joe Schmoe <[email protected]>

Then when you use git format-patch and git send-email to format and send your patches via email, Joe Schmoe will be CC'd on the email that is sent out, so should be notified via email about this patch.

The other convention, if you use something like GitHub, is to use an @JoeSchmoe mention of their GitHub username. I do not know off the top of my head, and their help does not specify, whether this works from the commit message itself; but at the very least, in any comment or pull request you make, you can write @JoeSchmoe and he will be notified of the fact that you mentioned him.

like image 32
Brian Campbell Avatar answered Nov 15 '22 05:11

Brian Campbell