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

Re: [PATCH] Define constants for lengths of object names

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
May 2, 2014, 22:09 UTC
Message-ID
<20140502220908.GI75770@vauxhall.crustytoothpaste.net>
In-Reply-To
<CACsJy8AhxJDcBHNWbssWs2F1oQB4xGG7rpBePX60m4=_+MVEZw@mail.gmail.com>
On Fri, May 02, 2014 at 07:15:44AM +0700, Duy Nguyen wrote:
Show 7 quoted lines
> On Fri, May 2, 2014 at 6:05 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> >
> > I can make up for it in enthuasiasm.  Please?  It's something I've
> > wanted for a long time but never found the time to do.
> 
> It's definitely better in the sense that the compiler will catch new
> "char[20]" declarations for us. It's also a lot more work.

It is. I'm going to start with a patch that introduces struct object_id and the fixed constants. Then I'm going to get a patch that compiles with lots of warnings, and then I'm going to fix all those warnings. Otherwise, the patch will simply be too enormous to review.

I'm willing to hear other suggestions for going about this, though.
> No architecture was named last time if I remember correctly. But we
> could check "sizeof(struct object_id) == 20" in a test or something.
> When people scream, we can pack the struct on that particular
> platform?

Sounds like a plan. I am not aware of any architecture that has this limitation; I've worked with x86(-64)?, 32-bit PowerPC, UltraSPARC, and ARM.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Previous: Duy Nguyen
Message 7 of 7 in “Define constants for lengths of object names”
  1. Define constants for lengths of object namesbrian m. carlson, May 1, 2014
  2. Jonathan NiederMay 1, 2014
  3. Jonathan NiederMay 1, 2014
  4. brian m. carlsonMay 1, 2014
  5. Jonathan NiederMay 1, 2014
  6. Duy NguyenMay 2, 2014
  7. brian m. carlsonMay 2, 2014

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.