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

Re: Refactoring hardcoded SHA-1 constants

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 19, 2014, 01:06 UTC
Message-ID
<xmqqy4z29lg0.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CACsJy8BMuj8jcsODGLPYxakh2pMV83AqsiMb7XFNkNwdGc7NLg@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 12 quoted lines
> On Sat, Apr 19, 2014 at 7:06 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
>> Let the brainstorming (and bikeshedding) begin!
>>
>> 1. GIT_OID_RAWSZ / GIT_OID_HEXSZ
>>
>> 2. OID_RAWSZ / OID_HEXSZ
>>
>> 3. OID_BINARY_LEN / OID_ASCII_LEN
>>
>> 4. BINARY_OID_LEN / ASCII_OID_LEN
>
> 5. sizeof(oid) / ASCII_OID_LEN

Can we safely assume sizeof(struct { uchar oid[20]; }) is 20, or on some 64-bit platforms do we have to worry about 8-byte alignment?

In any case, if the pair of names in 1. are what is already used, I do not see a need for us to waste time bikeshedding at all.

In an ideal world, an implementation of cmd_foo() that defines a variable to hold an object name and then calls into libgit.a services may link in the future with a different implementation of the services that are currently offered by libgit.a but are reimplemented on top of libgit2, right? Having the same name would help us, not hurt us, with that direction in some future, no?

Previous: Duy NguyenNext: Duy Nguyen
Message 5 of 6 in “Refactoring hardcoded SHA-1 constants”
  1. brian m. carlsonApr 18, 2014
  2. Jonathan NiederApr 18, 2014
  3. Michael HaggertyApr 19, 2014
  4. Duy NguyenApr 19, 2014
  5. Junio C HamanoApr 19, 2014
  6. Duy NguyenApr 19, 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.