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

Re: feature request: allow commit.email config setting

From
Rasmus Villemoes <rv@rasmusvillemoes.dk>
Date
Aug 30, 2018, 19:29 UTC
Message-ID
<cba5b445-2208-7a01-5ea6-7a3590cef50e@rasmusvillemoes.dk>
In-Reply-To
<CAPig+cTnvDfYaDh7JSXXGGA=+DE4WAiuTZEKpxv67u1_OyT-qA@mail.gmail.com>
On 2018-08-30 20:13, Eric Sunshine wrote:
Show 13 quoted lines
> On Thu, Aug 30, 2018 at 7:26 AM Rasmus Villemoes <rv@rasmusvillemoes.dk> wrote:
>> 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.
> 
> Aside from modifying Git itself to support such a use-case, another
> (perhaps more pragmatic) approach would be to use a tool, such as
> direnv[1], which automatically sets environment variables for you
> depending upon your current working directory, or just use some ad-hoc
> shell programming to achieve the same (for instance, [2]).

Thanks for the hint! I've actually had "git" as a function in my .bashrc for a long time, for implementing a ~/.githistory to help remember the sometimes rather complex git invocations, and keeping track of the context ($cwd, current branch, etc.) they were used in. It should be trivial to hook the environment settings based on $cwd into that. The only problem is that that gives me much less incentive to work on implementing the config support in git, but if I'm the only one with a use case, that's probably just as well.

Rasmus
Previous: Eric Sunshine
Message 4 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.