From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [PATCH] Teach 'git-apply --whitespace=strip' to remove empty lines at the end of file Date: Sun, 20 May 2007 12:16:04 -0700 Message-ID: <7vd50vl30r.fsf@assigned-by-dhcp.cox.net> References: <7vabvzq0bb.fsf@assigned-by-dhcp.cox.net> <7vabvzoij8.fsf@assigned-by-dhcp.cox.net> <7v1whbmjel.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Git Mailing List" To: "Marco Costalba" X-From: git-owner@vger.kernel.org Sun May 20 21:16:12 2007 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hpqt0-0001kv-Mg for gcvg-git@gmane.org; Sun, 20 May 2007 21:16:11 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755879AbXETTQH (ORCPT ); Sun, 20 May 2007 15:16:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755613AbXETTQG (ORCPT ); Sun, 20 May 2007 15:16:06 -0400 Received: from fed1rmmtao103.cox.net ([68.230.241.43]:50523 "EHLO fed1rmmtao103.cox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755879AbXETTQF (ORCPT ); Sun, 20 May 2007 15:16:05 -0400 Received: from fed1rmimpo02.cox.net ([70.169.32.72]) by fed1rmmtao103.cox.net (InterMail vM.7.05.02.00 201-2174-114-20060621) with ESMTP id <20070520191605.QIST19731.fed1rmmtao103.cox.net@fed1rmimpo02.cox.net>; Sun, 20 May 2007 15:16:05 -0400 Received: from assigned-by-dhcp.cox.net ([68.5.247.80]) by fed1rmimpo02.cox.net with bizsmtp id 1XG41X00T1kojtg0000000; Sun, 20 May 2007 15:16:05 -0400 In-Reply-To: (Marco Costalba's message of "Sun, 20 May 2007 20:56:49 +0200") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: "Marco Costalba" writes: > On 5/20/07, Junio C Hamano wrote: > ... >> > diff --git a/builtin-apply.c b/builtin-apply.c >> > index 0399743..6032f78 100644 >> > --- a/builtin-apply.c >> > +++ b/builtin-apply.c >> > ... >> > @@ -1770,6 +1800,10 @@ static int apply_one_fragment(struct buffer_desc *desc, >> > if (match_beginning && offset) >> > offset = -1; >> > if (offset >= 0) { >> > + >> > + if (desc->size - oldsize - offset == 0) /* end of file? */ >> > + newsize -= trailing_added_lines; >> > + >> > int diff = newsize - oldsize; >> > unsigned long size = desc->size + diff; >> > unsigned long alloc = desc->alloc; >> >> But we have kept our sources -Wdeclaration-after-statement >> clean so far > > ?????? > > Wie bitte? Sorry I forgot to mention that that is "trivial" so there is no reason to resend. I don't expect me doing much git stuff for the rest of the day, but you'll hear from me about this patch later (hopefully it would appear on 'next' -- we'll see).