Add file read to git

This commit is contained in:
Roman Mueller 2020-10-02 14:50:08 +02:00 committed by GitHub
parent 81fafc83f3
commit 1a5b396744
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,11 @@ functions:
echo 'exec /bin/sh 0<&2 1>&2' >"$TF/.git/hooks/pre-commit.sample" echo 'exec /bin/sh 0<&2 1>&2' >"$TF/.git/hooks/pre-commit.sample"
mv "$TF/.git/hooks/pre-commit.sample" "$TF/.git/hooks/pre-commit" mv "$TF/.git/hooks/pre-commit.sample" "$TF/.git/hooks/pre-commit"
git -C "$TF" commit --allow-empty -m x git -C "$TF" commit --allow-empty -m x
file-read:
- description: The read file content is displayed in `diff` style output format.
code: |
LFILE=file_to_read
git diff /dev/null $LFILE
sudo: sudo:
- code: sudo PAGER='sh -c "exec sh 0<&1"' git -p help - code: sudo PAGER='sh -c "exec sh 0<&1"' git -p help
- description: This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply. - description: This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.