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

Re: [PATCH 1/2] gitview: Use new-style classes

From
Junio C Hamano <junkio@cox.net>
Date
Jun 2, 2007, 09:38 UTC
Message-ID
<7vsl9awva8.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<f623da83269ba030fabc64777cdb1071e5ab00bf.1180500418.git.michael@ellerman.id.au>
Michael Ellerman <michael@ellerman.id.au> writes:
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Aneesh, this one is in your bailiwick.

Michael, it would have been nicer to have a real log message, not just the Subject line, in your message. The Subject line says what the patch does in what subarea of the git.git tree, which is very appropriate, but that can be seen from the diff even if you did not say so. The log message (before your Signed-off-by line) is where you describe _why_ you would think it is a good change. "What" and "how" are usually evident in well written code without much explanation, but "why" is often more useful when reviewing the patch, and reading and studying the history of the code.

I would have written something like:
	This changes the Commit class to use new-style class,
	which has been available since Python 2.2 (Dec 2001).
	This is a necessary step in order to use __slots__
	declaration so that we can reduce the memory footprint
	with my next patch.

I have no strong preference on this change myself. "Classes that derive from type" are relatively recent invention but I would personally feel that Python 2.2 is ancient enough that using it would not pose any practical portability issues, but what would I know...

The __slots__ patch depends on this, and that one has a measurable memory footprint improvement, so I would say we should take it.

Previous: Michael EllermanNext: Michael Ellerman
Message 3 of 4 in “gitview: Use new-style classes”
  1. 1/2 gitview: Use new-style classesMichael Ellerman, May 30, 2007
  2. 2/2 gitview: Define __slots__ for CommitMichael Ellerman, May 30, 2007
  3. Junio C HamanoJun 2, 2007
  4. Michael EllermanJun 4, 2007

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.