petersomogyi commented on pull request #3568:
URL: https://github.com/apache/hbase/pull/3568#issuecomment-894272227


   Using `=` or `=~` is handled differently. The first uses pattern matching 
the latter uses regex.
   
   ```
   bash-5.1$ export PATCH_BRANCH=branch-1; if [[ "${PATCH_BRANCH}" = branch-1* 
]]; then echo "true"; fi
   true
   bash-5.1$ export PATCH_BRANCH=branch-1.2; if [[ "${PATCH_BRANCH}" = 
branch-1* ]]; then echo "true"; fi
   true
   bash-5.1$ export PATCH_BRANCH=branch-2; if [[ "${PATCH_BRANCH}" = branch-1* 
]]; then echo "true"; fi
   bash-5.1$ export PATCH_BRANCH=branch-; if [[ "${PATCH_BRANCH}" = branch-1* 
]]; then echo "true"; fi
   
   bash-5.1$ export PATCH_BRANCH=branch-1; if [[ "${PATCH_BRANCH}" =~ branch-1* 
]]; then echo "true"; fi
   true
   bash-5.1$ export PATCH_BRANCH=branch-1.2; if [[ "${PATCH_BRANCH}" =~ 
branch-1* ]]; then echo "true"; fi
   true
   bash-5.1$ export PATCH_BRANCH=branch-2; if [[ "${PATCH_BRANCH}" =~ branch-1* 
]]; then echo "true"; fi
   true
   bash-5.1$ export PATCH_BRANCH=branch-; if [[ "${PATCH_BRANCH}" =~ branch-1* 
]]; then echo "true"; fi
   true
   
   bash-5.1$ export PATCH_BRANCH=branch-1; if [[ "${PATCH_BRANCH}" =~ 
branch-1.* ]]; then echo "true"; fi
   true
   bash-5.1$ export PATCH_BRANCH=branch-1.2; if [[ "${PATCH_BRANCH}" =~ 
branch-1.* ]]; then echo "true"; fi
   true
   bash-5.1$ export PATCH_BRANCH=branch-2; if [[ "${PATCH_BRANCH}" =~ 
branch-1.* ]]; then echo "true"; fi
   bash-5.1$ export PATCH_BRANCH=branch-; if [[ "${PATCH_BRANCH}" =~ branch-1.* 
]]; then echo "true"; fi
   ```
   Based on this I can simplify the code. :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to