Send an example! (Re: [PATCH] util: Changed shortuser()...)

David Frey dpfrey at shaw.ca
Wed Aug 4 13:44:08 CDT 2010


On August 4, 2010 10:04:45 am Matt Mackall wrote:
> On Tue, 2010-08-03 at 21:58 -0700, David Frey wrote:
> > # HG changeset patch
> > # User David Frey <dpfrey at shaw.ca>
> > # Date 1280897356 25200
> > # Node ID 5abdad9cb3a4ea47c2d2dd57c03959f392289ffb
> > # Parent  b6f72d8d77ae5df0dd80b3236169159d020bf269
> > util: Changed shortuser() to provide slightly more verbose names
> > (Issue2276)
> 
> Please don't send patches where one has to decipher your code and/or
> test and/or lookup a BTS entry to figure out the intent. This goes
> double for things that change output. Include an example!


Sorry about that.  I intended to send a description, but I issued the wrong hg 
email command.

The issue relates to the ambiguity of the names produced by the shortuser 
function from mercurial/util.py when dealing with commits specifying users 
like this:

Steve Smith <steve.smith at domain.com>
Steve Jones <steve.jones at domain.com>

Prior to the patch, "steve" would be returned by shortuser for both users.

I attempted to classify the name provided into 3 categories:
  - name <e-mail>
  - e-mail
  - name

I chose what I believed to be a suitable default in each case.  I realize that 
this isn't an area where there is a right or wrong thing to do, so feel free 
to offer ideas for improvements.

Dave


More information about the Mercurial-devel mailing list