git/list[1] front-page[2] threads[3] people[4] search[5] about
 

feature request: allow commit.email config setting

From
Rasmus Villemoes <rv@rasmusvillemoes.dk>
Date
Aug 30, 2018, 11:26 UTC
Message-ID
<0f66ad7a-2289-2cce-6533-a27e19945187@rasmusvillemoes.dk>

As part of my dayjob, I did and still do some work on an upstream project. A while ago, I was granted commit access to that project. However, upstream asked that I would register with their system using a private email, or at least one that wouldn't change if I changed jobs, rather than my work email.

Now, I (and my employer) would like that the work I do as part of my current job on that project has my work email in the Author field, but since the commit access was granted to me privately/personally, it would be nice if the Committer email was the one I used to register with their system. I can set GIT_COMMITTER_EMAIL in the environment, but that is rather inconvenient, since that means I have to remember to do that in the shell I'm using for that particular project, and I can't use that shell for other projects. So it would be really nice if I could set commit.email = $private-email in the local .git/config for that particular project. I don't personally have a use for commit.name (when missing, that should just use user.name as usual), but it would probably be most consistent to allow that too.

I tried looking into ident.c, but it doesn't seem like it is straight-forward to implement. Probably fmt_ident, ident_default_email etc. would need to be passed information about what purpose the ident is to be used for. So before trying to implement this, I want to hear if this is a reasonable thing to support. Also, I'm sure there are some subtle semantics that would need to be decided and gotchas to watch out for.

Rasmus
Next: Junio C Hamano
Message 1 of 4 in “feature request: allow commit.email config setting”
  1. Rasmus VillemoesAug 30, 2018
  2. Junio C HamanoAug 30, 2018
  3. Eric SunshineAug 30, 2018
  4. Rasmus VillemoesAug 30, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.