Whitespace at the start of first line of commit
Joel Brobecker
brobecker@adacore.com
Fri Jan 17 16:56:00 GMT 2020
> A quick run of the testsuite reveals that this assumption is made
> all over. I am opposed to having this feature be a standard feature
> of the git-hooks, so you wouldn't have to add an ad hoc check.
> The way I would do it is by enhancing the git_run function to check
> for a parameter named "_no_strip" and block the strip() operation
> when passed as True. You can then implement your check using the usual
> git interface, with the extra "_no_strip=True" parameter.
>
> Do open a GitHub issue if you'd like me to add this check to
> the git-hooks. I will likely give it less priority because
> you'll have a way to implement it on your on, but I will get to it
> eventually.
I apologize. Re-reading myself, I'm mixing various issues and not being
clear as a result, let me rephrase:
For your immediate need, I am proposing a way to adapt the git_run
function so you can use it to implement your check. Another option
is to use Python's subprocess module directly, but I think this will
be more work than what I suggest.
For the longer term, you'll have access to a hook that you can
use to call a script to validate an update. In that hook, you'll
have total implementation freedom, so you can implement that check
there, and not have to worry about that implementation detail in
the git-hooks.
Also longer term, I can add that check directly in the git-hooks
as well. I don't remember anyone ever really making this kind
of mistake, but it doesn't mean that it's unlikely either, nor
that it would be specific to the GCC community. Hence the merit
of having it in git-hooks directly.
--
Joel
More information about the Gcc
mailing list