Re: Log messages beginning # and git rebase -i

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

 



I was considering this case:

- git commit -a '-m# characters are now handled OK'
- hack, hack
- git commit -a '-mWhoops, fixed last commit'
- run git-rebase -i
- squash the second commit into the first
- when prompted for the log message for the combined change,
  delete the "Whoops, fixed last commit" line but leave the first line

That will accidentally lose the first log message, assuming commentChar=#.
git-rebase -i should be a bit friendlier and not bring up an editing window
where the log message ends up being one of the comments.

I suggested it could munge the message with an extra space character, but I
agree that is a bit unpleasant.  Perhaps better would be

   % git-rebase -i
   error: commit abcde has log message beginning with '#', which is the
          current setting of commentChar.  This means that the interactive
          editing of the log message will not work.  Please set commentChar
          to some other value (such as 'auto') in your git configuration
          to be able to rebase interactively.

The current behaviour is a bit of a trap for the unwary, and anyway it leaves
no way to specify keeping the existing log message (which begins #).

-- 
Ed Avis <eda@xxxxxxxxxxxxx>

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