git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: perryh@pluto.rain.com (Perry Hutchison)
To: norm@dad.org
Cc: git@vger.kernel.org
Subject: Re: Question: Getting 'git diff' to generate /usr/bin/diff output
Date: Sat, 16 Jul 2016 13:47:23 -0700	[thread overview]
Message-ID: <578a9d5b.xL1egXSTCv+mjhAT%perryh@pluto.rain.com> (raw)
In-Reply-To: <201607161912.u6GJCM79069898@shell1.rawbw.com>

norm@dad.org wrote:

> I am trying to learn how to use git, and am having difficulty
> using 'git diff'.
>
> I can't deal with its output very well. What I would really like
> to do is apply /usr/lib/diff.
                      ^^^

For starters, when using the full pathname, you'll need to spell it
correctly :)

> Would some kind soul be willing to tell me if there is a way to
> do that, short of making a backup copy of the relevant file, and
> then doing 'git checkout'. Maybe the '--ext-diff' argument to
> 'git diff' will do that, but I can't figure out how to use it.
> ...
>     git version: 2.5.1.454.g1616360

'git cat' would be simpler than making a backup and using 'git checkout',
but for this use case there's a better way even than that.

Google is your friend when you can't figure something out from (or
find the right part of) a program's own documentation.  A search for

    git "external diff program"

(including the quotes) found several references.

One possible complication:  It's likely that the command parameters
which git passes to an external diff program are not exactly what
/usr/bin/diff requires.  The solution to that sort of problem is to
write a very short executable script that rearranges the parameters
as needed, and specify that script (instead of /usr/bin/diff itself)
as the external diff program.

  reply	other threads:[~2016-07-16 21:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-16 19:12 Question: Getting 'git diff' to generate /usr/bin/diff output norm
2016-07-16 20:47 ` Perry Hutchison [this message]
2016-07-17  7:46   ` Johannes Schindelin
2016-07-19 15:20     ` norm
2016-07-17 12:18 ` René Scharfe
2016-07-17 17:26   ` norm
2016-07-18  7:23     ` Johannes Schindelin
2016-07-18  9:19       ` [PATCH] pager: disable color when pager is "more" Eric Wong
2016-07-18 13:16         ` Jeff King
2016-07-18 17:19           ` Junio C Hamano
2016-07-18 18:58             ` Jeff King
2016-07-19  2:37             ` Eric Wong

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=578a9d5b.xL1egXSTCv+mjhAT%perryh@pluto.rain.com \
    --to=perryh@pluto.rain.com \
    --cc=git@vger.kernel.org \
    --cc=norm@dad.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.
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).