Commits with empty commit messages

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

 



I accidentally managed to create a commit with an empty commit message using
`git am' with a patch that didn't have a subject line. It didn't matter much,
as I just wanted to squash it during a rebase anyway.

However, during `git rebase -i', I got a corrupt list of commits. Instead of
the usual:

| pick sha1 desc1
| pick sha2 desc2

I saw:

| pick sha1 >sha2 desc2

If you have a commit with an empty commit message, you can also not fix this
using amend:

| $ git commit --amend
| fatal: commit has empty message
| $

If you use `git rebase -i' to rebase one or more commits, _all_ of them with
empty commit messages, you don't see any of the familiar `pick' lines, but just

| noop

and you `loose' all those commits as soon as you quit your editor.

Probably the real offender is `git am', which allows empty commit messages,
unlike `git commit'.


While trying to create a clean test case, I also noticed you cannot use
`git am' to create the first commit in a freshly initialized empty git
repository. It fails with:

| $ git am patch
| fatal: HEAD: not a valid SHA1
| fatal: bad revision 'HEAD'
| $

I'm using 1.6.0.4, but I could reproduce the issues with 1.6.2.rc1.41.g3f74c.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@xxxxxxxxxxx
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
--
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]

  Powered by Linux