Created
June 25, 2015 17:03
-
-
Save jwhitley/2264a228ea64e4313d11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git -c color.status=always status -s | sed "1s/^/$*\\ | |
/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script shows an approach to conditionally prepending text using sed. If
git status -s
has output, then the arguments to this script will be prepended:When there are no changes,
git status -s
has no output, and the argument text won't be output: