From f5afac834b03d5ee46adec982095852609b1b58c Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Sat, 16 Apr 2011 12:43:00 +0100 Subject: [PATCH 1/1] Override "p4 diff" to handle change numbers. Wrapper around "p4 diff" which detects use of the -c flag and calls p4-diffchange, thus enabling uses such as "p4 diff -c 12345" which will show diffs only for files opened in changelist 12345. --- opt/p4/p4-diff | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 opt/p4/p4-diff diff --git a/opt/p4/p4-diff b/opt/p4/p4-diff new file mode 100755 index 0000000..2ecc0d5 --- /dev/null +++ b/opt/p4/p4-diff @@ -0,0 +1,17 @@ +#!/bin/bash + +. ${0%/*}/common + +function parse_change() { + while getopts ":c:" opt; do + case $opt in + c) echo $OPTARG;; + esac + done +} + +if [ -n "$(parse_change $*)" ]; then + exec ${0%/*}/p4-diffchange $p4opts diffchange ${1+"$@"} +else + exec p4 $p4opts $p4command ${1+"$@"} +fi -- 2.7.4