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

Re: [PATCHv3] refs.c: enable large transactions

From
Stefan Beller <sbeller@google.com>
Date
Apr 24, 2015, 16:16 UTC
Message-ID
<CAGZ79kYGDOUgzKmQOLAXkYYb-HZJCw3Y=iSLXWHVXcQ0pAiDBw@mail.gmail.com>
In-Reply-To
<xmqq8udi2tn8.fsf@gitster.dls.corp.google.com>
On Thu, Apr 23, 2015 at 6:37 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> On Thu, Apr 23, 2015 at 10:56 AM, Junio C Hamano <gitster@pobox.com> wrote:
>>
>>>> +             int save_errno = errno;
>>>> +             error("Couldn't reopen %s", lock->lk->filename.buf);
>>>
>>> No need to change this line, but I noticed that we might want to do
>>> something about the first one of the following two:
>>
>> I personally like to have each error(...) to have a unique string, such
>> that when you run into trouble (most likely reported by a user),
>> you can easily pinpoint where the exact error is.
>
> I was hoping that the "grep" patterns were strong enough hint, but
> let me be explicit.  I was commenting on "Could" not being spelled
> as "could".
>
>>>     $ git grep -e '[    ]error(_*"[A-Z]' | wc -l
>>>     146
>>>     $ git grep -e '[    ]error(_*"[a-z]' | wc -l
>>>     390

I understood that you were talking about Could being capitalized. Though it's distributed 30/70 which hints to me we do not care in enough to explain the capitalized letters as slip-throughs on review or such, but it looks like the authors choice to me.

I think it's a mistake to s/Could/could/g for all errors in the code base as it reduces the information provided in the error messages. Just 3 days ago ("Regular Rebase Failure"). I used different capitalization to get a better understanding where the error may be.

So if we throw away that information, we should add new information to make the spot of the error easily findable in the source. That's why I proposed the idea of the version,filename,linenumber as that is one of the strongest signals (most information in a short amount of text) I can imagine.

Previous: Junio C HamanoNext: Jeff King
Message 5 of 12 in “[PATCHv3] refs.c: enable large transactions”
  1. Stefan BellerApr 22, 2015
  2. Junio C HamanoApr 23, 2015
  3. Stefan BellerApr 24, 2015
  4. Junio C HamanoApr 24, 2015
  5. Stefan BellerApr 24, 2015
  6. Jeff KingApr 24, 2015
  7. Jonathan NiederApr 24, 2015
  8. Stefan BellerApr 24, 2015
  9. Jeff KingApr 24, 2015
  10. Junio C HamanoApr 25, 2015
  11. Jeff KingApr 25, 2015
  12. Jeff KingApr 25, 2015

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.