vc-git.el vc-git-grep does not work with git 1.9 in trusty
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
emacs23 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
For emacs to properly parse the result of git grep it must not be fed through a pager (like less) and it must not include colourization escape codes.
If a pager is spawned, it might blow up with this:
git grep -n -e ClkIB -- *
WARNING: terminal is not fully functional
- (press RETURN)
If colourization is turned on then the output from git no longer matches the grep filename regex. For instance grepping for 'COPYRIGHT' gives colourized lines like this:
Makefile.
(where [ is the ESC). Git has colour'd the : characters as well as the matching string. The standard emacs grep regex is not prepared to handle the escape characters.
Within vc-git.
(when command
(let ((default-directory dir)
;; Setting process-
;; even when async processes aren't supported.
But for whatever reason with git 1.9 this still spawns a pager.
Updating to GIT_PAGER="" does not spawn a pager, but still colourizes the output.
The only fix I can find would be to replace:
with:
This restores the behaviour older git's had with PAGER="" and allows emacs to properly parse the result.
However, I would expect that it won't be compatible with older gits.
Since Ubuntu does not ship older gits it seems reasonable to patch vc-git.el and let upstream figure out how to make this generic.
emacs23-el:
Installed: 23.4+1-4.1ubuntu1
Candidate: 23.4+1-4.1ubuntu1
Version table:
*** 23.4+1-4.1ubuntu1 0