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

Re: [PATCH JGIT 2/5] FileMode: Store bit masks in int constants

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 12, 2009, 15:22 UTC
Message-ID
<20090812152252.GE1033@spearce.org>
In-Reply-To
<1250089776-22895-1-git-send-email-fonseca@diku.dk>
Jonas Fonseca <fonseca@diku.dk> wrote:
Show 6 quoted lines
> +	public static final int TYPE_MASK = 0170000;
> +	public static final int TREE_MASK = 0040000;
> +	public static final int SYMLINK_MASK = 0120000;
> +	public static final int FILE_MASK = 0100000;
> +	public static final int GITLINK_MASK = 0160000;
> +	public static final int MISSING_MASK = 0000000;

These last 5 entries aren't masks, they are type codes. I'd rather they be called FOO_TYPE than FOO_MASK. In particular what is really troubling is MISSING_MASK, being all 0 it always destroys the input and then matches everything. :-)

I'm going to amend this name change in here, s/_MASK/_TYPE/ on the last 5 fields.

-- 
Shawn.
Previous: Jonas Fonseca
Message 3 of 3 in “FileMode: Store bit masks in int constants”
  1. 2/5 FileMode: Store bit masks in int constantsJonas Fonseca, Aug 12, 2009
  2. 2/5 FileMode: Store bit masks in int constantsJonas Fonseca, Aug 12, 2009
  3. Shawn O. PearceAug 12, 2009

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.