From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] improve git diff Date: Sat, 12 Nov 2016 21:51:21 +0100 Message-ID: <3760690.4pEarhzBJZ@xps13> References: <1478706261-31261-1-git-send-email-thomas.monjalon@6wind.com> <1616077.gDs2nMcLPh@xps13> <59b9b8bf-1b90-8055-74f7-eecd6fe9c41a@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Ferruh Yigit Return-path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 91674D57A for ; Sat, 12 Nov 2016 21:51:25 +0100 (CET) Received: by mail-wm0-f49.google.com with SMTP id g23so35617705wme.1 for ; Sat, 12 Nov 2016 12:51:25 -0800 (PST) In-Reply-To: <59b9b8bf-1b90-8055-74f7-eecd6fe9c41a@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-11-11 17:28, Ferruh Yigit: > On 11/11/2016 4:21 PM, Thomas Monjalon wrote: > > 2016-11-11 11:22, Ferruh Yigit: > >> On 11/9/2016 3:44 PM, Thomas Monjalon wrote: > >>> Sometimes git does not print the name of the function being changed > >>> after @@. It happens especially after a goto label which is not indented. > >>> Giving a hint about the languages of files .c, .h and .py > >>> will improve hunk headers of "git diff" rendering. > >>> > >>> Signed-off-by: Thomas Monjalon > > [...] > >>> --- /dev/null > >>> +++ b/.gitattributes > >>> @@ -0,0 +1,3 @@ > >>> +*.c diff=cpp > >>> +*.h diff=cpp > >> > >> Can't git auto detect to use C/C++ language diff use for .c/.h files? > > > > No > > > >> Do you have a sample that generates bad hunk header, just to test? > > > > Yes, you'll find a lot of them with "git log -p | grep '@@.*:'" > > Example: > > git show bb6722f | grep '@@.*:' > > Without the patch, it is a goto label in the hunk header. > > > > You are right, I was expecting better from git J Sometimes, less is more :)