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

Re: [regression] Re: git-cat-file --batch reversion; cannot query filenames with spaces

From
Jeff King <peff@peff.net>
Date
Aug 3, 2013, 07:18 UTC
Message-ID
<20130803071842.GB26894@sigill.intra.peff.net>
In-Reply-To
<7vmwp0osic.fsf@alter.siamese.dyndns.org>
On Fri, Aug 02, 2013 at 11:30:03AM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> > I didn't see the result of your wrangling in pu, but I will keep an eye
> > out to double-check it (unless you did not finish, in which case I am
> > happy to do the wrangling myself).
> 
> Here is what is on top of the revert that has been pushed out on
> 'pu'.
Thanks, that looks good to me.

We may want to also squash in the patch below, which puts the pointer variable in the most-local block and re-wraps the newly indented comment for line length. Neither introduced by your adaptation, but they became more obvious to me when seen on top of the revert.

-Peff
---
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 07b4818..41afaa5 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -286,15 +286,15 @@ static int batch_objects(struct batch_options *opt)
 	warn_on_object_refname_ambiguity = 0;
 
 	while (strbuf_getline(&buf, stdin, '\n') != EOF) {
-		char *p;
 		int error;
 
 		if (data.split_on_whitespace) {
 			/*
-			 * Split at first whitespace, tying off the beginning of the
-			 * string and saving the remainder (or NULL) in data.rest.
+			 * Split at first whitespace, tying off the beginning
+			 * of the string and saving the remainder (or NULL) in
+			 * data.rest.
 			 */
-			p = strpbrk(buf.buf, " \t");
+			char *p = strpbrk(buf.buf, " \t");
 			if (p) {
 				while (*p && strchr(" \t", *p))
 					*p++ = '\0';
Previous: Jonathan NiederNext: Junio C Hamano
Message 10 of 11 in “[regression] Re: git-cat-file --batch reversion; cannot query filenames with spaces”
  1. Jonathan NiederAug 2, 2013
  2. Jeff KingAug 2, 2013
  3. Jeff KingAug 2, 2013
  4. Joey HessAug 2, 2013
  5. Brandon CaseyAug 2, 2013
  6. Junio C HamanoAug 2, 2013
  7. Jeff KingAug 2, 2013
  8. Junio C HamanoAug 2, 2013
  9. Jonathan NiederAug 2, 2013
  10. Jeff KingAug 3, 2013
  11. Junio C HamanoAug 2, 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.