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

Re: Git commit amend empty emails

From
Jeff King <peff@peff.net>
Date
Dec 10, 2014, 19:45 UTC
Message-ID
<20141210194501.GA22969@peff.net>
In-Reply-To
<xmqqmw6vgx6v.fsf@gitster.dls.corp.google.com>
On Wed, Dec 10, 2014 at 10:46:16AM -0800, Junio C Hamano wrote:
Show 13 quoted lines
> > So we now notice the empty email in this code path, but the only thing
> > we do is avoid writing out the environment variables and continue. Which
> > means that the actual string generated by fmt_ident (complete with empty
> > email) is what goes into the commit. So why are we setting the
> > environment variables at all?
> 
> I think that part was more underthinking than oversight.
> 
> We didn't want to abort the commit but we didn't want to contaminate
> the environment variables with known-to-be-bad values to spread the
> problem further.  But there is no guarantee that not exporting the
> environment variables would give us more comformant name and e-mail
> address, so that thinking is flawed.

That sort of makes sense, but I agree it is flawed. The real spread is when the bogus data makes it into the commit objects themselves.

Show 6 quoted lines
> > The first one fixes the regression and can stand by itself. The second
> > fixes the GIT_AUTHOR problem, but AFAIK that has been there for years.
> > So it is not as urgent, but is still maint-worthy, in my opinion.
> >
> >   [1/2]: commit: loosen ident checks when generating template
> >   [2/2]: commit: always populate GIT_AUTHOR_* variables

By the way, as I said I built these on the original regression. They will have some minor textual conflicts if you merge them up to master, due to the jk/commit-author-parsing topic. Please me know if you run into any trouble merging.

-Peff
Previous: Junio C Hamano
Message 7 of 7 in “Git commit amend empty emails”
  1. SimonDec 10, 2014
  2. Jeff KingDec 10, 2014
  3. 1/2 commit: loosen ident checks when generating templateJeff King, Dec 10, 2014
  4. Eric SunshineDec 11, 2014
  5. 2/2 commit: always populate GIT_AUTHOR_* variablesJeff King, Dec 10, 2014
  6. Junio C HamanoDec 10, 2014
  7. Jeff KingDec 10, 2014

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.