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

Re: [PATCH v7 2/5] setup: sanity check file size in read_gitfile_gently

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 15, 2015, 03:08 UTC
Message-ID
<CAPig+cRouQOgd29qQZSUo0t+NBPfeKWD+4j42pArLW3TpND=bQ@mail.gmail.com>
In-Reply-To
<CAMpP7NZ2tqZ5cv=9=gJqDZ5m0LOZtsHGvt-ntZcp6cBA6X5tqg@mail.gmail.com>
On Sun, Jun 14, 2015 at 1:21 PM, erik elfström <erik.elfstrom@gmail.com> wrote:
Show 11 quoted lines
> On Sun, Jun 14, 2015 at 5:42 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>>
>> This variable name doesn't convey much about its purpose, and
>> introduces a bit of maintenance burden if the limit is some day
>> changed. Perhaps "sane_size_limit" or something even more descriptive
>> (and/or terse) would be better.
>
> Would you be happy with this change?
>
> -       static const int one_MB = 1 << 20;
> +       static const int max_file_size = 1 << 20;  /* 1MB */
Yep, that's a much nicer variable name. Thanks.

I also note that 'const int' shows up pretty frequently in the git source code, but 'static const int' is used only very rarely.

Previous: erik elfströmNext: Erik Elfström
Message 6 of 9 in “Improving performance of git clean”
  1. 0/5 Improving performance of git cleanErik Elfström, Jun 9, 2015
  2. 1/5 setup: add gentle version of read_gitfileErik Elfström, Jun 9, 2015
  3. 2/5 setup: sanity check file size in read_gitfile_gentlyErik Elfström, Jun 9, 2015
  4. Eric SunshineJun 14, 2015
  5. erik elfströmJun 14, 2015
  6. Eric SunshineJun 15, 2015
  7. 3/5 t7300: add tests to document behavior of clean and nested gitErik Elfström, Jun 9, 2015
  8. 4/5 p7300: add performance tests for cleanErik Elfström, Jun 9, 2015
  9. 5/5 clean: improve performance when removing lots of directoriesErik Elfström, Jun 9, 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.