threads / discuss / 46313

Requesting suggestions for a good sample "prepare-commit-msg" hook

Subject: Requesting suggestions for a good sample "prepare-commit-msg" hook

## tl;dr

6 messages between Jul 5, 2017 and Jul 6, 2017.

replies: 5people: 2as markdown or json

Kaartic Sivaraam· Jul 5, 2017, 16:45 UTC · lore
Hello all,

There's an attempt in progress to replace the part of the sample "prepare-commit-msg" hook that comments the "Conflicts" part of a merge commit message. This is being done as the "Conflicts" portion is commented by default for quite some time (since 2014) and thus the script in the hook is useless.

It's worth noting that it was the only part of the sample hook that *wasn't* commented by default i.e., it was the only portion of the sample hook that could be used just by enabling it by renaming the hook. So, just removing that portion of the solution wouldn't be a solution as it wouldn't be nice to have a whole sample hook to be commented for various reasons. So, we're searching for scripts that could both be helpful to users and could serve as a good sample to prove what could be done using the hooks.

In case anyone has any suggestions about what could prove to be an alternative please send them in!

-- 
Kaartic
Junio C Hamano· Jul 5, 2017, 17:00 UTC · re: Kaartic Sivaraam · lore

Re: Requesting suggestions for a good sample "prepare-commit-msg" hook

Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:
> So, we're searching for scripts that
> could both be  helpful to users and could serve as a good sample to
> prove what could be done using the hooks.

I am not so sure that we are searching for them, to be honest (who are we in this context anyway?)

This sounds like a solution looking for a problem to me. The simplest option may be to remove the sample hook---perhaps it outlived its usefulness.

Kaartic Sivaraam· Jul 5, 2017, 17:26 UTC · re: Junio C Hamano · lore

Re: Requesting suggestions for a good sample "prepare-commit-msg" hook

On Wed, 2017-07-05 at 10:00 -0700, Junio C Hamano wrote:
Show 8 quoted lines
> Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:
> 
> > So, we're searching for scripts that
> > could both be  helpful to users and could serve as a good sample to
> > prove what could be done using the hooks.
> 
> I am not so sure that we are searching for them, to be honest (who
> are we in this context anyway?)

I think I misinterpreted your sentence in one of the other mails (found below),

    That sounds like a sample that is there not because it would be
    useful, but because we couldn't think of any useful example.
> This sounds like a solution looking for a problem to me.  The
> simplest option may be to remove the sample hook---perhaps it
> outlived its usefulness.

Removing it is going to be done for sure. I thought it would be even better to replace it for the reasons I specified previously. Anyways, in case the last path I sent[1] seems not to be useful and not other interesting alternatives turn up in this thread then the "simplest option" has to be chosen.

[1]: http://public-inbox.org/git/20170705165114.20662-1-kaarticsivaraam91196@gmail.com/raw
-- 
Kaartic
Kaartic Sivaraam· Jul 5, 2017, 18:19 UTC · re: Kaartic Sivaraam · lore

Re: Requesting suggestions for a good sample "prepare-commit-msg" hook

> On Wed, 2017-07-05 at 10:00 -0700, Junio C Hamano wrote:
> > I am not so sure that we are searching for them, to be honest (who
> > are we in this context anyway?)
> 
Imagining HTML could be used in plain-text,

<strike> I think I misinterpreted your sentence in one of the other mails (found below), </strike> Sorry for that sloppy sentence. More correctly, the "we" in that context is the same as the "we" in the context of the text quoted below,

>     That sounds like a sample that is there not because it would be
>     useful, but because we couldn't think of any useful example.
> 

Link to the post that has the quoted text, http://public-inbox.org/git/%3Cxmqqy3s7nbkm.fsf@gitster.mtv.corp.google.com%3E/

Junio C Hamano· Jul 5, 2017, 19:19 UTC · re: Kaartic Sivaraam · lore

Re: Requesting suggestions for a good sample "prepare-commit-msg" hook

Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:
Show 17 quoted lines
>> On Wed, 2017-07-05 at 10:00 -0700, Junio C Hamano wrote:
>> > I am not so sure that we are searching for them, to be honest (who
>> > are we in this context anyway?)
>> 
> Imagining HTML could be used in plain-text,
>
> <strike> I think I misinterpreted your sentence in one of the other
> mails (found below), </strike> Sorry for that sloppy sentence. More
> correctly, the "we" in that context is the same as the "we" in the
> context of the text quoted below,
>
>>     That sounds like a sample that is there not because it would be
>>     useful, but because we couldn't think of any useful example.
>> 
>
> Link to the post that has the quoted text,
> http://public-inbox.org/git/%3Cxmqqy3s7nbkm.fsf@gitster.mtv.corp.google.com%3E/

I honestly do not see your point. Yes, I said that the change indicates that there is no useful example found (so far). That does not necessarily mean that we must find a useful example so that we can keep this sample script, which now became useless, alive.

I am questioning the assumption that it helps users to have a sample for prepare-commit-msg shipped with our source, and I suspect that it may no longer be true. If the sole purpose of finding a useful example is to keep the sample script alive, when the sample script is no longer a useful thing to ship, then it does sound like "a solution looking for a problem", no?

Kaartic Sivaraam· Jul 6, 2017, 03:28 UTC · re: Junio C Hamano · lore

Re: Requesting suggestions for a good sample "prepare-commit-msg" hook

On Wed, 2017-07-05 at 12:19 -0700, Junio C Hamano wrote:
Show 12 quoted lines
> I honestly do not see your point.  Yes, I said that the change
> indicates that there is no useful example found (so far).  That does
> not necessarily mean that we must find a useful example so that we
> can keep this sample script, which now became useless, alive.  
> 
> I am questioning the assumption that it helps users to have a sample
> for prepare-commit-msg shipped with our source, and I suspect that
> it may no longer be true.  If the sole purpose of finding a useful
> example is to keep the sample script alive, when the sample script
> is no longer a useful thing to ship, then it does sound like "a
> solution looking for a problem", no?
> 

Ah, now I see your point. When you said "it's no longer useful", I thought you were mentioning only the part of the script that commented the sign-off. Now I get that your point of not shipping the sample script itself. Now that clears the confusion and sorry for the confusion I may have caused.

-- 
Kaartic

← back to recent threads