all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* git commit message checker won't let me commit a new file.
@ 2023-07-18 20:23 Alan Mackenzie
  2023-07-18 22:05 ` Jim Porter
  2023-07-19 11:48 ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Mackenzie @ 2023-07-18 20:23 UTC (permalink / raw)
  To: emacs-devel

Hello, Emacs.

I'm trying to commit a fix for bug #64642.  This involves adding a new
test file.

The commit message checker says "File
test/src/comp-resources/comp-test-funcs-dyn2.el: cannot be read: [No
such file or directory]
Commit aborted; please see the file CONTRIBUTE"

It would appear to reject the new file because it doesn't already exist
in the repository.  This is frustrating.

I can't be the first person to stumble over this problem.  Would
somebody please tell me the standard solution to it, if there is one.
I've looked in CONTRIBUTE and not found the topic discussed.  Otherwise
I will have to commit the files bypassing the commit message checks.

Thanks!

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git commit message checker won't let me commit a new file.
  2023-07-18 20:23 git commit message checker won't let me commit a new file Alan Mackenzie
@ 2023-07-18 22:05 ` Jim Porter
  2023-07-19  9:22   ` Alan Mackenzie
  2023-07-19 11:10   ` Alan Mackenzie
  2023-07-19 11:48 ` Eli Zaretskii
  1 sibling, 2 replies; 6+ messages in thread
From: Jim Porter @ 2023-07-18 22:05 UTC (permalink / raw)
  To: Alan Mackenzie, emacs-devel

On 7/18/2023 1:23 PM, Alan Mackenzie wrote:
> Hello, Emacs.
> 
> I'm trying to commit a fix for bug #64642.  This involves adding a new
> test file.
> 
> The commit message checker says "File
> test/src/comp-resources/comp-test-funcs-dyn2.el: cannot be read: [No
> such file or directory]
> Commit aborted; please see the file CONTRIBUTE"

That's surprising. This works perfectly for me. Can you describe in more 
detail how you're committing your change? Here's what I did:

   $ git checkout -b testing
   $ echo hi > test/src/comp-resources/comp-test-funcs-dyn2.el
   $ git add test/src/comp-resources/comp-test-funcs-dyn2.el
   $ git commit

In my editor, I add this for the commit message:

   * test/src/comp-resources/comp-test-funcs-dyn2.el: New file.

The commit hooks run successfully for me and don't produce any errors.

Based on the output you see, I'm guessing the issue is in the 
`commit-msg` hook, but I don't see anything in there that would do this.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git commit message checker won't let me commit a new file.
  2023-07-18 22:05 ` Jim Porter
@ 2023-07-19  9:22   ` Alan Mackenzie
  2023-07-19  9:34     ` Robert Pluim
  2023-07-19 11:10   ` Alan Mackenzie
  1 sibling, 1 reply; 6+ messages in thread
From: Alan Mackenzie @ 2023-07-19  9:22 UTC (permalink / raw)
  To: Jim Porter; +Cc: emacs-devel

Hello, Jim.

Thanks for the rapid reply.

On Tue, Jul 18, 2023 at 15:05:34 -0700, Jim Porter wrote:
> On 7/18/2023 1:23 PM, Alan Mackenzie wrote:
> > Hello, Emacs.

> > I'm trying to commit a fix for bug #64642.  This involves adding a new
> > test file.

> > The commit message checker says "File
> > test/src/comp-resources/comp-test-funcs-dyn2.el: cannot be read: [No
> > such file or directory]
> > Commit aborted; please see the file CONTRIBUTE"

> That's surprising. This works perfectly for me. Can you describe in more 
> detail how you're committing your change? Here's what I did:

>    $ git checkout -b testing
>    $ echo hi > test/src/comp-resources/comp-test-funcs-dyn2.el
>    $ git add test/src/comp-resources/comp-test-funcs-dyn2.el
>    $ git commit

Having created the file:
    $ git add test/src/comp-resources/comp-test-funcs-dyn2.el
    $ git commit.

> In my editor, I add this for the commit message:

>    * test/src/comp-resources/comp-test-funcs-dyn2.el: New file.

My commit message, in full, is (read from .git/COMMIT_EDITMSG:

#########################################################################

Fix native compilation in dynamically bound files.

This fixes bug#64642.

* lisp/emacs-lisp/comp.el (comp-spill-lap-function/symbol): Add
code for dynamically bound functions.

* test/src/comp-tests.el (comp-tests-result-lambda): New test.

* test/src/comp-resources/comp-test-funcs-dyn2.el: New test
file.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
#	modified:   lisp/emacs-lisp/comp.el
#	new file:   test/src/comp-resources/comp-test-funcs-dyn2.el
#	modified:   test/src/comp-tests.el
#
# Changes not staged for commit:
#	modified:   .gitignore
#
# Untracked files:
#	.gitignore.acm
#	.gitignore.backup
#	.timestamps.txt
#	2021-01-03.err
#	2021-01-06.err
#	2021-12-16.make
#	2021-12-30.err
#	2021-12-31.err
#	2022-01-01.err
#	2022-01-02.check.err
#	2022-01-02.err
#	2022-01-04.err
#	2022-01-05.err
#	2022-01-06.err
#	2022-01-07.err
#	2022-01-07.outerr
#	2022-01-08.err
#	2022-01-09.err
#	2022-01-09b.err
#	2022-01-10.err
#	2022-01-11
#	2022-01-11.err
#	2022-02-22.err
#	2022-02-22.outerr
#	checkout.20220228.out
#	checkout.20220301.out
#	checkout.20220302.out
#	doc/lispref/syntax.20160318.techsi
#	doc/lispref/syntax.20160318b.techsi
#	lib/.deps/
#	lisp/2022-01-09.err
#	lisp/emacs-lisp/comp.el.rej
#	src/2021-12-20.err
#	src/globals.20211124.aitch
#	src/lisp.20211127.aitch
#	test/lisp/calendar/icalendar-tests.elcr5m9Wq
#
#########################################################################
> The commit hooks run successfully for me and don't produce any errors.

I got the error described in my first post.  I tried it again this
morning with
    $ git commit -F .git/COMMIT_EDITMSG
, and got just the same.

> Based on the output you see, I'm guessing the issue is in the 
> `commit-msg` hook, but I don't see anything in there that would do this.

I now think it has nothing to do with the hooks.  The text "No such file
or directory" doesn't appear in any of the hooks.  The new file has
permissions 
-rw-r--r-- 1 acm acm 1068 Jul 18 19:11 test/src/comp-resources/comp-test-funcs-dyn2.el
, which is surely OK for manipulation by git.

If I do git status, I get:

#########################################################################
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   lisp/emacs-lisp/comp.el
        new file:   test/src/comp-resources/comp-test-funcs-dyn2.el
        modified:   test/src/comp-tests.el

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   .gitignore

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .gitignore.acm
        .gitignore.backup
        .timestamps.txt
<etc....>
#########################################################################

If I do git status --porcelain, I get:

#########################################################################
 M .gitignore
M  lisp/emacs-lisp/comp.el
A  test/src/comp-resources/comp-test-funcs-dyn2.el
M  test/src/comp-tests.el
?? .gitignore.acm
?? .gitignore.backup
?? .timestamps.txt
<etc....>
#########################################################################

I think I've got something tied in knots, somewhere, but I can't see
how.

If you've got any more ideas, I'd be grateful.  Thanks!

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git commit message checker won't let me commit a new file.
  2023-07-19  9:22   ` Alan Mackenzie
@ 2023-07-19  9:34     ` Robert Pluim
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Pluim @ 2023-07-19  9:34 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: Jim Porter, emacs-devel

>>>>> On Wed, 19 Jul 2023 09:22:06 +0000, Alan Mackenzie <acm@muc.de> said:
    Alan> I got the error described in my first post.  I tried it again this
    Alan> morning with
    Alan>     $ git commit -F .git/COMMIT_EDITMSG
    Alan> , and got just the same.

Try:

    GIT_TRACE=1 git commit -F .git/COMMIT_EDITMSG

That might narrow down whatʼs going wrong. Thereʼs a GIT_TRACE2 as
well, for even more verbosity.

Robert
-- 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git commit message checker won't let me commit a new file.
  2023-07-18 22:05 ` Jim Porter
  2023-07-19  9:22   ` Alan Mackenzie
@ 2023-07-19 11:10   ` Alan Mackenzie
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Mackenzie @ 2023-07-19 11:10 UTC (permalink / raw)
  To: Jim Porter; +Cc: emacs-devel, Robert Pluim

Hello, Jim.

On Tue, Jul 18, 2023 at 15:05:34 -0700, Jim Porter wrote:
> On 7/18/2023 1:23 PM, Alan Mackenzie wrote:
> > Hello, Emacs.

> > I'm trying to commit a fix for bug #64642.  This involves adding a new
> > test file.

> > The commit message checker says "File
> > test/src/comp-resources/comp-test-funcs-dyn2.el: cannot be read: [No
> > such file or directory]
> > Commit aborted; please see the file CONTRIBUTE"

> That's surprising. This works perfectly for me. Can you describe in more 
> detail how you're committing your change? Here's what I did:

>    $ git checkout -b testing
>    $ echo hi > test/src/comp-resources/comp-test-funcs-dyn2.el
>    $ git add test/src/comp-resources/comp-test-funcs-dyn2.el
>    $ git commit

> In my editor, I add this for the commit message:

>    * test/src/comp-resources/comp-test-funcs-dyn2.el: New file.

> The commit hooks run successfully for me and don't produce any errors.

> Based on the output you see, I'm guessing the issue is in the 
> `commit-msg` hook, but I don't see anything in there that would do this.

The fault is mine.  I still had remnants of my own experiments with
commit-msg in a version of commit-msg, and I had lots of symbolic links
from my various repositories pointing at this.  So I can sort it out,
now.

Sorry for wasting your time.

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git commit message checker won't let me commit a new file.
  2023-07-18 20:23 git commit message checker won't let me commit a new file Alan Mackenzie
  2023-07-18 22:05 ` Jim Porter
@ 2023-07-19 11:48 ` Eli Zaretskii
  1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2023-07-19 11:48 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: emacs-devel

> Date: Tue, 18 Jul 2023 20:23:00 +0000
> From: Alan Mackenzie <acm@muc.de>
> 
> Hello, Emacs.
> 
> I'm trying to commit a fix for bug #64642.  This involves adding a new
> test file.
> 
> The commit message checker says "File
> test/src/comp-resources/comp-test-funcs-dyn2.el: cannot be read: [No
> such file or directory]
> Commit aborted; please see the file CONTRIBUTE"
> 
> It would appear to reject the new file because it doesn't already exist
> in the repository.

That's not what it's supposed to do.  It's supposed to detect typos
and errors in file names and their leading directories.  So please
make sure you don't have some subtle typing mistake in the commit log
entries that name the files you added/modified.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-19 11:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18 20:23 git commit message checker won't let me commit a new file Alan Mackenzie
2023-07-18 22:05 ` Jim Porter
2023-07-19  9:22   ` Alan Mackenzie
2023-07-19  9:34     ` Robert Pluim
2023-07-19 11:10   ` Alan Mackenzie
2023-07-19 11:48 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.