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

Re: [PATCH v2] git.c: Remove unnecessary new line

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 10, 2013, 00:00 UTC
Message-ID
<20130310000023.GI3908@elie.Belkin>
In-Reply-To
<513BB4A2.8000407@fallo.ws>
Hi,
Michael Fallows wrote:
Show 9 quoted lines
> --- a/git.c
> +++ b/git.c
> @@ -316,8 +316,7 @@ static void handle_internal_command(int argc, const char **argv)
>  		{ "check-ignore", cmd_check_ignore, RUN_SETUP | NEED_WORK_TREE },
>  		{ "check-ref-format", cmd_check_ref_format },
>  		{ "checkout", cmd_checkout, RUN_SETUP | NEED_WORK_TREE },
> -		{ "checkout-index", cmd_checkout_index,
> -			RUN_SETUP | NEED_WORK_TREE},
> +		{ "checkout-index", cmd_checkout_index, RUN_SETUP | NEED_WORK_TREE },

This wrapped line was introduced a while ago (4465f410, checkout-index needs a working tree, 2007-08-04). It was the first line to wrap, but it was also the longest line at the time.

Now the longest line is
		{ "merge-recursive-theirs", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE },

(94 columns), so you are right that consistency would suggest dropping the line wrapping for checkout-index.

But I find it hard to convince myself that alone is worth the churn. In what context did you notice this? Is the intent to help scripts to parse the commands[] list, or to manipulate it while preserving formatting to avoid distractions? Did you notice the broken line while reading through and get distracted, or did some syntax highlighting tool notice the oddity, or something else?

Hope that helps, Jonathan

Previous: Michael FallowsNext: Michael Fallows
Message 2 of 3 in “git.c: Remove unnecessary new line”
  1. git.c: Remove unnecessary new lineMichael Fallows, Mar 9, 2013
  2. Jonathan NiederMar 10, 2013
  3. Michael FallowsMar 10, 2013

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.