smarter handling of redirections and add --color option to override auto settings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
colordiff (Debian) |
New
|
Undecided
|
Unassigned | ||
colordiff (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
If diff is aliased to colordiff as suggested, then:
$ diff -aur | grep -v "^Only" > file.diff
produces a broken patch.
colordiff should be as smart as "git diff", that is, if the output is a tty, then use a pager and color, if not, then don't use color.
The attached patch does this.
Several improvements are possible:
1) Use "less -r" by default and if that fails just warn and keep STDOUT as-is.
2) Add an option like in grep:
--color[=WHEN],
-
(the default is 'auto')
3) Integrate colordiff in GNU diff re-using the code used in grep.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: colordiff 1.0.9-1 [modified: usr/bin/colordiff]
ProcVersionSign
Uname: Linux 3.2.0-39-
NonfreeKernelMo
ApportVersion: 2.0.1-0ubuntu17.1
Architecture: i386
Date: Fri Mar 29 11:54:01 2013
EcryptfsInUse: Yes
InstallationMedia: Kubuntu 12.04 LTS "Precise Pangolin" - Release i386 (20120423)
MarkForUpload: True
PackageArchitec
SourcePackage: colordiff
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in colordiff (Ubuntu): | |
status: | New → Invalid |
Updated pach implementing (2)