)]}'
{"id":"openstack%2Foslo.tools~669709","triplet_id":"openstack%2Foslo.tools~master~I3a21fd0841f093495cf4727a9f5633a6f80c1690","project":"openstack/oslo.tools","branch":"master","hashtags":[],"change_id":"I3a21fd0841f093495cf4727a9f5633a6f80c1690","subject":"filter_git_history.sh passes broken parent-filter to git filter-branch","status":"MERGED","created":"2019-07-08 16:24:00.000000000","updated":"2019-07-16 14:27:06.000000000","submitted":"2019-07-16 14:27:06.000000000","submitter":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"total_comment_count":4,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"669709-1563287226632-42ebc4e7","meta_rev_id":"45ab089f3493bc04c588409cb23c3c7efb199467","_number":669709,"virtual_id_number":669709,"owner":{"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"all":[{"value":0,"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},{"value":0,"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},{"value":0,"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},{"value":0,"_account_id":17130,"name":"melissaml","email":"ma.lei@99cloud.net","username":"malei"},{"value":2,"date":"2019-07-16 14:27:06.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-2":"Fails","-1":"Doesn\u0027t seem to work"," 0":"No score","+1":"Works for me","+2":"Verified"},"description":"","default_value":0,"optional":true},"Code-Review":{"approved":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"all":[{"value":2,"date":"2019-07-12 15:30:31.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},{"value":2,"date":"2019-07-16 14:26:54.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},{"value":0,"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},{"value":1,"date":"2019-07-14 17:39:54.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":17130,"name":"melissaml","email":"ma.lei@99cloud.net","username":"malei"},{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-2":"Do not merge","-1":"This patch needs further work before it can be merged"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me (core reviewer)"},"description":"","default_value":0,"optional":true},"Workflow":{"approved":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"all":[{"value":0,"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},{"value":1,"date":"2019-07-16 14:26:54.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},{"value":0,"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},{"value":0,"_account_id":17130,"name":"melissaml","email":"ma.lei@99cloud.net","username":"malei"},{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-1":"Work in progress"," 0":"Ready for reviews","+1":"Approved"},"description":"","default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},{"_account_id":17130,"name":"melissaml","email":"ma.lei@99cloud.net","username":"malei"},{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2019-07-12 15:30:31.000000000","updated_by":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"reviewer":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"state":"REVIEWER"},{"updated":"2019-07-14 17:39:54.000000000","updated_by":{"_account_id":17130,"name":"melissaml","email":"ma.lei@99cloud.net","username":"malei"},"reviewer":{"_account_id":17130,"name":"melissaml","email":"ma.lei@99cloud.net","username":"malei"},"state":"REVIEWER"},{"updated":"2019-07-16 14:26:54.000000000","updated_by":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"reviewer":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"state":"REVIEWER"},{"updated":"2019-07-16 14:27:06.000000000","updated_by":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"reviewer":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"state":"REVIEWER"}],"messages":[{"id":"1c20b7c93ba2a6c078d89cb48e40d323ae7795cb","author":{"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},"date":"2019-07-08 16:24:00.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"fb7330fc2bb53d1c545aa506bbab8b6ce778774d","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-07-08 16:24:12.000000000","message":"Patch Set 1: Verified+1\n\nBuild succeeded (check pipeline).\n\n- noop noop : SUCCESS in 0s","accounts_in_message":[],"_revision_number":1},{"id":"b26fcf8a05034ab56dd67a971de11ba296752a3a","author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"date":"2019-07-10 14:41:31.000000000","message":"Patch Set 1: Code-Review-1\n\n(2 comments)\n\nHello,\n\nFirst thanks for your changes.\n\nHow we can test it?\n\nAlso I\u0027ve some requested changes and questions inline:","accounts_in_message":[],"_revision_number":1},{"id":"9658d587fe7d8d133f48589136edc465fc6c797b","author":{"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},"date":"2019-07-12 14:53:02.000000000","message":"Uploaded patch set 2: Commit message was updated.","accounts_in_message":[],"_revision_number":2},{"id":"2493fa85c07c63bdb652ed0e79a5f05e243ac9b8","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-07-12 14:53:14.000000000","message":"Patch Set 2: Verified+1\n\nBuild succeeded (check pipeline).\n\n- noop noop : SUCCESS in 0s","accounts_in_message":[],"_revision_number":2},{"id":"590f8899941b784c8f503b6cfa0d5e4262fb1deb","author":{"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},"date":"2019-07-12 14:57:28.000000000","message":"Uploaded patch set 3: Commit message was updated.","accounts_in_message":[],"_revision_number":3},{"id":"00ff889ce3062b2de740fb893d1bd7ac38dceb6e","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-07-12 14:57:39.000000000","message":"Patch Set 3: Verified+1\n\nBuild succeeded (check pipeline).\n\n- noop noop : SUCCESS in 0s","accounts_in_message":[],"_revision_number":3},{"id":"62cda6db6c47e2581ba593ae1e6ee800a6441281","author":{"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},"date":"2019-07-12 14:59:40.000000000","message":"Patch Set 1:\n\n(2 comments)\n\nI\u0027ve tried to improve the problem description.\n\nMy test was to pass multiple valid directories into \nfilter_git_history.sh\n\nfilter_git_history.sh \u003cdir1\u003e \u003cdir2\u003e","accounts_in_message":[],"_revision_number":1},{"id":"a32c5b755c4865307d30c2c94ed76ef2fa67d4aa","author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"date":"2019-07-12 15:30:31.000000000","message":"Patch Set 3: Code-Review+2\n\nI confirmed that you can\u0027t break an if statement up over multiple lines, at least not without appending a \\ before the newlines, so this looks like the correct fix to me.\n\nNote that Oslo isn\u0027t really using this script anymore. It was written to automate our graduation of modules from the incubator, and since that work is completed we don\u0027t have any use for it.","accounts_in_message":[],"_revision_number":3},{"id":"098161e0cfbd71d3d31c10e9234479ddd376bbdb","author":{"_account_id":17130,"name":"melissaml","email":"ma.lei@99cloud.net","username":"malei"},"date":"2019-07-14 17:39:54.000000000","message":"Patch Set 3: Code-Review+1","accounts_in_message":[],"_revision_number":3},{"id":"6741df21b08a9fd1a0f08c4bff8f1b086b6afd6a","author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"date":"2019-07-16 14:26:54.000000000","message":"Patch Set 3: Code-Review+2 Workflow+1\n\nLGTM, if this kind of script isn\u0027t in use we need to remove them to avoid to spend time on it.\nI\u0027ll take a look on scripts like this to remove them.","accounts_in_message":[],"_revision_number":3},{"id":"f6845631d65487f87d013720c3220b0cd1a1716d","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-07-16 14:27:05.000000000","message":"Patch Set 3: -Verified\n\nStarting gate jobs.","accounts_in_message":[],"_revision_number":3},{"id":"fe39e0bf2de803035806a7395eb57ad48332ab46","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-07-16 14:27:06.000000000","message":"Patch Set 3: Verified+2\n\nBuild succeeded (gate pipeline).\n\n- noop noop : SUCCESS in 0s","accounts_in_message":[],"_revision_number":3},{"id":"45ab089f3493bc04c588409cb23c3c7efb199467","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-07-16 14:27:06.000000000","message":"Change has been successfully merged by Zuul","accounts_in_message":[],"_revision_number":3}],"current_revision_number":3,"current_revision":"6b06d7d7e1fdd84964eb9ada0064bc6744467673","revisions":{"29f5e6bf3cf2d0f34f9ea26d76e04f04cf46dbd7":{"kind":"REWORK","_number":1,"created":"2019-07-08 16:24:00.000000000","uploader":{"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},"ref":"refs/changes/09/669709/1","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/oslo.tools","ref":"refs/changes/09/669709/1","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/1"}}},"commit":{"parents":[{"commit":"bcc255ccf37bb879379d525a4b3f224121972daa","subject":"Remove ping_me script","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/oslo.tools/commit/bcc255ccf37bb879379d525a4b3f224121972daa"}]}],"author":{"name":"Scott Little","email":"scott.little@windriver.com","date":"2019-07-08 16:06:16.000000000","tz":-240},"committer":{"name":"Scott Little","email":"scott.little@windriver.com","date":"2019-07-08 16:06:35.000000000","tz":-240},"subject":"filter_git_history.sh passes broken parent-filter to git filter-branch","message":"filter_git_history.sh passes broken parent-filter to git filter-branch\n\nProblem:\n    filter_git_history.sh sometimes passes a bad arguement to\ngit filter-branch.  e.g.\n\ngit filter-branch ... --parent-filter \u0027\u003cbad arg\u003e\u0027 ...\n\nresulting in logs ....\n\nRewrite 1a32385367efab7a2bccf63981993b322e0d4b4c (1/866)/usr/lib/git-core/git-filter-branch: line 340: [: missing `]\u0027\n/usr/lib/git-core/git-filter-branch: line 341: -o: command not found\nRewrite 3cd12006bb6e7c9157f6b0f82a10d0c8cd63e334 (2/866)/usr/lib/git-core/git-filter-branch: line 340: [: missing `]\u0027\n/usr/lib/git-core/git-filter-branch: line 341: -o: command not found\n\nThe issue appears to be carriage returns in variable \u0027set_roots\u0027.\nSpecifically the expresion within the \u0027[\u0027 \u0027]\u0027 pair seems to be incompatable with\ncarriage returns.\n\ne.g.\n\n+ set_roots\u003d\u0027\nif [ 1 -eq 0  -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u00271232ac58be82479ddf1af7f7eb335103cb883356\u0027\\\u0027\u0027\n -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u0027ffe029ef99c501a0076ad6106a364bbb9c0d80ea\u0027\\\u0027\u0027  ]; then\n    echo \u0027\\\u0027\u0027\u0027\\\u0027\u0027;\nelse\n    cat;\nfi\u0027\n\nSolution\n   Use \u0027echo -n\u0027 rather than \u0027echo\u0027 when constructing \u0027set_roots\u0027.\n\nChange-Id: I3a21fd0841f093495cf4727a9f5633a6f80c1690\nSigned-off-by: Scott Little \u003cscott.little@windriver.com\u003e\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/oslo.tools/commit/29f5e6bf3cf2d0f34f9ea26d76e04f04cf46dbd7"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/oslo.tools/commit/29f5e6bf3cf2d0f34f9ea26d76e04f04cf46dbd7"}]},"branch":"refs/heads/master"},"2c2744722bfa6b25c3d51ba14f1473980075a128":{"kind":"NO_CODE_CHANGE","_number":2,"created":"2019-07-12 14:53:02.000000000","uploader":{"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},"ref":"refs/changes/09/669709/2","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/oslo.tools","ref":"refs/changes/09/669709/2","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/2"}}},"commit":{"parents":[{"commit":"bcc255ccf37bb879379d525a4b3f224121972daa","subject":"Remove ping_me script","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/oslo.tools/commit/bcc255ccf37bb879379d525a4b3f224121972daa"}]}],"author":{"name":"Scott Little","email":"scott.little@windriver.com","date":"2019-07-08 16:06:16.000000000","tz":-240},"committer":{"name":"Scott Little","email":"scott.little@windriver.com","date":"2019-07-12 14:47:28.000000000","tz":-240},"subject":"filter_git_history.sh passes broken parent-filter to git filter-branch","message":"filter_git_history.sh passes broken parent-filter to git filter-branch\n\nProblem:\n    filter_git_history.sh sometimes passes a bad arguement to\ngit filter-branch.  e.g.\n\ngit filter-branch ... --parent-filter \u0027\u003cbad arg\u003e\u0027 ...\n\nresulting in logs ....\n\nRewrite 1a32385367efab7a2bccf63981993b322e0d4b4c (1/866)/usr/lib/git-core/git-filter-branch: line 340: [: missing `]\u0027\n/usr/lib/git-core/git-filter-branch: line 341: -o: command not found\nRewrite 3cd12006bb6e7c9157f6b0f82a10d0c8cd63e334 (2/866)/usr/lib/git-core/git-filter-branch: line 340: [: missing `]\u0027\n/usr/lib/git-core/git-filter-branch: line 341: -o: command not found\n\nThe issue appears to be carriage returns in variable \u0027set_roots\u0027.\nSpecifically the expresion within the \u0027[\u0027 \u0027]\u0027 pair seems to be incompatible with\ncarriage returns.\n\ne.g. If I run with bash debugging turned on, I see the for loop at\nline 45 iterated twice.  Note that there is a carriage return prior\nto the second -o clause.\n\n+ set_roots\u003d\u0027\nif [ 1 -eq 0  -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u00271232ac58be82479ddf1af7f7eb335103cb883356\u0027\\\u0027\u0027\n -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u0027ffe029ef99c501a0076ad6106a364bbb9c0d80ea\u0027\\\u0027\u0027  ]; then\n    echo \u0027\\\u0027\u0027\u0027\\\u0027\u0027;\nelse\n    cat;\nfi\u0027\n\nMy theory is that within git-filter-branch, bash is being invoked twice.\n\nFirst call:\n    if [ 1 -eq 0  -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u00271232ac58be82479ddf1af7f7eb335103cb883356\u0027\\\u0027\u0027\nresulting in:\n    git-filter-branch: line 340: [: missing `]\u0027\n\nSecond call:\n     -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u0027ffe029ef99c501a0076ad6106a364bbb9c0d80ea\u0027\\\u0027\u0027  ]; then\n        echo \u0027\\\u0027\u0027\u0027\\\u0027\u0027;\n    else\n        cat;\n    fi\n\nresulting in:\n   git-filter-branch: line 341: -o: command not found\n\nOther details:\n   bash 4.3-7ubuntu1.7\n   git  1:1.9.1-1ubuntu0.10\n\nSolution\n   Use \u0027echo -n\u0027 rather than \u0027echo\u0027 when constructing \u0027set_roots\u0027.\n\nWhich results in ...\n\n+ set_roots\u003d\u0027\nif [ 1 -eq 0  -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u00271232ac58be82479ddf1af7f7eb335103cb883356\u0027\\\u0027\u0027 -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u0027ffe029ef99c501a0076ad6106a364bbb9c0d80ea\u0027\\\u0027\u0027  ]; then\n    echo \u0027\\\u0027\u0027\u0027\\\u0027\u0027;\nelse\n    cat;\nfi\u0027\n\n... and the git-filter-branch go away.\n\nChange-Id: I3a21fd0841f093495cf4727a9f5633a6f80c1690\nSigned-off-by: Scott Little \u003cscott.little@windriver.com\u003e\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/oslo.tools/commit/2c2744722bfa6b25c3d51ba14f1473980075a128"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/oslo.tools/commit/2c2744722bfa6b25c3d51ba14f1473980075a128"}]},"branch":"refs/heads/master"},"6b06d7d7e1fdd84964eb9ada0064bc6744467673":{"kind":"NO_CODE_CHANGE","_number":3,"created":"2019-07-12 14:57:28.000000000","uploader":{"_account_id":28410,"name":"Scott Little","email":"scott.little@windriver.com","username":"slittle1"},"ref":"refs/changes/09/669709/3","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/oslo.tools","ref":"refs/changes/09/669709/3","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/oslo.tools refs/changes/09/669709/3"}}},"commit":{"parents":[{"commit":"bcc255ccf37bb879379d525a4b3f224121972daa","subject":"Remove ping_me script","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/oslo.tools/commit/bcc255ccf37bb879379d525a4b3f224121972daa"}]}],"author":{"name":"Scott Little","email":"scott.little@windriver.com","date":"2019-07-08 16:06:16.000000000","tz":-240},"committer":{"name":"Scott Little","email":"scott.little@windriver.com","date":"2019-07-12 14:50:11.000000000","tz":-240},"subject":"filter_git_history.sh passes broken parent-filter to git filter-branch","message":"filter_git_history.sh passes broken parent-filter to git filter-branch\n\nProblem:\n    filter_git_history.sh, when passed a list if directories to filter,\n sometimes passes a bad arguement to git filter-branch.\n\ne.g.\n\nfilter_git_history.sh \u003cdir1\u003e \u003cdir2\u003e \u003cdir3\u003e\n\nresults in ...\n\ngit filter-branch ... --parent-filter \u0027\u003cbad arg\u003e\u0027 ...\n\nresulting in logs ....\n\nRewrite 1a32385367efab7a2bccf63981993b322e0d4b4c (1/866)/usr/lib/git-core/git-filter-branch: line 340: [: missing `]\u0027\n/usr/lib/git-core/git-filter-branch: line 341: -o: command not found\nRewrite 3cd12006bb6e7c9157f6b0f82a10d0c8cd63e334 (2/866)/usr/lib/git-core/git-filter-branch: line 340: [: missing `]\u0027\n/usr/lib/git-core/git-filter-branch: line 341: -o: command not found\n\nThe issue appears to be carriage returns in variable \u0027set_roots\u0027.\nSpecifically the expresion within the \u0027[\u0027 \u0027]\u0027 pair seems to be incompatible with\ncarriage returns.\n\nIf I run with bash debugging turned on, I see the for loop at\nline 45 iterated twice, producing the following output.\n\n+ set_roots\u003d\u0027\nif [ 1 -eq 0  -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u00271232ac58be82479ddf1af7f7eb335103cb883356\u0027\\\u0027\u0027\n -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u0027ffe029ef99c501a0076ad6106a364bbb9c0d80ea\u0027\\\u0027\u0027  ]; then\n    echo \u0027\\\u0027\u0027\u0027\\\u0027\u0027;\nelse\n    cat;\nfi\u0027\n\nNote that there is a carriage return prior to the second -o clause.\nMy theory is that within git-filter-branch, bash is being invoked twice.\n\nFirst call:\n    if [ 1 -eq 0  -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u00271232ac58be82479ddf1af7f7eb335103cb883356\u0027\\\u0027\u0027\n\nresulting in:\n    git-filter-branch: line 340: [: missing `]\u0027\n\nSecond call:\n     -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u0027ffe029ef99c501a0076ad6106a364bbb9c0d80ea\u0027\\\u0027\u0027  ]; then\n        echo \u0027\\\u0027\u0027\u0027\\\u0027\u0027;\n    else\n        cat;\n    fi\n\nresulting in:\n   git-filter-branch: line 341: -o: command not found\n\nOther details:\n   bash 4.3-7ubuntu1.7\n   git  1:1.9.1-1ubuntu0.10\n\nSolution\n   Use \u0027echo -n\u0027 rather than \u0027echo\u0027 when constructing \u0027set_roots\u0027.\n\nWhich results in ...\n\n+ set_roots\u003d\u0027\nif [ 1 -eq 0  -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u00271232ac58be82479ddf1af7f7eb335103cb883356\u0027\\\u0027\u0027 -o \"$GIT_COMMIT\" \u003d \u0027\\\u0027\u0027ffe029ef99c501a0076ad6106a364bbb9c0d80ea\u0027\\\u0027\u0027  ]; then\n    echo \u0027\\\u0027\u0027\u0027\\\u0027\u0027;\nelse\n    cat;\nfi\u0027\n\nThe entire \u0027[\u0027 \u0027]\u0027 expression is on the same line, and the git-filter-branch go away.\n\nChange-Id: I3a21fd0841f093495cf4727a9f5633a6f80c1690\nSigned-off-by: Scott Little \u003cscott.little@windriver.com\u003e\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/oslo.tools/commit/6b06d7d7e1fdd84964eb9ada0064bc6744467673"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/oslo.tools/commit/6b06d7d7e1fdd84964eb9ada0064bc6744467673"}]},"branch":"refs/heads/master"}},"requirements":[],"submit_records":[],"submit_requirements":[]}
