Re: [RFC PATCH 3/5] branch: cleanup branch name validation
- From
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
- Date
- Sep 23, 2017, 12:52 UTC
- Message-ID
- <811bc0ca-b503-2917-f985-e66538f7219c@gmail.com>
- In-Reply-To
- <xmqqd16kn86t.fsf@gitster.mtv.corp.google.com>
On Thursday 21 September 2017 07:07 AM, Junio C Hamano wrote:
Show 5 quoted lines
> Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes: > >> Thanks for giving a better alternative. Sounds catchy. How about >> `validate_branch_creation`? > I do not know what you meant by "catchy",
I was intending that 'ok_to_create_branch' was a "nice alternative" when I said catchy (I should better be more clear in the future).
Show 5 quoted lines
> but "git grep ok_to_" will > tell you that ok-to-$do-something is quite an establish phrasing (if > I thought it was a bad way to name it, I would have explicitly said > so). >
Well, it might be an established phrase but I feel that the 'ok_to' part of the name implies that it returns some sort of boolean value ('ok' or 'not ok') rather than the status. This doesn't seem to be the case for the `validate_new_branchname` which returns values only upon success and dies in case of failure (Note: only the PATCH 4/5 in the series adds the logic to return a value in case of failure; when requested). So, I find the name "ok_to_create_branch" to be less communicative. Though I don't find the name "validate_branch_creation" to be conveys this meaning any better; I thought of using it as it doesn't seem to be implying a boolean return value.
--- Kaartic