Re: [BUG] Git won't commit

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [BUG] Git won't commit

From: Michael Witten <hidden>
Date: 2016-06-15 22:51:48

2011/8/12 Fabrício Nascimento [off-list ref]:
Where git is the 1.7.6 that does not work, and git2 is the 1.7.4 that does
work.
[master 09-mapas] git config --get commit.template
template
[master 09-mapas] git2 config --get commit.template
template
Did you get this problem figured out? If not, run:

  git config --unset commit.template

and then try making a commit as usual.

As for why one version works but the other does not, I'm not sure.

Re: [BUG] Git won't commit

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:51:48

Hi,

Michael Witten wrote:
As for why one version works but the other does not, I'm not sure.
It's my fault, I'm afraid:

 $ git log v1.7.4..v1.7.4.4 --grep=template --no-merges
 commit 2140b140
 Author: Jonathan Nieder [off-list ref]
 Date:   Fri Feb 25 03:07:57 2011 -0600

     commit: error out for missing commit message template

     When "git commit" was rewritten in C (v1.5.4-rc0~78^2~30,
     2007-11-08), a subtle bug in --template was introduced.  If the
     file named by a --template parameter is missing, previously git
     would error out with a message:

         Commit template file does not exist.

     but in the C version the --template parameter gets ignored and
     the default template is used.

     t7500 has two tests for this case which would have caught it, except
     that with the default $EDITOR, the commit message template is left
     unmodified, causing 'git commit' to error out and the test to
     succeed.

     Signed-off-by: Jonathan Nieder [off-list ref]
     Signed-off-by: Junio C Hamano [off-list ref]

Fabricio, do you remember what you were trying to do when the
"[commit] template" configuration got set?  Currently the error
message says

	fatal: could not read '<path>'

where <path> is the configured template filename; probably this
should be changed to mention (1) that the file we were expecting to
find is a commit message template and (2) whether we got it from the
commandline or configuration.

What I'm trying to figure out is whether other people were relying on
the accidental "optional template" behavior or if there is some case
where it is more useful.  If so, it should be brought back.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help