Re: git commit -C vs. prepare-commit-msg hook
- From
Pat Notz <patnotz@gmail.com>
- Date
- Nov 2, 2010, 20:11 UTC
- Message-ID
- <AANLkTimdjAc1ZKNkWAO_KU8CqorShMv0TNDvsy5qmSDw@mail.gmail.com>
- In-Reply-To
- <20101102145059.GB2116@neumann>
2010/11/2 SZEDER Gábor <szeder@ira.uka.de>:
Show 8 quoted lines
> Hi, > > Just noticed (read: got bitten by ;) that 'git commit' runs the > prepare-commit-msg hook even if it was invoked with the -C option. > This seems contradictory to me, because 'git commit -C' is to reuse an > already existing log message (and author info) as is, whereas > prepare-commit-msg is there to automatically edit the commit message. >
Can your hook look for the presence of the third command line argument to catch this case? Granted, you won't be able to tell the difference between -C and -c or --amend.
Show 15 quoted lines
> Is this desired and I'm missing something, or is this a bug? (or just > accidental, but we can't do anything about it anyway because of > backward compatibility?) > > Thanks. > > > Best, > Gábor > > -- > To unsubscribe from this list: send the line "unsubscribe git" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >