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

Re: [PATCH 0/1] builtin/blame.c: bit field constants into bit shift format

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 17, 2019, 07:33 UTC
Message-ID
<xmqqv9sn7rn0.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<pull.382.git.1571250635.gitgitgadget@gmail.com>
"Hariom Verma via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> we are looking at bitfield constants, and elsewhere in the Git source code,
> such cases are handled via bit shift operators rather than octal numbers,
> which also makes it easier to spot holes in the range (if, say, 1<<5 was
> missing, it is easier to spot it between 1<<4 and 1<<6 than it is to spot a
> missing 040 between a 020 and a 0100). Also, bit shifts lead to low-level
> optimizations because they require fewer calculations for the CPU. 

I think the last sentence is a nonsense for any decent compiler that turns "1<<5" into 040 at compile time and treats it as literal integer. Luckily, it only appears here in the cover letter and does not appear in the patch proper, so no need to resend the patch to correct this ;-)

Previous: Junio C HamanoNext: Hariom Verma via GitGitGadget
Message 7 of 9 in “builtin/blame.c: bit field constants into bit shift format”
  1. 0/1 builtin/blame.c: bit field constants into bit shift formatHariom Verma via GitGitGadget, Oct 16, 2019
  2. 1/1 builtin/blame.c: constants into bit shift formatHariom Verma via GitGitGadget, Oct 16, 2019
  3. Pratyush YadavOct 16, 2019
  4. Jonathan TanOct 16, 2019
  5. Pratyush YadavOct 16, 2019
  6. Junio C HamanoOct 17, 2019
  7. Junio C HamanoOct 17, 2019
  8. 0/1 builtin/blame.c: bit field constants into bit shift formatHariom Verma via GitGitGadget, Oct 17, 2019
  9. 1/1 builtin/blame.c: constants into bit shift formatHariom Verma via GitGitGadget, Oct 17, 2019

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.