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

Re: [PATCH 1/4] test-svn-fe: split off "test-svn-fe -d" into a separate function

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 31, 2011, 16:32 UTC
Message-ID
<20110531163259.GC390@elie>
In-Reply-To
<1306858704.13283.2.camel@drew-northup.unet.maine.edu>
Drew Northup wrote:
> On Fri, 2011-05-27 at 06:09 -0500, Jonathan Nieder wrote:
>> +static const char test_svnfe_usage[] =
>> +	"test-svn-fe (<dumpfile> | [-d] <preimage> <delta> <len>)";
[...]
> How is this germane to the original intent? Is there a gain by making it
> global (to that file) that I'm missing?

It allows this variable with information about the program in general to be shared by the two functions. Many examples of that style show up with

	git grep -l -F -e 'main(' | xargs git grep -F -e 'usage[]' --
	git grep -F -e 'usage[]' -- builtin

I should have mentioned so in the commit message, though; maybe something like this:

	The helper for testing the svndiff library is getting
	dangerously close to the right margin.  Split it off into a
	separate function so it is easier to contemplate on its own.
	In other words, this just unindents the code a little.  In the
	process, make the test_svnfe_usage[] string static so it can
	be shared by the two functions (and other future functions in
	this test program) without fuss.  No noticeable change
	intended.

Thanks for noticing, Jonathan

Previous: Drew NorthupNext: Jonathan Nieder
Message 4 of 7 in “vcs-svn: avoid hangs for corrupt deltas”
  1. 0/4 vcs-svn: avoid hangs for corrupt deltasJonathan Nieder, May 27, 2011
  2. 1/4 test-svn-fe: split off "test-svn-fe -d" into a separate functionJonathan Nieder, May 27, 2011
  3. Drew NorthupMay 31, 2011
  4. Jonathan NiederMay 31, 2011
  5. 2/4 vcs-svn: cap number of bytes read from sliding viewJonathan Nieder, May 27, 2011
  6. 3/4 vcs-svn: guard against overflow when computing preimage lengthJonathan Nieder, May 27, 2011
  7. 4/4 vcs-svn: avoid hangs from corrupt deltasJonathan Nieder, May 27, 2011

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.