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

Re: git-send-email creates duplicate Message-Id's

From
MAMatti Aarnio <matti.aarnio@zmailer.org>
Date
Sep 17, 2007, 20:47 UTC
Message-ID
<20070917204701.GU6372@mea-ext.zmailer.org>
In-Reply-To
<7vejgxyrde.fsf@gitster.siamese.dyndns.org>
On Mon, Sep 17, 2007 at 01:22:05PM -0700, Junio C Hamano wrote:
Show 22 quoted lines
> Adrian Bunk <bunk@kernel.org> writes:
> 
> > The following might be a bug in git-send-email (git maintainers Cc'ed
> > and KVM list removed from Cc): 
> >
> > Patch 54 got the same Message-Id as patch 61 and patch 89 got the same 
> > Message-Id as patch 104.
> > ...
> > The emails are:
> > http://marc.info/?l=linux-kernel&m=119002061330270&w=2
> > http://marc.info/?l=linux-kernel&m=119002059626434&w=2
> > http://marc.info/?l=linux-kernel&m=119002060011801&w=2
> > http://marc.info/?l=linux-kernel&m=119002060318915&w=2
> 
> The old code generated rand(4200) for each message and appended
> it to the timestamp.  I do not know where the original author
> got 4200 from, but I think if you send many messages within a
> single second it is possible to get collisions.
> 
> I guess something like this patch is an improvement?  It
> generates a single prefix from timestamp and random, and appends
> a number that is incremented for each message.

Much better. You may also consider a possibility of letting your local MTA do the Message-ID generation, unless you are tracking something with it and thus need to know the generated values. .. but apparently git much prefers sending email by SMTP, where the message-id must be present, or one really should block any such emails.. (except that systems like qmail send error messages without message-id ...)

My own recipe is:
       sprintf("%d-%d-%d", time , getpid, ++localsequence)
catenate on that your favourite domain name where that recipe
is likely to be valid, and you are all set.
  /Matti Aarnio  --  one of  <postmaster@vger.kernel.org>
Previous: Junio C Hamano
Message 3 of 3 in “git-send-email creates duplicate Message-Id's”
  1. Adrian BunkSep 17, 2007
  2. Junio C HamanoSep 17, 2007
  3. Matti AarnioSep 17, 2007

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.