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

Re: [PATCH 2/3] commit: check committer identity more strictly

From
Jeff King <peff@peff.net>
Date
Jul 23, 2012, 20:53 UTC
Message-ID
<20120723205321.GB6745@sigill.intra.peff.net>
In-Reply-To
<7vvchejj5e.fsf@alter.siamese.dyndns.org>
On Mon, Jul 23, 2012 at 01:51:25PM -0700, Junio C Hamano wrote:
Show 16 quoted lines
> > diff --git a/builtin/commit.c b/builtin/commit.c
> > index 95eeab1..20cef95 100644
> > --- a/builtin/commit.c
> > +++ b/builtin/commit.c
> > @@ -725,7 +725,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
> >  	strbuf_release(&sb);
> >  
> >  	/* This checks if committer ident is explicitly given */
> > -	strbuf_addstr(&committer_ident, git_committer_info(0));
> > +	strbuf_addstr(&committer_ident, git_committer_info(IDENT_STRICT));
> >  	if (use_editor && include_status) {
> >  		char *ai_tmp, *ci_tmp;
> >  		if (whence != FROM_COMMIT)
> 
> Looks sensible.  Is this something we can detect in automated tests,
> or is it too cumbersome to set up?

Sorry, I meant to mention that in the cover letter. No, we can't test this easily, because the code path in question is triggered by finding a blank name in /etc/passwd. We'd have to override our getpwent lookup.

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 8 of 16 in “Re: empty ident name trashes commit message”
  1. Ramana KumarJul 21, 2012
  2. Jeff KingJul 23, 2012
  3. Ramana KumarJul 23, 2012
  4. Jeff KingJul 23, 2012
  5. 1/3 advice: pass varargs to strbuf_vaddf, not strbuf_addfJeff King, Jul 23, 2012
  6. 2/3 commit: check committer identity more strictlyJeff King, Jul 23, 2012
  7. Junio C HamanoJul 23, 2012
  8. Jeff KingJul 23, 2012
  9. 3/3 commit: give a hint when a commit message has been abandonedJeff King, Jul 23, 2012
  10. Junio C HamanoJul 23, 2012
  11. Jeff KingJul 23, 2012
  12. Junio C HamanoJul 23, 2012
  13. Jeff KingJul 23, 2012
  14. Junio C HamanoJul 23, 2012
  15. Jeff KingJul 23, 2012
  16. Junio C HamanoJul 23, 2012

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.