Re: git commit -C vs. prepare-commit-msg hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Pat,


Thanks for your reply.

On Tue, Nov 02, 2010 at 02:11:33PM -0600, Pat Notz wrote:
> 2010/11/2 SZEDER Gábor <szeder@xxxxxxxxxx>:
> > 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?

Yeah, this is what I tried as workaround ...

> Granted, you won't be able to tell the difference between -C and -c
> or --amend.

... and this is why it didn't work out, i.e. I needed to differentiate
-C from -c or --amend.

> > 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?)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]