{"thread":{"id":"39574","subject":"[PATCH] git-completion.tcsh: fix redirect with noclobber","startedAt":"2015-06-09T17:25:15Z","lastAt":"2015-06-09T18:20:19Z","messageCount":2,"participants":["Ariel Faigon","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"263382","messageId":"20150609172515.GA20638@yendor.com","threadId":"39574","inReplyTo":null,"subject":"[PATCH] git-completion.tcsh: fix redirect with noclobber","fromName":"Ariel Faigon","fromEmail":"github.2009@yendor.com","sentAt":"2015-06-09T17:25:15Z","receivedAt":"2015-06-09T17:25:15Z","isPatch":true,"sender":{"key":"github.2009@yendor.com","avatar":null},"body":"tcsh users who happen to have 'set noclobber' elsewhere in their\n~/.tcshrc or ~/.cshrc startup files get a 'File exist' error, and\nthe tcsh completion file doesn't get generated/updated.\n\nAdding a `!` in the redirect works correctly for both clobber (default)\nand 'set noclobber' users.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nReviewed-by: Christian Couder <christian.couder@gmail.com>\nSigned-off-by: Ariel Faigon <github.2009@yendor.com>\n---\n\n contrib/completion/git-completion.tcsh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.tcsh b/contrib/completion/git-completion.tcsh\nindex 6104a42..4a790d8 100644\n--- a/contrib/completion/git-completion.tcsh\n+++ b/contrib/completion/git-completion.tcsh\n@@ -41,7 +41,7 @@ if ( ! -e ${__git_tcsh_completion_original_script} ) then\n \texit\n endif\n \n-cat << EOF > ${__git_tcsh_completion_script}\n+cat << EOF >! ${__git_tcsh_completion_script}\n #!bash\n #\n # This script is GENERATED and will be overwritten automatically.\n"},{"id":"263405","messageId":"xmqqtwug7nh8.fsf@gitster.dls.corp.google.com","threadId":"39574","inReplyTo":"20150609172515.GA20638@yendor.com","subject":"Re: [PATCH] git-completion.tcsh: fix redirect with noclobber","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-09T18:20:19Z","receivedAt":"2015-06-09T18:20:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ariel Faigon <github.2009@yendor.com> writes:\n\n> tcsh users who happen to have 'set noclobber' elsewhere in their\n> ~/.tcshrc or ~/.cshrc startup files get a 'File exist' error, and\n> the tcsh completion file doesn't get generated/updated.\n>\n> Adding a `!` in the redirect works correctly for both clobber (default)\n> and 'set noclobber' users.\n>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Reviewed-by: Christian Couder <christian.couder@gmail.com>\n> Signed-off-by: Ariel Faigon <github.2009@yendor.com>\n> ---\n\nThanks for enduring three iterations for a single-liner.  This\nversio will show nicely in \"git log -p\" output ;-)\n\nIn case anybody is wondering, that \"Helped-by: notifications@github\"\nwas merely because I said \"this change makes sense, care to send it\nover to us at git@vger?\" from github UI on Ariel's commit.  I do not\ndeserve helped-by for merely encouraging participation.\n\nWill queue.  Thanks again.\n\n>\n>  contrib/completion/git-completion.tcsh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/contrib/completion/git-completion.tcsh b/contrib/completion/git-completion.tcsh\n> index 6104a42..4a790d8 100644\n> --- a/contrib/completion/git-completion.tcsh\n> +++ b/contrib/completion/git-completion.tcsh\n> @@ -41,7 +41,7 @@ if ( ! -e ${__git_tcsh_completion_original_script} ) then\n>  \texit\n>  endif\n>  \n> -cat << EOF > ${__git_tcsh_completion_script}\n> +cat << EOF >! ${__git_tcsh_completion_script}\n>  #!bash\n>  #\n>  # This script is GENERATED and will be overwritten automatically.\n"}]}