prepare-commit-msg hook during rebase

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

 



Hi there

For a while now, I thought I was using prepare-commit-msg hook wrong
but finally took the time to analyse this further. Per the doc, the
hook receives the source of the commit message as $2
(message/template/merge/squash/commit or empty).

I notice the following with `rebase -i`:
- When rb applies a patch to be edited/reworded, the hook is called
with `commit` as the message source.
- When rb applies a patch merely to be picked, the hook is called with
`message` as the message source.

The latter also happens when non-interactive rebase applies commits.

I find this confusing for two reasons:
- Whether edit/reword or pick, there is always a commit being applied,
and it's the source of the message. So why not `commit` in both cases?
- The doc says that `message` is for inputs from `-m` or `-F`. So,
certainly this should not apply when the message comes from a picked
commit.

Also, I'm not sure whether the claim about `-m` is true, but that's
another issue; we even might want to distinguish between `-m` and `-F`
here.

Does the source `message` during rb pick occur due to an
implementation detail, maybe since the rewrite to sequencer?

Cheers
Michael




[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]

  Powered by Linux