{"thread":{"id":"48620","subject":"[PATCH] t9104: kosherly remove remote refs","startedAt":"2018-06-01T05:09:03Z","lastAt":"2018-06-02T12:28:51Z","messageCount":4,"participants":["Christian Couder","Johannes Schindelin","Michael Haggerty","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"348970","messageId":"20180601050833.27676-1-chriscool@tuxfamily.org","threadId":"48620","inReplyTo":null,"subject":"[PATCH] t9104: kosherly remove remote refs","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2018-06-01T05:08:33Z","receivedAt":"2018-06-01T05:09:03Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"As there are plans to implement other ref storage systems,\nlet's use a way to remove remote refs that does not depend\non refs being files.\n\nThis makes it clear to readers that this test does not\ndepend on which ref backend is used.\n\nSuggested-by: Michael Haggerty <mhagger@alum.mit.edu>\nHelped-by: Jeff King <peff@peff.net>\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\nThis was suggested and discussed in:\n\nhttps://public-inbox.org/git/20180525085906.GA2948@sigill.intra.peff.net/\n\n t/t9104-git-svn-follow-parent.sh | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex 9c49b6c1fe..5e0ad19177 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -215,7 +215,9 @@ test_expect_success \"multi-fetch continues to work\" \"\n \t\"\n \n test_expect_success \"multi-fetch works off a 'clean' repository\" '\n-\trm -rf \"$GIT_DIR/svn\" \"$GIT_DIR/refs/remotes\" &&\n+\trm -rf \"$GIT_DIR/svn\" &&\n+\tgit for-each-ref --format=\"option no-deref%0adelete %(refname)\" refs/remotes |\n+\tgit update-ref --stdin &&\n \tgit reflog expire --all --expire=all &&\n \tmkdir \"$GIT_DIR/svn\" &&\n \tgit svn multi-fetch\n-- \n2.17.0.1035.g12039e008f\n\n"},{"id":"348998","messageId":"nycvar.QRO.7.76.6.1806011324530.77@tvgsbejvaqbjf.bet","threadId":"48620","inReplyTo":"20180601050833.27676-1-chriscool@tuxfamily.org","subject":"Re: [PATCH] t9104: kosherly remove remote refs","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-06-01T11:25:29Z","receivedAt":"2018-06-01T11:26:17Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Chris,\n\nOn Fri, 1 Jun 2018, Christian Couder wrote:\n\n> As there are plans to implement other ref storage systems,\n> let's use a way to remove remote refs that does not depend\n> on refs being files.\n> \n> This makes it clear to readers that this test does not\n> depend on which ref backend is used.\n> \n> Suggested-by: Michael Haggerty <mhagger@alum.mit.edu>\n> Helped-by: Jeff King <peff@peff.net>\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n> This was suggested and discussed in:\n> \n> https://public-inbox.org/git/20180525085906.GA2948@sigill.intra.peff.net/\n> \n>  t/t9104-git-svn-follow-parent.sh | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n> \n> diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\n> index 9c49b6c1fe..5e0ad19177 100755\n> --- a/t/t9104-git-svn-follow-parent.sh\n> +++ b/t/t9104-git-svn-follow-parent.sh\n> @@ -215,7 +215,9 @@ test_expect_success \"multi-fetch continues to work\" \"\n>  \t\"\n>  \n>  test_expect_success \"multi-fetch works off a 'clean' repository\" '\n> -\trm -rf \"$GIT_DIR/svn\" \"$GIT_DIR/refs/remotes\" &&\n> +\trm -rf \"$GIT_DIR/svn\" &&\n> +\tgit for-each-ref --format=\"option no-deref%0adelete %(refname)\" refs/remotes |\n> +\tgit update-ref --stdin &&\n\nApart from the line longer than our conventions allow, this looks fine to\nme!\n\n>  \tgit reflog expire --all --expire=all &&\n>  \tmkdir \"$GIT_DIR/svn\" &&\n>  \tgit svn multi-fetch\n> -- \n> 2.17.0.1035.g12039e008f\n\nPlease upgrade ;-)\n\nCiao,\nDscho\n"},{"id":"349077","messageId":"CAMy9T_Edbrd-90=Zrp_3bSyuT8GhEu9228_iiaGzwLwAVDn40w@mail.gmail.com","threadId":"48620","inReplyTo":"20180601050833.27676-1-chriscool@tuxfamily.org","subject":"Re: [PATCH] t9104: kosherly remove remote refs","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2018-06-02T09:43:44Z","receivedAt":"2018-06-02T09:43:52Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On Fri, Jun 1, 2018 at 7:08 AM, Christian Couder\n<christian.couder@gmail.com> wrote:\n> As there are plans to implement other ref storage systems,\n> let's use a way to remove remote refs that does not depend\n> on refs being files.\n>\n> This makes it clear to readers that this test does not\n> depend on which ref backend is used.\n>\n> Suggested-by: Michael Haggerty <mhagger@alum.mit.edu>\n> Helped-by: Jeff King <peff@peff.net>\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n> This was suggested and discussed in:\n>\n> https://public-inbox.org/git/20180525085906.GA2948@sigill.intra.peff.net/\n>\n>  t/t9104-git-svn-follow-parent.sh | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\n> index 9c49b6c1fe..5e0ad19177 100755\n> --- a/t/t9104-git-svn-follow-parent.sh\n> +++ b/t/t9104-git-svn-follow-parent.sh\n> @@ -215,7 +215,9 @@ test_expect_success \"multi-fetch continues to work\" \"\n>         \"\n>\n>  test_expect_success \"multi-fetch works off a 'clean' repository\" '\n> -       rm -rf \"$GIT_DIR/svn\" \"$GIT_DIR/refs/remotes\" &&\n> +       rm -rf \"$GIT_DIR/svn\" &&\n> +       git for-each-ref --format=\"option no-deref%0adelete %(refname)\" refs/remotes |\n> +       git update-ref --stdin &&\n>         git reflog expire --all --expire=all &&\n>         mkdir \"$GIT_DIR/svn\" &&\n>         git svn multi-fetch\n> --\n> 2.17.0.1035.g12039e008f\n\n+1 LGTM.\n\nMichael\n"},{"id":"349088","messageId":"CAM0VKj=YgNAb_-BfhBJNjYScfUCnU9Vp_Upy7jtyBisYXzg8Ng@mail.gmail.com","threadId":"48620","inReplyTo":"20180601050833.27676-1-chriscool@tuxfamily.org","subject":"Re: [PATCH] t9104: kosherly remove remote refs","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2018-06-02T12:28:46Z","receivedAt":"2018-06-02T12:28:51Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Fri, Jun 1, 2018 at 7:08 AM, Christian Couder\n<christian.couder@gmail.com> wrote:\n>  test_expect_success \"multi-fetch works off a 'clean' repository\" '\n> -       rm -rf \"$GIT_DIR/svn\" \"$GIT_DIR/refs/remotes\" &&\n> +       rm -rf \"$GIT_DIR/svn\" &&\n> +       git for-each-ref --format=\"option no-deref%0adelete %(refname)\" refs/remotes |\n> +       git update-ref --stdin &&\n\nIs that \"option no-deref\" really necessary when deleting refs?  Does\nit have any effect at all?\n\nThe synopsis in 'git update-ref's manpage indicates that '--no-deref'\nis only applicable when updating a ref, but not when deleting one;\nthough the usage shown by 'git update-ref -h' doesn't indicate this.\nAnyway, it appears that when deleting refs no symref dereferencing is\nperformed and '--no-deref' is simply ignored:\n\n  $ git branch one\n  $ git branch two\n  $ git symbolic-ref ONE refs/heads/one\n  $ git symbolic-ref TWO refs/heads/two\n  $ cat .git/{ONE,TWO}\n  ref: refs/heads/one\n  ref: refs/heads/two\n  $ git update-ref -d ONE\n  $ git update-ref --no-deref -d TWO\n  $ cat .git/{ONE,TWO}\n  cat: .git/ONE: No such file or directory\n  cat: .git/TWO: No such file or directory\n  $ git for-each-ref\n  95c5b8654fd75df13ed29f43cff52287414c3877 commit       refs/heads/master\n  95c5b8654fd75df13ed29f43cff52287414c3877 commit       refs/heads/one\n  95c5b8654fd75df13ed29f43cff52287414c3877 commit       refs/heads/two\n"}]}