Re: [PATCH v2 6/8] git-remote-testpy: hash bytes explicitly
- From
John Keeping <john@keeping.me.uk>
- Date
- Jan 17, 2013, 21:05 UTC
- Message-ID
- <20130117210506.GJ4574@serenity.lan>
- In-Reply-To
- <20130117210048.GI4574@serenity.lan>
On Thu, Jan 17, 2013 at 09:00:48PM +0000, John Keeping wrote:
Show 16 quoted lines
> On Thu, Jan 17, 2013 at 12:36:33PM -0800, Junio C Hamano wrote: >> John Keeping <john@keeping.me.uk> writes: >> >>> Under Python 3 'hasher.update(...)' must take a byte string and not a >>> unicode string. Explicitly encode the argument to this method as UTF-8 >>> so that this code works under Python 3. >>> >>> This moves the required Python version forward to 2.0. >>> >>> Signed-off-by: John Keeping <john@keeping.me.uk> >>> --- >> >> Hmph. So what happens when the path is _not_ encoded in UTF-8? > > Do you mean encodable? As you say below it will currently throw an > exception.
Now my brain's not working - we shouldn't get an error converting from a Unicode string to UTF-8, so I think this patch is OK as it is.
Show 9 quoted lines
> > Is the repo.hash (and local.hash that gets a copy of it) something > > that needs to stay the same across multiple invocations of this > > remote helper, and between the currently shipped Git and the version > > of Git after applying this patch? > > It's used to specify the path of the repository for importing or > exporting, so it should stay consistent across invocations. However, > this is only an example remote helper so I don't think we should worry > if it changes from one Git release to the next.