{"thread":{"id":"17535","subject":"[PATCH] filter-branch: really allow running in a bare repository","startedAt":"2009-02-03T18:10:10Z","lastAt":"2009-02-03T20:56:51Z","messageCount":4,"participants":["Johannes Schindelin","Eric Kidd"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"103005","messageId":"alpine.DEB.1.00.0902031910001.9822@pacific.mpi-cbg.de","threadId":"17535","inReplyTo":"cover.1233684552u.git.johannes.schindelin@gmx.de","subject":"[PATCH] filter-branch: really allow running in a bare repository","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-03T18:10:10Z","receivedAt":"2009-02-03T18:10:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"When checking if running in a bare repository, the work tree has to be\nreset, otherwise we will be checking the temporary state, which is\nalways non-bare.\n\nThis commit augments a4661b0(git-filter-branch.sh: Allow running in bare\nrepositories).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-filter-branch.sh |   24 ++++++++++++------------\n 1 files changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex eb62f71..8cbce4e 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -469,19 +469,19 @@ rm -rf \"$tempdir\"\n \n trap - 0\n \n+unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE\n+test -z \"$ORIG_GIT_DIR\" || {\n+\tGIT_DIR=\"$ORIG_GIT_DIR\" && export GIT_DIR\n+}\n+test -z \"$ORIG_GIT_WORK_TREE\" || {\n+\tGIT_WORK_TREE=\"$ORIG_GIT_WORK_TREE\" &&\n+\texport GIT_WORK_TREE\n+}\n+test -z \"$ORIG_GIT_INDEX_FILE\" || {\n+\tGIT_INDEX_FILE=\"$ORIG_GIT_INDEX_FILE\" &&\n+\texport GIT_INDEX_FILE\n+}\n if [ \"$(is_bare_repository)\" = false ]; then\n-\tunset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE\n-\ttest -z \"$ORIG_GIT_DIR\" || {\n-\t\tGIT_DIR=\"$ORIG_GIT_DIR\" && export GIT_DIR\n-\t}\n-\ttest -z \"$ORIG_GIT_WORK_TREE\" || {\n-\t\tGIT_WORK_TREE=\"$ORIG_GIT_WORK_TREE\" &&\n-\t\texport GIT_WORK_TREE\n-\t}\n-\ttest -z \"$ORIG_GIT_INDEX_FILE\" || {\n-\t\tGIT_INDEX_FILE=\"$ORIG_GIT_INDEX_FILE\" &&\n-\t\texport GIT_INDEX_FILE\n-\t}\n \tgit read-tree -u -m HEAD\n fi\n \n-- \n1.6.1.2.574.g140d5\n"},{"id":"103017","messageId":"431341160902031131s63f34665ne9db25d8a4d1f0f9@mail.gmail.com","threadId":"17535","inReplyTo":"alpine.DEB.1.00.0902031910001.9822@pacific.mpi-cbg.de","subject":"Re: [PATCH] filter-branch: really allow running in a bare repository","fromName":"Eric Kidd","fromEmail":"emk.lists@randomhacks.net","sentAt":"2009-02-03T19:31:32Z","receivedAt":"2009-02-03T19:31:32Z","isPatch":true,"sender":{"key":"emk.lists@randomhacks.net","avatar":null},"body":"On Tue, Feb 3, 2009 at 1:10 PM, Johannes Schindelin\n<johannes.schindelin@gmx.de> wrote:\n> When checking if running in a bare repository, the work tree has to be\n> reset, otherwise we will be checking the temporary state, which is\n> always non-bare.\n\nJust a few minutes after you posted this patch, I posted a\nnearly-identical fix for the same issue:\n\n  http://marc.info/?l=git&m=123368695831812&w=2\n\n(My patch includes a test case, too, but it's not very important.)\n\nThis raises another interesting question: Why doesn't 'git\nfilter-branch' actually check whether subcommands succeed?\n\nCheers,\nEric\n"},{"id":"103022","messageId":"alpine.DEB.1.00.0902032145250.9822@pacific.mpi-cbg.de","threadId":"17535","inReplyTo":"431341160902031131s63f34665ne9db25d8a4d1f0f9@mail.gmail.com","subject":"Re: [PATCH] filter-branch: really allow running in a bare repository","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-03T20:46:43Z","receivedAt":"2009-02-03T20:46:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 3 Feb 2009, Eric Kidd wrote:\n\n> On Tue, Feb 3, 2009 at 1:10 PM, Johannes Schindelin\n> <johannes.schindelin@gmx.de> wrote:\n> > When checking if running in a bare repository, the work tree has to be\n> > reset, otherwise we will be checking the temporary state, which is\n> > always non-bare.\n> \n> Just a few minutes after you posted this patch, I posted a\n> nearly-identical fix for the same issue:\n> \n>   http://marc.info/?l=git&m=123368695831812&w=2\n> \n> (My patch includes a test case, too, but it's not very important.)\n\nSo clearly yours is superior.\n\n> This raises another interesting question: Why doesn't 'git\n> filter-branch' actually check whether subcommands succeed?\n\nThat's unintentional; AFAIR there was a \"set -e\" in cg-admin-rewritehist \nthat I tried to do away with by introducing explicit '&&' conjunctions \nwhere needed.\n\nSo all those unchecked subcommands are bugs.\n\nThanks,\nDscho\n"},{"id":"103023","messageId":"431341160902031256k689bb0efo766b4a4f2e356d3d@mail.gmail.com","threadId":"17535","inReplyTo":"431341160902031131s63f34665ne9db25d8a4d1f0f9@mail.gmail.com","subject":"Re: [PATCH] filter-branch: really allow running in a bare repository","fromName":"Eric Kidd","fromEmail":"emk.lists@randomhacks.net","sentAt":"2009-02-03T20:56:51Z","receivedAt":"2009-02-03T20:56:51Z","isPatch":true,"sender":{"key":"emk.lists@randomhacks.net","avatar":null},"body":"On Tue, Feb 3, 2009 at 2:31 PM, Eric Kidd <emk.lists@randomhacks.net> wrote:\n> Just a few minutes after you posted this patch, I posted a\n> nearly-identical fix for the same issue:\n>\n>  http://marc.info/?l=git&m=123368695831812&w=2\n\nA point of clarification: These two bug fixes are independent, and I\nwas fighting with my mail queue when I saw Johannes' patch.\n\nCheers,\nEric\n"}]}