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

Use of field flags in struct object

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Aug 16, 2010, 08:21 UTC
Message-ID
<AANLkTikvP1oKAiFNVwZ+kqy=jLhUKP1RRET8cq=XeyzT@mail.gmail.com>
Hi,

The "flags" field in struct object (object.h) is used in a lot of places. The thing is, the bit definition of this field is distributed across files (16 according to my "object.flags |=" grep). This makes it quite easy for one function to misunderstand a bit set by another function, for a different purpose. For instance, in upload-pack.c, there is a comment:

/* bits #0..7 in revision.h, #8..10 in commit.c */

which is no longer true as commit.c has moved on and used another set of bits (16..19). Luckily, commit.c seems to clean its flags. But there's a chance we will get bit definition overlap again.

Should all of those bit definitions be gathered in one place instead?
-- 
Duy
Next: Junio C Hamano
Message 1 of 2 in “Use of field flags in struct object”
  1. Nguyen Thai Ngoc DuyAug 16, 2010
  2. Junio C HamanoAug 25, 2010

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.