{"thread":{"id":"29738","subject":"[PATCH] rebase -m: only call \"notes copy\" when rewritten exists and is non-empty","startedAt":"2012-02-25T04:31:22Z","lastAt":"2012-02-27T00:01:09Z","messageCount":2,"participants":["Andrew Wong","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"185440","messageId":"1330144282-22540-1-git-send-email-andrew.kw.w@gmail.com","threadId":"29738","inReplyTo":null,"subject":"[PATCH] rebase -m: only call \"notes copy\" when rewritten exists and is non-empty","fromName":"Andrew Wong","fromEmail":"andrew.kw.w@gmail.com","sentAt":"2012-02-25T04:31:22Z","receivedAt":"2012-02-25T04:31:22Z","isPatch":true,"sender":{"key":"andrew.kw.w@gmail.com","avatar":"https://avatars.githubusercontent.com/u/489311?v=4"},"body":"This prevents a shell error complaining rebase-merge/rewritten doesn't exist.\n\nSigned-off-by: Andrew Wong <andrew.kw.w@gmail.com>\n---\n git-rebase--merge.sh |    9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/git-rebase--merge.sh b/git-rebase--merge.sh\nindex 26afc75..5e9d95f 100644\n--- a/git-rebase--merge.sh\n+++ b/git-rebase--merge.sh\n@@ -90,10 +90,11 @@ call_merge () {\n \n finish_rb_merge () {\n \tmove_to_original_branch\n-\tgit notes copy --for-rewrite=rebase < \"$state_dir\"/rewritten\n-\tif test -x \"$GIT_DIR\"/hooks/post-rewrite &&\n-\t\ttest -s \"$state_dir\"/rewritten; then\n-\t\t\"$GIT_DIR\"/hooks/post-rewrite rebase < \"$state_dir\"/rewritten\n+\tif test -s \"$state_dir\"/rewritten; then\n+\t\tgit notes copy --for-rewrite=rebase < \"$state_dir\"/rewritten\n+\t\tif test -x \"$GIT_DIR\"/hooks/post-rewrite; then\n+\t\t\t\"$GIT_DIR\"/hooks/post-rewrite rebase < \"$state_dir\"/rewritten\n+\t\tfi\n \tfi\n \trm -r \"$state_dir\"\n \tsay All done.\n-- \n1.7.9.2.263.g07763\n"},{"id":"185478","messageId":"7vpqd1cfga.fsf@alter.siamese.dyndns.org","threadId":"29738","inReplyTo":"1330144282-22540-1-git-send-email-andrew.kw.w@gmail.com","subject":"Re: [PATCH] rebase -m: only call \"notes copy\" when rewritten exists and is non-empty","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-27T00:01:09Z","receivedAt":"2012-02-27T00:01:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andrew Wong <andrew.kw.w@gmail.com> writes:\n\n> This prevents a shell error complaining rebase-merge/rewritten doesn't exist.\n\nYeah, the updated logic overall makes more sense, too.  \"when we have\nrewritten, then we do these two things\" is clear from the text.\n\nThanks.\n"}]}