{"thread":{"id":"18533","subject":"[TopGit PATCH] hooks/pre-commit.sh: fix it again","startedAt":"2009-03-25T11:43:04Z","lastAt":"2009-03-26T14:21:58Z","messageCount":8,"participants":["Bert Wesarg","Uwe Kleine-König","martin f krafft","Marc Kleine-Budde"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"109342","messageId":"1237981384-7857-1-git-send-email-bert.wesarg@googlemail.com","threadId":"18533","inReplyTo":null,"subject":"[TopGit PATCH] hooks/pre-commit.sh: fix it again","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2009-03-25T11:43:04Z","receivedAt":"2009-03-25T11:43:04Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"First I think the '#' is a leftover, second this is now a bashism.\n\nSigned-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n\n---\n hooks/pre-commit.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/hooks/pre-commit.sh b/hooks/pre-commit.sh\nindex a12cfa6..edf2932 100644\n--- a/hooks/pre-commit.sh\n+++ b/hooks/pre-commit.sh\n@@ -1,4 +1,4 @@\n-#!/bin/sh\n+#!/bin/bash\n # TopGit - A different patch queue manager\n # (c) Petr Baudis <pasky@suse.cz>  2008\n # GPLv2\n@@ -20,7 +20,7 @@ tg_util\n if head_=$(git symbolic-ref -q HEAD); then\n \tcase \"$head_\" in\n \t\trefs/heads/*)\n-\t\t\tgit rev-parse -q --verify \"${head_/#refs\\/heads/refs\\/top-bases}\" >/dev/null || exit 0;;\n+\t\t\tgit rev-parse -q --verify \"${head_/refs\\/heads/refs\\/top-bases}\" >/dev/null || exit 0;;\n \t\t*)\n \t\t\texit 0;;\n \tesac\n-- \ntg: (fcb488d..) bw/fix-hook-again (depends on: master)\n"},{"id":"109436","messageId":"20090325121721.GB13065@lapse.rw.madduck.net","threadId":"18533","inReplyTo":"1237981384-7857-1-git-send-email-bert.wesarg@googlemail.com","subject":"Re: [TopGit PATCH] hooks/pre-commit.sh: fix it again","fromName":"martin f krafft","fromEmail":"madduck@debian.org","sentAt":"2009-03-25T12:17:21Z","receivedAt":"2009-03-25T12:17:21Z","isPatch":true,"sender":{"key":"madduck@debian.org","avatar":null},"body":"also sprach Bert Wesarg <bert.wesarg@googlemail.com> [2009.03.25.1243 +0100]:\n> First I think the '#' is a leftover, second this is now a bashism.\n\nI think this can be rewritten as POSIX as follows:\n\n> -\t\t\tgit rev-parse -q --verify \"${head_/#refs\\/heads/refs\\/top-bases}\" >/dev/null || exit 0;;\n> +\t\t\tgit rev-parse -q --verify \"${head_/refs\\/heads/refs\\/top-bases}\" >/dev/null || exit 0;;\n\n  git rev-parse -q --verify \"refs/top-bases/${head_##refs/heads/}\" >/dev/null || exit 0;;\n\nThis turns e.g. refs/heads/foo into foo and prepends\nrefs/top-bases/, which should be the same effect, assuming that the\nvariable's value contains nothing else but the ref's path.\n\n-- \n .''`.   martin f. krafft <madduck@d.o>      Related projects:\n: :'  :  proud Debian developer               http://debiansystem.info\n`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org\n  `-  Debian - when you have better things to do than fixing systems\n \nlogik ist analsadismus: gedanken werden gewaltsam\ndurch einen engen gang gepreßt.\n                                                    -- frei nach lacan\n"},{"id":"109348","messageId":"20090325122027.GB30873@pengutronix.de","threadId":"18533","inReplyTo":"1237981384-7857-1-git-send-email-bert.wesarg@googlemail.com","subject":"Re: [TopGit PATCH] hooks/pre-commit.sh: fix it again","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-03-25T12:20:27Z","receivedAt":"2009-03-25T12:20:27Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"On Wed, Mar 25, 2009 at 12:43:04PM +0100, Bert Wesarg wrote:\n> First I think the '#' is a leftover, second this is now a bashism.\naccording to bash(1):\n\n\tIf pattern begins with #, it must match at the beginning of the\n\texpanded value of parameter.\n\nAnd I noticed, too, that this is a bashism.  Using dash it fails, even\nwith your patch.\n\nI would prefer to really fix it now.\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\n"},{"id":"109349","messageId":"36ca99e90903250524g3549b629g8ce1947f741878f7@mail.gmail.com","threadId":"18533","inReplyTo":"20090325122027.GB30873@pengutronix.de","subject":"Re: [TopGit PATCH] hooks/pre-commit.sh: fix it again","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2009-03-25T12:24:08Z","receivedAt":"2009-03-25T12:24:08Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"2009/3/25 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:\n> On Wed, Mar 25, 2009 at 12:43:04PM +0100, Bert Wesarg wrote:\n>> First I think the '#' is a leftover, second this is now a bashism.\n> according to bash(1):\n>\n>        If pattern begins with #, it must match at the beginning of the\n>        expanded value of parameter.\nThat is obviously true, I first removed this # and than switch to bash\n(after it stills failed), so this was just thinking not testing.\n\n>\n> And I noticed, too, that this is a bashism.  Using dash it fails, even\n> with your patch.\n>\n> I would prefer to really fix it now.\nThanks. I intended this patch as a bug report.\n\nBert\n>\n> Best regards\n> Uwe\n>\n> --\n> Pengutronix e.K.                              | Uwe Kleine-König            |\n> Industrial Linux Solutions                    | http://www.pengutronix.de/  |\n>\n"},{"id":"109431","messageId":"20090325214454.GA14887@pengutronix.de","threadId":"18533","inReplyTo":"1237981384-7857-1-git-send-email-bert.wesarg@googlemail.com","subject":"Re: [TopGit PATCH] hooks/pre-commit.sh: fix it again","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-03-25T21:44:54Z","receivedAt":"2009-03-25T21:44:54Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\n>  if head_=$(git symbolic-ref -q HEAD); then\n>  \tcase \"$head_\" in\n>  \t\trefs/heads/*)\n> -\t\t\tgit rev-parse -q --verify \"${head_/#refs\\/heads/refs\\/top-bases}\" >/dev/null || exit 0;;\n> +\t\t\tgit rev-parse -q --verify \"${head_/refs\\/heads/refs\\/top-bases}\" >/dev/null || exit 0;;\n\t\t\tgit rev-parse -q --verify \"refs/top-bases${head_#refs/heads}\" >/dev/null || exit 0;;\n\nshould work.\n\nBut I'm too tired to make a patch now.  That probably would only result\nin more crap...\n\nUwe\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\n"},{"id":"109505","messageId":"20090326090009.GA7570@pengutronix.de","threadId":"18533","inReplyTo":"1237981384-7857-1-git-send-email-bert.wesarg@googlemail.com","subject":"[PATCH TopGit] hooks/pre-commit.sh: fix bashism","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-03-26T09:00:09Z","receivedAt":"2009-03-26T09:00:09Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"This was introduced in fcb488d51e72c7414f9beb40ad06bf529b8b38dc.\nA similar fix was suggested by martin f krafft, too.\n\nReported-by: Bert Wesarg <bert.wesarg@googlemail.com>\nSigned-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n---\nHello,\n\nthis should fix the issue now.\n\nIf I don't get negative feed back I will push this change later today.\nI'm open for acks, too.\n\nBest regards and thanks\nUwe\n\n hooks/pre-commit.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/hooks/pre-commit.sh b/hooks/pre-commit.sh\nindex a12cfa6..9d677e9 100644\n--- a/hooks/pre-commit.sh\n+++ b/hooks/pre-commit.sh\n@@ -20,7 +20,7 @@ tg_util\n if head_=$(git symbolic-ref -q HEAD); then\n \tcase \"$head_\" in\n \t\trefs/heads/*)\n-\t\t\tgit rev-parse -q --verify \"${head_/#refs\\/heads/refs\\/top-bases}\" >/dev/null || exit 0;;\n+\t\t\tgit rev-parse -q --verify \"refs/top-bases${head_#refs/heads}\" >/dev/null || exit 0;;\n \t\t*)\n \t\t\texit 0;;\n \tesac\n-- \n1.6.2\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\n"},{"id":"109507","messageId":"49CB4B12.3020408@pengutronix.de","threadId":"18533","inReplyTo":"20090326090009.GA7570@pengutronix.de","subject":"Re: [PATCH TopGit] hooks/pre-commit.sh: fix bashism","fromName":"Marc Kleine-Budde","fromEmail":"mkl@pengutronix.de","sentAt":"2009-03-26T09:29:54Z","receivedAt":"2009-03-26T09:29:54Z","isPatch":true,"sender":{"key":"mkl@pengutronix.de","avatar":null},"body":"Uwe Kleine-König wrote:\n> This was introduced in fcb488d51e72c7414f9beb40ad06bf529b8b38dc.\n> A similar fix was suggested by martin f krafft, too.\n\nWorks here on ubuntu bin /bin/sh is a link to /bin/dash\n\n> Reported-by: Bert Wesarg <bert.wesarg@googlemail.com>\n> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\nTested-by: Marc Kleine-Budde <mkl@pengutronix.de>\n\n> ---\n> Hello,\n> \n> this should fix the issue now.\n> \n> If I don't get negative feed back I will push this change later today.\n> I'm open for acks, too.\n> \n> Best regards and thanks\n> Uwe\n> \n>  hooks/pre-commit.sh |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/hooks/pre-commit.sh b/hooks/pre-commit.sh\n> index a12cfa6..9d677e9 100644\n> --- a/hooks/pre-commit.sh\n> +++ b/hooks/pre-commit.sh\n> @@ -20,7 +20,7 @@ tg_util\n>  if head_=$(git symbolic-ref -q HEAD); then\n>  \tcase \"$head_\" in\n>  \t\trefs/heads/*)\n> -\t\t\tgit rev-parse -q --verify \"${head_/#refs\\/heads/refs\\/top-bases}\" >/dev/null || exit 0;;\n> +\t\t\tgit rev-parse -q --verify \"refs/top-bases${head_#refs/heads}\" >/dev/null || exit 0;;\n>  \t\t*)\n>  \t\t\texit 0;;\n>  \tesac\n\nMarc\n\n-- \nPengutronix e.K.                         | Marc Kleine-Budde           |\nLinux Solutions for Science and Industry | Phone: +49-231-2826-924     |\nVertretung West/Dortmund                 | Fax:   +49-5121-206917-5555 |\nAmtsgericht Hildesheim, HRA 2686         | http://www.pengutronix.de   |\n\n"},{"id":"109533","messageId":"36ca99e90903260721l128efcbep1a45d7639733e49d@mail.gmail.com","threadId":"18533","inReplyTo":"49CB4B12.3020408@pengutronix.de","subject":"Re: [PATCH TopGit] hooks/pre-commit.sh: fix bashism","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2009-03-26T14:21:58Z","receivedAt":"2009-03-26T14:21:58Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"2009/3/26 Marc Kleine-Budde <mkl@pengutronix.de>:\n> Uwe Kleine-König wrote:\n>> This was introduced in fcb488d51e72c7414f9beb40ad06bf529b8b38dc.\n>> A similar fix was suggested by martin f krafft, too.\n>\n> Works here on ubuntu bin /bin/sh is a link to /bin/dash\n>\n>> Reported-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n> Tested-by: Marc Kleine-Budde <mkl@pengutronix.de>\nAcked-by: Bert Wesarg <bert.wesarg@googlemail.com>\nTested-by: Bert Wesarg <bert.wesarg@googlemail.com>\n\nThanks Uwe.\n\nBert\n"}]}