about summary refs log tree commit diff
path: root/configs/shared/zsh/functions.zsh
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2019-03-21T17·24+0000
committerWilliam Carroll <wpcarro@gmail.com>2019-03-21T17·24+0000
commit845ebb08feffe322dff54d9d93e554c8397edac4 (patch)
tree1e42e7ff83992c0d68efa349d96faf45a9163e02 /configs/shared/zsh/functions.zsh
parentf1ca81b02103953d5a82ed79643be18ba50d1478 (diff)
Creates wrapper around `p4 filelog`
Should make viewing file history a little more ergonomic.
Diffstat (limited to 'configs/shared/zsh/functions.zsh')
-rw-r--r--configs/shared/zsh/functions.zsh9
1 files changed, 9 insertions, 0 deletions
diff --git a/configs/shared/zsh/functions.zsh b/configs/shared/zsh/functions.zsh
index ae259853978b..815d90aefd85 100644
--- a/configs/shared/zsh/functions.zsh
+++ b/configs/shared/zsh/functions.zsh
@@ -530,6 +530,15 @@ g3_root() {
   echo "${PWD%%/google3/*}/google3"
 }
 
+p4_filelog() {
+  # Logs a file's Piper history. This is a convenience wrapper around
+  # `p4 filelog`.
+  # `filename` should be a relative path.
+  # Usage: p4_filelog <filename>
+  # Depends: p4
+  p4 filelog "//depot/$(pwd | grep -P -o 'google3\/.+$')/$1"
+}
+
 citc_workspace() {
   # Returns the name of your current CitC workspace
   pwd | grep -o -P "$(whoami)\/[^\/]+"