Skip to content

Commit ff2aae7

Browse files
cmaiolinojeffpc
authored andcommitted
[PATCH] guilt-refresh: Check color.ui git config before refresh
If color.ui configuration is set to "always", git will include escape characters even during output redirection. It will create bad-formatted patches trashing the guilt patch stack Signed-off-by: Carlos Maiolino <[email protected]> [jeffpc: quote arg in `[` to avoid malformed command] Signed-off-by: Josef 'Jeff' Sipek <[email protected]>
1 parent 202f10a commit ff2aae7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: guilt-refresh

+9
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@
44
#
55

66
USAGE="[--git] [--diffstat]"
7+
COLOR=`git config --get color.ui`
8+
79
if [ -z "$GUILT_VERSION" ]; then
810
echo "Invoking `basename "$0"` directly is no longer supported." >&2
911
exit 1
1012
fi
1113

1214
_main() {
1315

16+
if [ "$COLOR" = "always" ]; then
17+
echo "git color.ui=always is unsupported because"
18+
echo "escape characters will be redirected"
19+
echo "please set it to color.ui=auto"
20+
exit 1
21+
fi
22+
1423
while [ $# -gt 0 ]; do
1524
case "$1" in
1625
--git)

0 commit comments

Comments
 (0)