git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: David Abrahams <dave@boostpro.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Michael J Gruber <git@drmicha.warpmail.net>,
	git@vger.kernel.org
Subject: Re: git diff bug?
Date: Mon, 6 Apr 2009 14:48:30 -0400	[thread overview]
Message-ID: <20090406184830.GA28120@coredump.intra.peff.net> (raw)
In-Reply-To: <D4B0EDF7-E1BD-44E3-858F-002CFF2C496A@boostpro.com>

On Mon, Apr 06, 2009 at 01:58:08PM -0400, David Abrahams wrote:

>> The "*.el" line goes into .gitattributes (or .git/info/a...), the other
>> lines are config lines and thus goe into .git/config or .gitconfig.
>
> Aha, thanks.  The hunk header section in the gitattributes manpage turns 
> out to be the only one that shows config stuff without mentioning a config 
> file, thus my confusion.  I suggest a tiny patch ('cept I don't know how 
> to write manpage format)

Neither do I, but fortunately the git docs are all written in asciidoc. :)

Junio, does the patch below make sense to you?

-- >8 --
Subject: [PATCH] doc/gitattributes: clarify location of config text

The gitattributes documentation has a section on the "diff"
attribute, with subsections for each of the things you might
want to configure in your diff config section (external
diff, hunk headers, etc). The first such subsection
specifically notes that the definition of the diff driver
should go into $GIT_DIR/config, but subsequent sections do
not.

This location is implied if you are reading the
documentation sequentially, but it is not uncommon for a new
user to jump to (or be referred to) a specific section. For
a new user who does not know git well enough to recognize
the config syntax, it is not clear that those directives
don't also go into the gitattributes file.

This patch just mentions the config file in each subsection,
similar to the way it is mentioned in the first.

Signed-off-by: Jeff King <peff@peff.net>
---
Mentioning $GIT_DIR/config _and_ $HOME/.gitconfig in each subsection may
seem like overkill, but I really think we shouldn't make any assumption
that a reader has seen the previous sections. They otherwise stand alone
very well.

I arrived at these three sections by grepping for '^[' to find example
config file syntax.

 Documentation/gitattributes.txt |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 55668e3..b6260b1 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -297,7 +297,8 @@ for paths.
 
 Then, you would define a "diff.tex.xfuncname" configuration to
 specify a regular expression that matches a line that you would
-want to appear as the hunk header "TEXT", like this:
+want to appear as the hunk header "TEXT". Add a section to your
+`$GIT_DIR/config` file (or `$HOME/.gitconfig` file) like this:
 
 ------------------------
 [diff "tex"]
@@ -345,7 +346,8 @@ split words in a line, by specifying an appropriate regular expression
 in the "diff.*.wordRegex" configuration variable.  For example, in TeX
 a backslash followed by a sequence of letters forms a command, but
 several such commands can be run together without intervening
-whitespace.  To separate them, use a regular expression such as
+whitespace.  To separate them, use a regular expression in your
+`$GIT_DIR/config` file (or `$HOME/.gitconfig` file) like this:
 
 ------------------------
 [diff "tex"]
@@ -373,7 +375,8 @@ resulting text on stdout.
 
 For example, to show the diff of the exif information of a
 file instead of the binary information (assuming you have the
-exif tool installed):
+exif tool installed), add the following section to your
+`$GIT_DIR/config` file (or `$HOME/.gitconfig` file):
 
 ------------------------
 [diff "jpg"]
-- 
1.6.2.2.585.g1e067

  reply	other threads:[~2009-04-06 18:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-04  1:10 git diff bug? David Abrahams
2009-04-04  1:45 ` Jeff King
2009-04-04  1:52   ` Jeff King
2009-04-06  9:09   ` David Abrahams
2009-04-06 14:44     ` Michael J Gruber
2009-04-06 17:58       ` David Abrahams
2009-04-06 18:48         ` Jeff King [this message]
2009-04-06 15:53     ` Jeff King
2009-04-06 17:37       ` Matthieu Moy
2009-04-06 17:56         ` Junio C Hamano
2009-04-06 19:32           ` Matthieu Moy
2009-04-06 18:16       ` David Abrahams
2009-04-07 18:25     ` Antriksh Pany
  -- strict thread matches above, loose matches on Subject: below --
2013-06-06 21:26 Sarma Tangirala
2013-06-06 21:42 ` Célestin Matte
2013-06-06 22:17   ` Junio C Hamano
2013-06-07 16:01     ` Sarma Tangirala
2013-06-10 12:44       ` Célestin Matte
2013-06-10 14:41         ` Sarma Tangirala

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090406184830.GA28120@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=dave@boostpro.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).