git-completion.tcsh: fix redirect with noclobber
authorAriel Faigon <github.2009@yendor.com>
Tue, 9 Jun 2015 17:25:15 +0000 (10:25 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Jun 2015 18:21:15 +0000 (11:21 -0700)
tcsh users who happen to have 'set noclobber' elsewhere in their
~/.tcshrc or ~/.cshrc startup files get a 'File exist' error, and
the tcsh completion file doesn't get generated/updated.

Adding a `!` in the redirect works correctly for both clobber (default)
and 'set noclobber' users.

Reviewed-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Ariel Faigon <github.2009@yendor.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.tcsh
index 6104a42a23c4f38848a34c5c212bd7b74de81ab4..4a790d8f4ec18e0bfedbc7f8ce9f2d4291c284e4 100644 (file)
@@ -41,7 +41,7 @@ if ( ! -e ${__git_tcsh_completion_original_script} ) then
        exit
 endif
 
-cat << EOF > ${__git_tcsh_completion_script}
+cat << EOF >! ${__git_tcsh_completion_script}
 #!bash
 #
 # This script is GENERATED and will be overwritten automatically.