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

Re: What's in git.git, and announcing GIT 1.4.2-rc4

From
Junio C Hamano <junkio@cox.net>
Date
Aug 10, 2006, 08:19 UTC
Message-ID
<7vk65hvw92.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0608100957050.13885@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
> Besides, I really use it often -- you should try it! Call me blind, but 
> very often I cannot spot the differences (in the unified diff) when they 
> are minor, especially when there was just a typo in the documentation. You 
> could now say that I should not care about it, then, but if _I_ made the 
> mistake, I want to learn from it.
I tried it on this:
diff --git a/builtin-apply.c b/builtin-apply.c
index c159873..be2c715 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -1700,10 +1700,8 @@ static int apply_data(struct patch *patc
 		return -1;
 
 	/* NUL terminate the result */
-	if (desc.alloc <= desc.size) {
+	if (desc.alloc <= desc.size)
 		desc.buffer = xrealloc(desc.buffer, desc.size + 1);
-		desc.alloc++;
-	}
 	desc.buffer[desc.size] = 0;
 
 	patch->result = desc.buffer;

which shows something like:

diff --git a/builtin-apply.c b/builtin-apply.c
index c159873..be2c715 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -1700,10 +1700,8 @@ static int apply_data(struct patch *patc
                return -1;

        /* NUL terminate the result */
        if (desc.alloc <= desc.size)
{
                desc.buffer = xrealloc(desc.buffer, desc.size + 1);
                desc.alloc++;
        }
        desc.buffer[desc.size] = 0;

        patch->result = desc.buffer;

where "desc.alloc++;" and next lines and the opening brace after
if() are red.  Why does that red opening brace have to come at
the beginning of line, I wonder...
Previous: Junio C HamanoNext: Johannes Schindelin
Message 10 of 14 in “What's in git.git, and announcing GIT 1.4.2-rc4”
  1. Junio C HamanoAug 10, 2006
  2. Willy TarreauAug 10, 2006
  3. Junio C HamanoAug 10, 2006
  4. Junio C HamanoAug 10, 2006
  5. Willy TarreauAug 10, 2006
  6. Johannes SchindelinAug 10, 2006
  7. Junio C HamanoAug 10, 2006
  8. Johannes SchindelinAug 10, 2006
  9. Junio C HamanoAug 10, 2006
  10. Junio C HamanoAug 10, 2006
  11. Johannes SchindelinAug 10, 2006
  12. Alex RiesenAug 10, 2006
  13. Johannes SchindelinAug 10, 2006
  14. Alex RiesenAug 10, 2006

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.