Skip to content

Commit

Permalink
Drop the requirement of P4DIFF="diff -u" for perforce workspace
Browse files Browse the repository at this point in the history
"p4 diff -du" does the job. Also switch to "p4 info" which is slightly
faster.
  • Loading branch information
ymattw committed Nov 13, 2024
1 parent 8866e20 commit 7e6c787
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ Redirect output to another patch file is safe even without ``-u``:
Notes
-----

1. Ydiff only supports diffs in `Unified Format`_. This is default in most
version control system except Perforce, which needs an environment variable
``P4DIFF="diff -u"`` to output unified diff.
1. Ydiff only supports diffs in `Unified Format`_.

.. _`Unified Format`: https://en.wikipedia.org/wiki/Diff#Unified_format

Expand Down
4 changes: 2 additions & 2 deletions ydiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,8 @@ def markup_to_pager(stream, opts):
'log': ['hg', 'log', '--patch'],
},
'Perforce': {
'probe': ['p4', 'dirs', '.'],
'diff': ['p4', 'diff'],
'probe': ['p4', 'info'],
'diff': ['p4', 'diff', '-du'],
'log': None,
},
'Svn': {
Expand Down

0 comments on commit 7e6c787

Please sign in to comment.