{"thread":{"id":"36887","subject":"[PATCH] pull: Do not abuse 'break' inside a shell 'case'","startedAt":"2014-06-11T08:47:45Z","lastAt":"2014-06-11T20:13:30Z","messageCount":2,"participants":["Jacek Konieczny","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"243886","messageId":"1402476465-27177-1-git-send-email-jajcus@jajcus.net","threadId":"36887","inReplyTo":null,"subject":"[PATCH] pull: Do not abuse 'break' inside a shell 'case'","fromName":"Jacek Konieczny","fromEmail":"jajcus@jajcus.net","sentAt":"2014-06-11T08:47:45Z","receivedAt":"2014-06-11T08:47:45Z","isPatch":true,"sender":{"key":"jajcus@jajcus.net","avatar":null},"body":"It is not C. The code would break under mksh when 'pull.ff' is set:\n\n  $ git pull\n  /usr/lib/git-core/git-pull[67]: break: can't break\n  Already up-to-date.\n\nSigned-off-by: Jacek Konieczny <jajcus@jajcus.net>\n---\n git-pull.sh | 2 --\n 1 file changed, 2 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 6cd8ebc..7358fac 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -58,11 +58,9 @@ pull_ff=$(git config pull.ff)\n case \"$pull_ff\" in\n false)\n \tno_ff=--no-ff\n-\tbreak\n \t;;\n only)\n \tff_only=--ff-only\n-\tbreak\n \t;;\n esac\n \n-- \n2.0.0\n"},{"id":"243924","messageId":"xmqqvbs76w7p.fsf@gitster.dls.corp.google.com","threadId":"36887","inReplyTo":"1402476465-27177-1-git-send-email-jajcus@jajcus.net","subject":"Re: [PATCH] pull: Do not abuse 'break' inside a shell 'case'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-11T20:13:30Z","receivedAt":"2014-06-11T20:13:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jacek Konieczny <jajcus@jajcus.net> writes:\n\n> It is not C. The code would break under mksh when 'pull.ff' is set:\n>\n>   $ git pull\n>   /usr/lib/git-core/git-pull[67]: break: can't break\n>   Already up-to-date.\n>\n> Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>\n> ---\n\nThanks for spotting; I cannot believe this somehow got through\nunnoticed.\n\nAs this fixes b814da89 (pull: add pull.ff configuration,\n2014-01-15), it will eventually have to go to both master for 2.1\nand maint for 2.0.1.\n\n\n\n\n>  git-pull.sh | 2 --\n>  1 file changed, 2 deletions(-)\n>\n> diff --git a/git-pull.sh b/git-pull.sh\n> index 6cd8ebc..7358fac 100755\n> --- a/git-pull.sh\n> +++ b/git-pull.sh\n> @@ -58,11 +58,9 @@ pull_ff=$(git config pull.ff)\n>  case \"$pull_ff\" in\n>  false)\n>  \tno_ff=--no-ff\n> -\tbreak\n>  \t;;\n>  only)\n>  \tff_only=--ff-only\n> -\tbreak\n>  \t;;\n>  esac\n"}]}