From: Alban Gruin <alban.gruin@gmail.com>
To: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>, git@vger.kernel.org
Subject: Re: java diffs show no method context
Date: Wed, 25 Apr 2018 17:05:34 +0200 [thread overview]
Message-ID: <aae8d748-101d-1eb2-f8e8-9da2e53e2388@gmail.com> (raw)
In-Reply-To: <5AE07A3A020000A10002B5C5@gwsmtp1.uni-regensburg.de>
Le 25/04/2018 à 14:53, Ulrich Windl a écrit :
> Hi!
>
> This is for git 2.13.6, and it may be an FAQ or frequent feature request. Anyway:
> I'm new to Java, and writing my first project using Git, I found that "git diff" only reports the class in the diff context, but not the method (as seen for C, for example).
> I'd wish to have the method where the diff is located.
Hi,
to achieve this behaviour, you have to create a file named
".gitattributes" at the root of your project, containing this line:
*.java diff=java
.gitattributes allows you to configure other things, as described in the
documentation[1].
I hope it helps.
[1] https://www.git-scm.com/docs/gitattributes
Cheers,
Alban
next prev parent reply other threads:[~2018-04-25 15:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 12:53 java diffs show no method context Ulrich Windl
2018-04-25 15:05 ` Alban Gruin [this message]
2018-04-26 6:30 ` Antw: " Ulrich Windl
2018-04-26 7:43 ` Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aae8d748-101d-1eb2-f8e8-9da2e53e2388@gmail.com \
--to=alban.gruin@gmail.com \
--cc=Ulrich.Windl@rz.uni-regensburg.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).