Re: Question: Getting 'git diff' to generate /usr/bin/diff output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



norm@xxxxxxx 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]