{"thread":{"id":"10878","subject":"[PATCH v2] Bisect reset: remove bisect refs that may have been packed.","startedAt":"2007-11-15T07:18:07Z","lastAt":"2007-11-15T12:59:28Z","messageCount":18,"participants":["Christian Couder","Junio C Hamano","Johannes Sixt","Shawn O. Pearce","Jeff King","Miles Bader","Wincent Colaiuta","Andreas Ericsson","David Kastrup","Johannes Schindelin"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"59937","messageId":"20071115081807.06fe092b.chriscool@tuxfamily.org","threadId":"10878","inReplyTo":null,"subject":"[PATCH v2] Bisect reset: remove bisect refs that may have been packed.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-11-15T07:18:07Z","receivedAt":"2007-11-15T07:18:07Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"If refs were ever packed in the middle of bisection, the bisect\nrefs were not removed from the \"packed-refs\" file.\n\nThis patch fixes this problem by using \"git update-ref -d $ref $hash\"\nin \"bisect_clean_state\".\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-bisect.sh               |   11 ++++++++++-\n t/t6030-bisect-porcelain.sh |   12 ++++++++++++\n 2 files changed, 22 insertions(+), 1 deletions(-)\n\n\tOoops, there was a problem with the previous patch\n\tif \"git bisect reset\" was used when not bisecting.\n\n\tSorry.\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 1ed44e5..584906f 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -351,7 +351,16 @@ bisect_reset() {\n \n bisect_clean_state() {\n \trm -fr \"$GIT_DIR/refs/bisect\"\n-\trm -f \"$GIT_DIR/refs/heads/bisect\"\n+\n+\t# There may be some refs packed during bisection.\n+\tgit for-each-ref --format='%(refname) %(objectname)' \\\n+\t\t\"refs/bisect/*\" | while read ref hash\n+\tdo\n+\t\tgit update-ref -d $ref $hash\n+\tdone\n+\n+\thash=$(git show-ref --hash refs/heads/bisect)\n+\ttest -n \"$hash\" && git update-ref -d refs/heads/bisect $hash\n \trm -f \"$GIT_DIR/BISECT_LOG\"\n \trm -f \"$GIT_DIR/BISECT_NAMES\"\n \trm -f \"$GIT_DIR/BISECT_RUN\"\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 53956c0..f09db62 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -71,6 +71,18 @@ test_expect_success 'bisect start with one bad and good' '\n \tgit bisect next\n '\n \n+test_expect_success 'bisect reset removes packed refs' '\n+\tgit bisect reset &&\n+\tgit bisect start &&\n+\tgit bisect good $HASH1 &&\n+\tgit bisect bad $HASH3 &&\n+\tgit pack-refs --all --prune &&\n+\tgit bisect next &&\n+\tgit bisect reset &&\n+\ttest -z \"$(git for-each-ref \"refs/bisect/*\")\" &&\n+\ttest -z \"$(git for-each-ref \"refs/heads/bisect\")\"\n+'\n+\n # $HASH1 is good, $HASH4 is bad, we skip $HASH3\n # but $HASH2 is bad,\n # so we should find $HASH2 as the first bad commit\n-- \n1.5.3.5.722.g789fd-dirty\n"},{"id":"59947","messageId":"7vwssj6hw8.fsf@gitster.siamese.dyndns.org","threadId":"10878","inReplyTo":"20071115081807.06fe092b.chriscool@tuxfamily.org","subject":"Re: [PATCH v2] Bisect reset: remove bisect refs that may have been packed.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-15T08:18:47Z","receivedAt":"2007-11-15T08:18:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> If refs were ever packed in the middle of bisection, the bisect\n> refs were not removed from the \"packed-refs\" file.\n>\n> This patch fixes this problem by using \"git update-ref -d $ref $hash\"\n> in \"bisect_clean_state\".\n>\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n\nThanks.  Just a few nits.\n\nOn top of your patch...\n\n - You forgot to remove one \"removal of filesystem refs\";\n - for-each-ref takes more than one patterns.\n\n git-bisect.sh |    9 ++-------\n 1 files changed, 2 insertions(+), 7 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 584906f..21ed02f 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -350,17 +350,12 @@ bisect_reset() {\n }\n \n bisect_clean_state() {\n-\trm -fr \"$GIT_DIR/refs/bisect\"\n-\n \t# There may be some refs packed during bisection.\n-\tgit for-each-ref --format='%(refname) %(objectname)' \\\n-\t\t\"refs/bisect/*\" | while read ref hash\n+\tgit for-each-ref --format='%(refname) %(objectname)' refs/bisect/\\* refs/heads/bisect |\n+\twhile read ref hash\n \tdo\n \t\tgit update-ref -d $ref $hash\n \tdone\n-\n-\thash=$(git show-ref --hash refs/heads/bisect)\n-\ttest -n \"$hash\" && git update-ref -d refs/heads/bisect $hash\n \trm -f \"$GIT_DIR/BISECT_LOG\"\n \trm -f \"$GIT_DIR/BISECT_NAMES\"\n \trm -f \"$GIT_DIR/BISECT_RUN\"\n"},{"id":"59949","messageId":"473C02F9.4020402@viscovery.net","threadId":"10878","inReplyTo":"7vwssj6hw8.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH v2] Bisect reset: remove bisect refs that may have been packed.","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2007-11-15T08:27:37Z","receivedAt":"2007-11-15T08:27:37Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Junio C Hamano schrieb:\n> +\tgit for-each-ref --format='%(refname) %(objectname)' refs/bisect/\\* refs/heads/bisect |\n> +\twhile read ref hash\n\nIf you also swap %(refname) and %(objectname), then this is also not prone \nto whitespace in refnames. (Yes, I know, there shouldn't be such, but...)\n\n-- Hannes\n"},{"id":"59951","messageId":"7vsl376h5w.fsf@gitster.siamese.dyndns.org","threadId":"10878","inReplyTo":"7vwssj6hw8.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH v2] Bisect reset: remove bisect refs that may have been packed.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-15T08:34:35Z","receivedAt":"2007-11-15T08:34:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Christian Couder <chriscool@tuxfamily.org> writes:\n>\n>> If refs were ever packed in the middle of bisection, the bisect\n>> refs were not removed from the \"packed-refs\" file.\n>>\n>> This patch fixes this problem by using \"git update-ref -d $ref $hash\"\n>> in \"bisect_clean_state\".\n>>\n>> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n>\n> Thanks.  Just a few nits.\n>\n> On top of your patch...\n>\n>  - You forgot to remove one \"removal of filesystem refs\";\n\nOoops.  'test -d \"$GIT_DIR/refs/bisect\"' is used as a signal\nthat we are bisecting for the rest of the code, so we cannot\nlose that rm -fr there.\n\nI think a longer term clean-up would be not to treat \"bisect\" as\na reserved branch name but use detached HEAD while bisecting.\nBut that is a larger topic.\n"},{"id":"59953","messageId":"20071115084934.GN14735@spearce.org","threadId":"10878","inReplyTo":"473C02F9.4020402@viscovery.net","subject":"Re: [PATCH v2] Bisect reset: remove bisect refs that may have been packed.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-11-15T08:49:34Z","receivedAt":"2007-11-15T08:49:34Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Junio C Hamano schrieb:\n> >+\tgit for-each-ref --format='%(refname) %(objectname)' refs/bisect/\\* \n> >refs/heads/bisect |\n> >+\twhile read ref hash\n> \n> If you also swap %(refname) and %(objectname), then this is also not prone \n> to whitespace in refnames. (Yes, I know, there shouldn't be such, but...)\n\nWhat's this obsession with whitespace in refnames?  Twice in like\ntwo days people are talking about whitespace in refnames.\n\nWHITESPACE IS NOT PERMITTED IN REFNAMES.\n\nDo we need to apply the following patch, to keep people from creating\nrefs by hand with whitespace in them?  Is this really that common?\n\n\tgit rev-parse HEAD >'.git/refs/heads/..i have spaces hah!'\n\n\ndiff --git a/refs.c b/refs.c\nindex aff02cd..b95bf83 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -246,6 +246,7 @@ static struct ref_list *get_ref_dir(const char *base, struct ref_list *list)\n \t\t\tstruct stat st;\n \t\t\tint flag;\n \t\t\tint namelen;\n+\t\t\tint check;\n \n \t\t\tif (de->d_name[0] == '.')\n \t\t\t\tcontinue;\n@@ -261,6 +262,9 @@ static struct ref_list *get_ref_dir(const char *base, struct ref_list *list)\n \t\t\t\tlist = get_ref_dir(ref, list);\n \t\t\t\tcontinue;\n \t\t\t}\n+\t\t\tcheck = check_ref_format(ref);\n+\t\t\tif (check != 0 && check != -2)\n+\t\t\t\tcontinue;\n \t\t\tif (!resolve_ref(ref, sha1, 1, &flag)) {\n \t\t\t\terror(\"%s points nowhere!\", ref);\n \t\t\t\tcontinue;\n\n-- \nShawn.\n"},{"id":"59955","messageId":"20071115085259.GA30913@sigill.intra.peff.net","threadId":"10878","inReplyTo":"20071115084934.GN14735@spearce.org","subject":"Re: [PATCH v2] Bisect reset: remove bisect refs that may have been packed.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-11-15T08:52:59Z","receivedAt":"2007-11-15T08:52:59Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Nov 15, 2007 at 03:49:34AM -0500, Shawn O. Pearce wrote:\n\n> What's this obsession with whitespace in refnames?  Twice in like\n> two days people are talking about whitespace in refnames.\n\nI even had Junio convinced at one point!\n\nI am not actually creating such refs, but I think my brain was still\nfried from the URL encoding discussion, and I was overly paranoid about\nspaces.\n\n-Peff\n"},{"id":"59956","messageId":"7voddv6fxz.fsf@gitster.siamese.dyndns.org","threadId":"10878","inReplyTo":"20071115081807.06fe092b.chriscool@tuxfamily.org","subject":"[PATCH 1/3] git-bisect: war on \"sed\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-15T09:00:56Z","receivedAt":"2007-11-15T09:00:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"We do not need to pipe \"echo\" to \"sed\" only to strip refs/heads/\nfrom the beginning.  We are assuming not-so-ancient shells these\ndays.\n\nAlso there is no need to avoid assuming \\012 is the LF; we do\nnot run on EBCDIC, sorry.  Other parts of the script already\nuses tr to convert separator to LF that way.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-bisect.sh |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 46a7b8d..3a21033 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -71,7 +71,7 @@ bisect_start() {\n \t\t;;\n \trefs/heads/*)\n \t\t[ -s \"$GIT_DIR/head-name\" ] && die \"won't bisect on seeked tree\"\n-\t\techo \"$head\" | sed 's#^refs/heads/##' >\"$GIT_DIR/head-name\"\n+\t\techo \"${head#refs/heads/}\" >\"$GIT_DIR/head-name\"\n \t\t;;\n \t*)\n \t\tdie \"Bad HEAD - strange symbolic ref\"\n@@ -275,8 +275,7 @@ exit_if_skipped_commits () {\n \tif expr \"$_tried\" : \".*[|].*\" > /dev/null ; then\n \t\techo \"There are only 'skip'ped commit left to test.\"\n \t\techo \"The first bad commit could be any of:\"\n-\t\techo \"$_tried\" | sed -e 's/[|]/\\\n-/g'\n+\t\techo \"$_tried\" | tr '[|]' '[\\012]'\n \t\techo \"We cannot bisect more!\"\n \t\texit 2\n \tfi\n-- \n1.5.3.5.1780.gca2b\n"},{"id":"59957","messageId":"7vk5oj6fx2.fsf@gitster.siamese.dyndns.org","threadId":"10878","inReplyTo":"20071115081807.06fe092b.chriscool@tuxfamily.org","subject":"[PATCH 2/3] git-bisect: use update-ref to mark good/bad commits","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-15T09:01:29Z","receivedAt":"2007-11-15T09:01:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This removes the last instance of making a ref by hand with\n\"echo SHA1 >.git/refs/$refname\" from the script and replaces it\nwith update-ref.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-bisect.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 3a21033..4b74a7b 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -130,7 +130,7 @@ bisect_write() {\n \t\tgood|skip)\ttag=\"$state\"-\"$rev\" ;;\n \t\t*)\t\tdie \"Bad bisect_write argument: $state\" ;;\n \tesac\n-\techo \"$rev\" >\"$GIT_DIR/refs/bisect/$tag\"\n+\tgit update-ref \"refs/bisect/$tag\" \"$rev\"\n \techo \"# $state: \"$(git show-branch $rev) >>\"$GIT_DIR/BISECT_LOG\"\n \ttest -z \"$nolog\" && echo \"git-bisect $state $rev\" >>\"$GIT_DIR/BISECT_LOG\"\n }\n-- \n1.5.3.5.1780.gca2b\n"},{"id":"59958","messageId":"7vfxz76fwf.fsf@gitster.siamese.dyndns.org","threadId":"10878","inReplyTo":"20071115081807.06fe092b.chriscool@tuxfamily.org","subject":"[PATCH 3/3] git-bisect: modernize branch shuffling hack","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-15T09:01:52Z","receivedAt":"2007-11-15T09:01:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When switching to a new rev, we first made \"new-bisect\" branch to\npoint at the chosen commit, attempt to switch to it, and then\nfinally renamed the new-bisect branch to bisect by hand when\nsuccessful.  This is so that we can catch checkout failure (your\nlocal modification may interfere with switching to the chosen\nversion) without losing information on which commit the next\nattempt should be made.\n\nRewrite it using a more modern form but without breaking the\nsafety.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-bisect.sh |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 4b74a7b..dae8a8e 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -316,10 +316,9 @@ bisect_next() {\n \texit_if_skipped_commits \"$bisect_rev\"\n \n \techo \"Bisecting: $bisect_nr revisions left to test after this\"\n-\techo \"$bisect_rev\" >\"$GIT_DIR/refs/heads/new-bisect\"\n+\tgit branch -f new-bisect \"$bisect_rev\"\n \tgit checkout -q new-bisect || exit\n-\tmv \"$GIT_DIR/refs/heads/new-bisect\" \"$GIT_DIR/refs/heads/bisect\" &&\n-\tGIT_DIR=\"$GIT_DIR\" git symbolic-ref HEAD refs/heads/bisect\n+\tgit branch -M new-bisect bisect\n \tgit show-branch \"$bisect_rev\"\n }\n \n-- \n1.5.3.5.1780.gca2b\n"},{"id":"59961","messageId":"buozlxfeu0z.fsf@dhapc248.dev.necel.com","threadId":"10878","inReplyTo":"7voddv6fxz.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 1/3] git-bisect: war on \"sed\"","fromName":"Miles Bader","fromEmail":"miles.bader@necel.com","sentAt":"2007-11-15T09:29:32Z","receivedAt":"2007-11-15T09:29:32Z","isPatch":true,"sender":{"key":"miles.bader@necel.com","avatar":"https://gravatar.com/avatar/be062d4050eb88e04229cbdb60f803e1bd647923a015996c2439e76f23e336a7?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n> We do not need to pipe \"echo\" to \"sed\" only to strip refs/heads/\n> from the beginning.  We are assuming not-so-ancient shells these\n> days.\n\nWhat's wrong with sed?\n\n-Miles\n\n-- \n[|nurgle|]  ddt- demonic? so quake will have an evil kinda setting? one that\n            will  make every christian in the world foamm at the mouth?\n[iddt]      nurg, that's the goal\n"},{"id":"59962","messageId":"995F69D5-4ABC-44E7-BA2B-5E276479EDA1@wincent.com","threadId":"10878","inReplyTo":"buozlxfeu0z.fsf@dhapc248.dev.necel.com","subject":"Re: [PATCH 1/3] git-bisect: war on \"sed\"","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-11-15T09:36:02Z","receivedAt":"2007-11-15T09:36:02Z","isPatch":true,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 15/11/2007, a las 10:29, Miles Bader escribió:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>> We do not need to pipe \"echo\" to \"sed\" only to strip refs/heads/\n>> from the beginning.  We are assuming not-so-ancient shells these\n>> days.\n>\n> What's wrong with sed?\n\nNothing, but using it means forking a new process unnecessarily, and  \nthe shorter form without sed is arguably more readable:\n\n-\t\techo \"$head\" | sed 's#^refs/heads/##' >\"$GIT_DIR/head-name\"\n+\t\techo \"${head#refs/heads/}\" >\"$GIT_DIR/head-name\"\n\nCheers,\nWincent\n"},{"id":"59964","messageId":"buotznnesw9.fsf@dhapc248.dev.necel.com","threadId":"10878","inReplyTo":"995F69D5-4ABC-44E7-BA2B-5E276479EDA1@wincent.com","subject":"Re: [PATCH 1/3] git-bisect: war on \"sed\"","fromName":"Miles Bader","fromEmail":"miles.bader@necel.com","sentAt":"2007-11-15T09:53:58Z","receivedAt":"2007-11-15T09:53:58Z","isPatch":true,"sender":{"key":"miles.bader@necel.com","avatar":"https://gravatar.com/avatar/be062d4050eb88e04229cbdb60f803e1bd647923a015996c2439e76f23e336a7?d=mp&s=160"},"body":"Wincent Colaiuta <win@wincent.com> writes:\n> the shorter form without sed is arguably more readable:\n>\n> -\t\techo \"$head\" | sed 's#^refs/heads/##' >\"$GIT_DIR/head-name\"\n> +\t\techo \"${head#refs/heads/}\" >\"$GIT_DIR/head-name\"\n\nEr, I suppose -- if you are acquainted with that particular shell\nvariable syntax (I suspect knowledge of sed is far more widespread).\n\n[personally, I know that syntax has something to do with replacing\nsomething with something else, but really haven't much clue other than\nthat, and I always _thought_ it was bash-specific and so avoided using\nany of that stuff.]\n\n-miles\n-- \nPeople who are more than casually interested in computers should have at\nleast some idea of what the underlying hardware is like.  Otherwise the\nprograms they write will be pretty weird.  -- Donald Knuth\n"},{"id":"59965","messageId":"473C1A29.2010703@op5.se","threadId":"10878","inReplyTo":"buotznnesw9.fsf@dhapc248.dev.necel.com","subject":"Re: [PATCH 1/3] git-bisect: war on \"sed\"","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-11-15T10:06:33Z","receivedAt":"2007-11-15T10:06:33Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Miles Bader wrote:\n> Wincent Colaiuta <win@wincent.com> writes:\n>> the shorter form without sed is arguably more readable:\n>>\n>> -\t\techo \"$head\" | sed 's#^refs/heads/##' >\"$GIT_DIR/head-name\"\n>> +\t\techo \"${head#refs/heads/}\" >\"$GIT_DIR/head-name\"\n> \n> Er, I suppose -- if you are acquainted with that particular shell\n> variable syntax (I suspect knowledge of sed is far more widespread).\n> \n> [personally, I know that syntax has something to do with replacing\n> something with something else, but really haven't much clue other than\n> that, and I always _thought_ it was bash-specific and so avoided using\n> any of that stuff.]\n> \n\nIt says \"remove refs/heads/ from the beginning of the string pointed to\nby $head\".\n\nIt's not a bashism. Some extensions to that syntax are though (I think).\nIf you want to be sure of portability, use sed instead. git uses this\nsyntax often enough that it's worth using everywhere, but usually only\nin porcelain commands which one can relatively safely assume are run on\nat least decently up-to-date developer workstations.\n\nYou'll note that stuff that absolutely *has* to reside server-side are\nentirely in C.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"59967","messageId":"86hcjn4xy7.fsf@lola.quinscape.zz","threadId":"10878","inReplyTo":"473C1A29.2010703@op5.se","subject":"Re: [PATCH 1/3] git-bisect: war on \"sed\"","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-11-15T10:14:56Z","receivedAt":"2007-11-15T10:14:56Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Andreas Ericsson <ae@op5.se> writes:\n\n>> Wincent Colaiuta <win@wincent.com> writes:\n>>> +\t\techo \"${head#refs/heads/}\" >\"$GIT_DIR/head-name\"\n>\n> It says \"remove refs/heads/ from the beginning of the string pointed\n> to by $head\".\n>\n> It's not a bashism. Some extensions to that syntax are though (I\n> think).\n\nGeneral replace anywhere.\n\n> If you want to be sure of portability, use sed instead.\n\nGuffaw.\n\n> git uses this syntax often enough that it's worth using everywhere,\n> but usually only in porcelain commands which one can relatively\n> safely assume are run on at least decently up-to-date developer\n> workstations.\n\nHuh?  It is used throughout.  That's why \"make install\" will install\nxxx.sh scripts as xxx after possibly replacing the initial #!/bin/sh\nline with a shell known to be reasonably conformant on a particular\nsystem.\n\n-- \nDavid Kastrup\n"},{"id":"59969","messageId":"fc339e4a0711150300n64b9d670o1e183553a9de0cba@mail.gmail.com","threadId":"10878","inReplyTo":"86tznn4y7v.fsf@lola.quinscape.zz","subject":"Re: [PATCH 1/3] git-bisect: war on \"sed\"","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2007-11-15T11:00:14Z","receivedAt":"2007-11-15T11:00:14Z","isPatch":true,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"On Nov 15, 2007 7:09 PM, David Kastrup <dak@gnu.org> wrote:\n> > Er, I suppose -- if you are acquainted with that particular shell\n> > variable syntax (I suspect knowledge of sed is far more widespread).\n>\n> sed is rather bad with regard to portability.  If you take a look at\n> the respective portability section in the autoconf file, it is almost\n> longer than that of Bourne shells.\n\nI don't think that's really a fair characterization -- almost all of\nthe autoconf sed portability caveats concern weird corner cases in the\ndusty corners of the language (and some are \"common\" issues with other\ntools, i.e., avoiding ^ and $ inside of regexp groups).\n\nFor typical straightforward usage, there seems little problem.\n\n[The main portability problems I've actually _noticed_ with sed are\nthe \"-e\" versus \";\" issue and what happens with \"\\n\" in various\ncontexts...]\n\n-Miles\n\n-- \nDo not taunt Happy Fun Ball.\n"},{"id":"59971","messageId":"861war4uzp.fsf@lola.quinscape.zz","threadId":"10878","inReplyTo":"fc339e4a0711150300n64b9d670o1e183553a9de0cba@mail.gmail.com","subject":"Re: [PATCH 1/3] git-bisect: war on \"sed\"","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-11-15T11:18:50Z","receivedAt":"2007-11-15T11:18:50Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"\"Miles Bader\" <miles@gnu.org> writes:\n\n> On Nov 15, 2007 7:09 PM, David Kastrup <dak@gnu.org> wrote:\n>> > Er, I suppose -- if you are acquainted with that particular shell\n>> > variable syntax (I suspect knowledge of sed is far more widespread).\n>>\n>> sed is rather bad with regard to portability.  If you take a look at\n>> the respective portability section in the autoconf file, it is almost\n>> longer than that of Bourne shells.\n>\n> I don't think that's really a fair characterization -- almost all of\n> the autoconf sed portability caveats concern weird corner cases in the\n> dusty corners of the language (and some are \"common\" issues with other\n> tools, i.e., avoiding ^ and $ inside of regexp groups).\n>\n> For typical straightforward usage, there seems little problem.\n>\n> [The main portability problems I've actually _noticed_ with sed are\n> the \"-e\" versus \";\" issue and what happens with \"\\n\" in various\n> contexts...]\n\nWhat about character classes containing the pattern delimiter, \\+, \\?,\n\\|, nested grouping, anchors in groups, * after groups?  That's all\nrather straightforward usage.\n\n-- \nDavid Kastrup\n"},{"id":"59975","messageId":"Pine.LNX.4.64.0711151306470.16728@wbgn129.biozentrum.uni-wuerzburg.de","threadId":"10878","inReplyTo":"20071115085259.GA30913@sigill.intra.peff.net","subject":"Re: [PATCH v2] Bisect reset: remove bisect refs that may have been packed.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-15T12:10:26Z","receivedAt":"2007-11-15T12:10:26Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 15 Nov 2007, Jeff King wrote:\n\n> On Thu, Nov 15, 2007 at 03:49:34AM -0500, Shawn O. Pearce wrote:\n> \n> > What's this obsession with whitespace in refnames?  Twice in like\n> > two days people are talking about whitespace in refnames.\n> \n> I even had Junio convinced at one point!\n> \n> I am not actually creating such refs, but I think my brain was still \n> fried from the URL encoding discussion, and I was overly paranoid about \n> spaces.\n\nYeah, I'm really sorry I started that.  It was meant to do good, but did \nbad.  Oh, well.  The road to hell is paved with good intentions.\n\nCiao,\nDscho\n"},{"id":"59979","messageId":"buooddvekb3.fsf@dhapc248.dev.necel.com","threadId":"10878","inReplyTo":"861war4uzp.fsf@lola.quinscape.zz","subject":"Re: [PATCH 1/3] git-bisect: war on \"sed\"","fromName":"Miles Bader","fromEmail":"miles.bader@necel.com","sentAt":"2007-11-15T12:59:28Z","receivedAt":"2007-11-15T12:59:28Z","isPatch":true,"sender":{"key":"miles.bader@necel.com","avatar":"https://gravatar.com/avatar/be062d4050eb88e04229cbdb60f803e1bd647923a015996c2439e76f23e336a7?d=mp&s=160"},"body":"David Kastrup <dak@gnu.org> writes:\n>> For typical straightforward usage, there seems little problem.\n>>\n>> [The main portability problems I've actually _noticed_ with sed are\n>> the \"-e\" versus \";\" issue and what happens with \"\\n\" in various\n>> contexts...]\n>\n> What about character classes containing the pattern delimiter, \\+, \\?,\n> \\|, nested grouping, anchors in groups, * after groups?  That's all\n> rather straightforward usage.\n\nYou're right that the regexp stuff is not really \"dusty corners\", but\nnone of those affect typical sed usage I think -- most sed usage being\nreally rather simple (and the old \"regexps differ between traditional\nunix tools\" issue tends to dampen enthusiasm for really complex regexps\nwith those tools).\n\nI looked over the various random uses of sed I have locally (a couple of\nhundred instances), and the only thing which would potentially affect\nany of them would be the SVR3 thing about no nested groups (does anybody\nactually care about SVR3 though?!?).\n\n-Miles\n\n-- \nYo mama's so fat when she gets on an elevator it HAS to go down.\n"}]}