From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756884AbcIGMeQ (ORCPT ); Wed, 7 Sep 2016 08:34:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:49187 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756654AbcIGMeK (ORCPT ); Wed, 7 Sep 2016 08:34:10 -0400 Date: Wed, 7 Sep 2016 14:34:03 +0200 From: Jean Delvare To: LKML Cc: Peter Zijlstra , Joe Perches , Jonathan Corbet , Andrew Morton Subject: [PATCH] Set git diff driver for C source code files Message-ID: <20160907143403.1449324f@endymion> Organization: SUSE Linux X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.30; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Git can be told to apply language-specific rules when generating diffs. Enable this for C source code files (*.c and *.h) so that function names are printed right. Specifically, doing so prevents "git diff" from mistakenly considering unindented goto labels as function names. Signed-off-by: Jean Delvare Cc: Peter Zijlstra Cc: Joe Perches Cc: Jonathan Corbet --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-4.7/.gitattributes 2016-09-07 14:07:23.042138220 +0200 @@ -0,0 +1,2 @@ +*.c diff=cpp +*.h diff=cpp -- Jean Delvare SUSE L3 Support