Re: Typesafer git hash patch

2017-02-28 Thread Linus Torvalds
On Tue, Feb 28, 2017 at 12:19 PM, brian m. carlson wrote: > > The bigger issue is the assumptions in the code base that assume a given > hash size. Absolutely. And I think those are going to be the "real" patches. I actually saw your status report about "After

Re: Typesafer git hash patch

2017-02-28 Thread brian m. carlson
On Tue, Feb 28, 2017 at 11:53:28AM -0800, Junio C Hamano wrote: > Linus Torvalds writes: > > > That > > actually can clean up some code, because right now we have duplicate > > interfaces for some things that take an oid pointer and others take a > > "const

Re: Typesafer git hash patch

2017-02-28 Thread Jeff King
On Tue, Feb 28, 2017 at 08:33:13PM +, brian m. carlson wrote: > On Tue, Feb 28, 2017 at 03:26:34PM -0500, Jeff King wrote: > > Yeah, a lot of brian's patches have been focused around the fixing the > > related size assumptions. We've got GIT_SHA1_HEXSZ which doesn't solve > > the problem, but

Re: Typesafer git hash patch

2017-02-28 Thread brian m. carlson
On Tue, Feb 28, 2017 at 12:25:20PM -0800, Linus Torvalds wrote: > On Tue, Feb 28, 2017 at 11:53 AM, Junio C Hamano wrote: > > Sorry, but at this point in your description, you completely lost > > me. I thought "struct object_id" was what you call "hash_t" in the > > above. >

Re: Typesafer git hash patch

2017-02-28 Thread Linus Torvalds
On Tue, Feb 28, 2017 at 11:53 AM, Junio C Hamano wrote: > Linus Torvalds writes: >> >> Having the hashes be more encapsulated does seem to make things better >> in many ways. What I did was to also just unify the notion of "hash_t" >> and "struct

Re: Typesafer git hash patch

2017-02-28 Thread brian m. carlson
On Tue, Feb 28, 2017 at 03:26:34PM -0500, Jeff King wrote: > Yeah, a lot of brian's patches have been focused around the fixing the > related size assumptions. We've got GIT_SHA1_HEXSZ which doesn't solve > the problem, but at least makes it easy to find. And a big improvement > in the most recent

Re: Typesafer git hash patch

2017-02-28 Thread Jeff King
On Mon, Feb 27, 2017 at 10:59:15PM -0800, Linus Torvalds wrote: > I saw that somebody is actually looking at doing this "well" - by > doing it in many smaller steps. I tried. I gave up. The "unsigned char > *sha1" model is so ingrained that doing it incrementally just seemed > like a lot of pain.

Typesafer git hash patch

2017-02-27 Thread Linus Torvalds
So because of the whole SHA1 discussion, I started looking at what it would involve to turn unsigned char *sha1 style arguments (and various structure members) in the git source into typedef struct { ... } hash_t; hash_t *hash; The answer is that it's pretty painful - more so than I