unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Why does make run git?
@ 2017-08-01  1:19 Richard Stallman
  2017-08-01  3:07 ` Eli Zaretskii
                   ` (3 more replies)
  0 siblings, 4 replies; 29+ messages in thread
From: Richard Stallman @ 2017-08-01  1:19 UTC (permalink / raw)
  To: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

I was surprised to see this output from `make'.  What does this do?
It seems fundamentally unmodular for building Emacs from sources
to concern itself in any way with how you got those sources.

Configuring local git repository...
‘.git/config’ -> ‘.git/config.~1~’
git config transfer.fsckObjects 'true'
git config diff.elisp.xfuncname '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'
git config diff.m4.xfuncname '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
git config diff.make.xfuncname '^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'
git config diff.shell.xfuncname '^([[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*\(\)|[[:alpha:]_][[:alnum:]_]*=)'
git config diff.texinfo.xfuncname '^@node[[:space:]]+([^,[:space:]][^,]+)'
Installing git hooks...
‘build-aux/git-hooks/commit-msg’ -> ‘.git/hooks/commit-msg’
‘build-aux/git-hooks/pre-commit’ -> ‘.git/hooks/pre-commit’
‘.git/hooks/applypatch-msg.sample’ -> ‘.git/hooks/applypatch-msg’
‘.git/hooks/pre-applypatch.sample’ -> ‘.git/hooks/pre-applypatch’

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




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

* Re: Why does make run git?
  2017-08-01  1:19 Why does make run git? Richard Stallman
@ 2017-08-01  3:07 ` Eli Zaretskii
  2017-08-01 14:30   ` Richard Stallman
  2017-08-01  3:14 ` Tino Calancha
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2017-08-01  3:07 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

> From: Richard Stallman <rms@gnu.org>
> Date: Mon, 31 Jul 2017 21:19:51 -0400
> 
> I was surprised to see this output from `make'.  What does this do?

Configure Git commands for Emacs, mostly.

> It seems fundamentally unmodular for building Emacs from sources
> to concern itself in any way with how you got those sources.

It is indeed somewhat controversial.

> git config transfer.fsckObjects 'true'

This makes Git abort if it sees a bad object being pulled or pushed.

> git config diff.elisp.xfuncname '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'
> git config diff.m4.xfuncname '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
> git config diff.make.xfuncname '^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'
> git config diff.shell.xfuncname '^([[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*\(\)|[[:alpha:]_][[:alnum:]_]*=)'
> git config diff.texinfo.xfuncname '^@node[[:space:]]+([^,[:space:]][^,]+)'

These tailor the Git's notion of a "function" for the various
languages.  It's handy in several commands that need to know where a
function begins and ends.

> Installing git hooks...
> ‘build-aux/git-hooks/commit-msg’ -> ‘.git/hooks/commit-msg’
> ‘build-aux/git-hooks/pre-commit’ -> ‘.git/hooks/pre-commit’
> ‘.git/hooks/applypatch-msg.sample’ -> ‘.git/hooks/applypatch-msg’
> ‘.git/hooks/pre-applypatch.sample’ -> ‘.git/hooks/pre-applypatch’

These hooks check the format of the commits and verify it is
according to our standards.



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

* Re: Why does make run git?
  2017-08-01  1:19 Why does make run git? Richard Stallman
  2017-08-01  3:07 ` Eli Zaretskii
@ 2017-08-01  3:14 ` Tino Calancha
  2017-08-02 17:25   ` Richard Stallman
  2017-08-01 15:10 ` Paul Eggert
  2017-08-01 16:01 ` Radon Rosborough
  3 siblings, 1 reply; 29+ messages in thread
From: Tino Calancha @ 2017-08-01  3:14 UTC (permalink / raw)
  To: Richard Stallman; +Cc: Tino Calancha, Emacs developers

[-- Attachment #1: Type: text/plain, Size: 1764 bytes --]



On Mon, 31 Jul 2017, Richard Stallman wrote:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> I was surprised to see this output from `make'.  What does this do?
> It seems fundamentally unmodular for building Emacs from sources
> to concern itself in any way with how you got those sources.
>
> Configuring local git repository...
> ‘.git/config’ -> ‘.git/config.~1~’
> git config transfer.fsckObjects 'true'
> git config diff.elisp.xfuncname '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'
> git config diff.m4.xfuncname '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
> git config diff.make.xfuncname '^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'
> git config diff.shell.xfuncname '^([[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*\(\)|[[:alpha:]_][[:alnum:]_]*=)'
> git config diff.texinfo.xfuncname '^@node[[:space:]]+([^,[:space:]][^,]+)'
> Installing git hooks...
> ‘build-aux/git-hooks/commit-msg’ -> ‘.git/hooks/commit-msg’
> ‘build-aux/git-hooks/pre-commit’ -> ‘.git/hooks/pre-commit’
> ‘.git/hooks/applypatch-msg.sample’ -> ‘.git/hooks/applypatch-msg’
> ‘.git/hooks/pre-applypatch.sample’ -> ‘.git/hooks/pre-applypatch’

This stuff is run just once, the first time you build.  In some sense
you are doing more than just building Emacs from its sources: your
are cloning the Emacs repository; some configuration of this repository
might be expected.

Those hooks ensure that some minimum guidelines are fulfilled: for 
instance, things like limit the number of characters for a line
within a commit message.

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

* Re: Why does make run git?
  2017-08-01  3:07 ` Eli Zaretskii
@ 2017-08-01 14:30   ` Richard Stallman
  2017-08-01 14:49     ` Tino Calancha
  0 siblings, 1 reply; 29+ messages in thread
From: Richard Stallman @ 2017-08-01 14:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > git config transfer.fsckObjects 'true'

  > This makes Git abort if it sees a bad object being pulled or pushed.

Isn't that a personal preference?  It seems wrong for Emacs to set it
arbitrarily.

  > > git config diff.elisp.xfuncname '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'
  > > git config diff.m4.xfuncname '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
  > > git config diff.make.xfuncname '^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'
  > > git config diff.shell.xfuncname '^([[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*\(\)|[[:alpha:]_][[:alnum:]_]*=)'
  > > git config diff.texinfo.xfuncname '^@node[[:space:]]+([^,[:space:]][^,]+)'

  > These tailor the Git's notion of a "function" for the various
  > languages.  It's handy in several commands that need to know where a
  > function begins and ends.

Do you mean, several Git commands, or several Emacs commands?
I would guess it is the former.

Running make on the Emacs checkout seems like an inadequate place to
do this.  There is no assurance that you will run make in that
checkout before committing anything.

Perhaps there should be a function in Emacs that does this, and some
VC commands could call it.

  > > Installing git hooks...
  > > ‘build-aux/git-hooks/commit-msg’ -> ‘.git/hooks/commit-msg’
  > > ‘build-aux/git-hooks/pre-commit’ -> ‘.git/hooks/pre-commit’
  > > ‘.git/hooks/applypatch-msg.sample’ -> ‘.git/hooks/applypatch-msg’
  > > ‘.git/hooks/pre-applypatch.sample’ -> ‘.git/hooks/pre-applypatch’

  > These hooks check the format of the commits and verify it is
  > according to our standards.

Running make on Emacs seems like an unreliable place to do this,
because there is no assurance that you will run make in that checkout
before committing anything.


-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




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

* Re: Why does make run git?
  2017-08-01 14:30   ` Richard Stallman
@ 2017-08-01 14:49     ` Tino Calancha
  2017-08-02 17:26       ` Richard Stallman
  0 siblings, 1 reply; 29+ messages in thread
From: Tino Calancha @ 2017-08-01 14:49 UTC (permalink / raw)
  To: Richard Stallman; +Cc: Eli Zaretskii, Emacs developers



On Tue, 1 Aug 2017, Richard Stallman wrote:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
>  > > git config transfer.fsckObjects 'true'
>
>  > This makes Git abort if it sees a bad object being pulled or pushed.
>
> Isn't that a personal preference?  It seems wrong for Emacs to set it
> arbitrarily.
It's recommended for security.  It was discussed before being 
added:
https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01802.html

>  > > git config diff.elisp.xfuncname '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'
>  > > git config diff.m4.xfuncname '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
>  > > git config diff.make.xfuncname '^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'
>  > > git config diff.shell.xfuncname '^([[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*\(\)|[[:alpha:]_][[:alnum:]_]*=)'
>  > > git config diff.texinfo.xfuncname '^@node[[:space:]]+([^,[:space:]][^,]+)'
>
>  > These tailor the Git's notion of a "function" for the various
>  > languages.  It's handy in several commands that need to know where a
>  > function begins and ends.
>
> Do you mean, several Git commands, or several Emacs commands?
> I would guess it is the former.
>
> Running make on the Emacs checkout seems like an inadequate place to
> do this.  There is no assurance that you will run make in that
> checkout before committing anything.
>
> Perhaps there should be a function in Emacs that does this, and some
> VC commands could call it.
I think is for convenience.  It is set there once and for all.  There
are plenty of Git interfaces for Emacs out of there: whatever an user
decide to use, s?he already has set up those hooks; then her/him 
potential contributions will be easier accepted.



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

* Re: Why does make run git?
  2017-08-01  1:19 Why does make run git? Richard Stallman
  2017-08-01  3:07 ` Eli Zaretskii
  2017-08-01  3:14 ` Tino Calancha
@ 2017-08-01 15:10 ` Paul Eggert
  2017-08-01 15:15   ` Kaushal Modi
  2017-08-01 16:01 ` Radon Rosborough
  3 siblings, 1 reply; 29+ messages in thread
From: Paul Eggert @ 2017-08-01 15:10 UTC (permalink / raw)
  To: rms, emacs-devel

Richard Stallman wrote:
> I was surprised to see this output from `make'.  What does this do?
> It seems fundamentally unmodular for building Emacs from sources
> to concern itself in any way with how you got those sources.

Make configures Git only if you got the sources via Git and have not configured 
Emacs. If you got the sources via some other means, or have already configured 
Emacs, Make doesn't configure Git. So I don't see a violation of modularity 
here; it's merely a convenience that Make supplies a default configuration if 
you haven't already configured things.

If you prefer to not configure Git even though you got the sources via Git, you 
can run 'make ALL_IF_GIT=' or './configure; make' after grabbing the sources. 
However, the default Git configuration is typically more convenient.

> Running make on the Emacs checkout seems like an inadequate place to
> do this.  There is no assurance that you will run make in that
> checkout before committing anything.

That's true. However, these are only guidelines, and it's not a huge tragedy if 
the guidelines are occasionally violated.

> Perhaps there should be a function in Emacs that does this, and some
> VC commands could call it.

That would be nice. However, some developers don't use Emacs VC to check in (I 
typically use vc-dwim instead), and so it's good to have Git check things as well.



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

* Re: Why does make run git?
  2017-08-01 15:10 ` Paul Eggert
@ 2017-08-01 15:15   ` Kaushal Modi
  0 siblings, 0 replies; 29+ messages in thread
From: Kaushal Modi @ 2017-08-01 15:15 UTC (permalink / raw)
  To: Paul Eggert, rms, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 585 bytes --]

On Tue, Aug 1, 2017 at 11:11 AM Paul Eggert <eggert@cs.ucla.edu> wrote:

> That's true. However, these are only guidelines, and it's not a huge
> tragedy if
> the guidelines are occasionally violated.
>
> > Perhaps there should be a function in Emacs that does this, and some
> > VC commands could call it.
>
> That would be nice. However, some developers don't use Emacs VC to check
> in (I
> typically use vc-dwim instead), and so it's good to have Git check things
> as well.
>

+1. I don't use Emacs VC and I actually like the checks make is doing at
the moment.
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 998 bytes --]

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

* Re: Why does make run git?
  2017-08-01  1:19 Why does make run git? Richard Stallman
                   ` (2 preceding siblings ...)
  2017-08-01 15:10 ` Paul Eggert
@ 2017-08-01 16:01 ` Radon Rosborough
  2017-08-02 17:30   ` Richard Stallman
  3 siblings, 1 reply; 29+ messages in thread
From: Radon Rosborough @ 2017-08-01 16:01 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

> It seems fundamentally unmodular for building Emacs from sources
> to concern itself in any way with how you got those sources.

But there are also .dir-locals.el files in the source tree. It seems
equally unmodular for building Emacs from sources to concern itself in
any way with how you edit those sources. It just so happens that
configuring Git can't be done by including files in the source tree
(for security reasons); it has to be done by running Git commands.

If your reaction to the .dir-locals.el argument is "but obviously it
makes sense for Emacs' source tree to have particular support for
Emacs, since that is the software it is building", then I would say it
makes equal sense for Emacs' source tree to have particular support
for Git, since that is the version-control system it is using. Much
like people include Travis configuration files, Docker configuration
files, and—well—.gitignore and .gitattributes files in their source
tree.

IMO, it's really not worth it to aspire to complete modularity if that
comes at the cost of significant practical inconvenience.



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

* Re: Why does make run git?
  2017-08-01  3:14 ` Tino Calancha
@ 2017-08-02 17:25   ` Richard Stallman
  0 siblings, 0 replies; 29+ messages in thread
From: Richard Stallman @ 2017-08-02 17:25 UTC (permalink / raw)
  To: Tino Calancha; +Cc: tino.calancha, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > This stuff is run just once, the first time you build.  In some sense
  > you are doing more than just building Emacs from its sources: your
  > are cloning the Emacs repository; some configuration of this repository
  > might be expected.

I'm not sure concretely what "might be expected" means here.
How do other programs configure git?

The question is not whether these configurations are good ones,
but rather how properly to install them.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




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

* Re: Why does make run git?
  2017-08-01 14:49     ` Tino Calancha
@ 2017-08-02 17:26       ` Richard Stallman
  2017-08-02 17:43         ` Radon Rosborough
  2017-08-02 17:56         ` Paul Eggert
  0 siblings, 2 replies; 29+ messages in thread
From: Richard Stallman @ 2017-08-02 17:26 UTC (permalink / raw)
  To: Tino Calancha; +Cc: eliz, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Perhaps there should be a function in Emacs that does this, and some
  > > VC commands could call it.
  > I think is for convenience.

But it is unreliable.  You can't rely on the user's having done 'make'
in the repository before doing the git operations that use these
settings.


-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




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

* Re: Why does make run git?
  2017-08-01 16:01 ` Radon Rosborough
@ 2017-08-02 17:30   ` Richard Stallman
  0 siblings, 0 replies; 29+ messages in thread
From: Richard Stallman @ 2017-08-02 17:30 UTC (permalink / raw)
  To: Radon Rosborough; +Cc: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > But there are also .dir-locals.el files in the source tree. It seems
  > equally unmodular for building Emacs from sources to concern itself in
  > any way with how you edit those sources.

.dir-locals.el isn't related specifically to "building Emacs from
sources".  It applies to all editing of the checked-out Emacs sources
with Emacs.

Whether it is good or bad to have these .dir-locals.el files is
another issue and I see no need to discuss it now.  My point is only
that it is a not similar to the issue at hand, and not directly
pertinent.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




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

* Re: Why does make run git?
  2017-08-02 17:26       ` Richard Stallman
@ 2017-08-02 17:43         ` Radon Rosborough
  2017-08-03 19:43           ` Richard Stallman
  2017-08-02 17:56         ` Paul Eggert
  1 sibling, 1 reply; 29+ messages in thread
From: Radon Rosborough @ 2017-08-02 17:43 UTC (permalink / raw)
  To: rms; +Cc: eliz, emacs-devel, Tino Calancha

> You can't rely on the user's having done 'make'
> in the repository before doing the git operations that use these
> settings.

That is true but it's much worse to rely on the user using VC. Hooking
into the build process isn't foolproof, but it's much better than
hooking into every possible version-control package for Emacs,
including ones like Magit which aren't built in to Emacs.

I don't think there really is any perfect solution to the problem of
configuring Git. You just have to accept that in some circumstances,
the configuration won't be done correctly, so that's why it's
important for there to be more robust checks run on CI when possible.

But really, hooking into the build process is probably the easiest way
to reach the most users with the least maintenance overhead and
inconvenience.

On Wed, Aug 2, 2017 at 10:26 AM, Richard Stallman <rms@gnu.org> wrote:
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
>   > > Perhaps there should be a function in Emacs that does this, and some
>   > > VC commands could call it.
>   > I think is for convenience.
>
> But it is unreliable.  You can't rely on the user's having done 'make'
> in the repository before doing the git operations that use these
> settings.
>
>
> --
> Dr Richard Stallman
> President, Free Software Foundation (gnu.org, fsf.org)
> Internet Hall-of-Famer (internethalloffame.org)
> Skype: No way! See stallman.org/skype.html.
>
>



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

* Re: Why does make run git?
  2017-08-02 17:26       ` Richard Stallman
  2017-08-02 17:43         ` Radon Rosborough
@ 2017-08-02 17:56         ` Paul Eggert
  2017-08-02 18:31           ` Eli Zaretskii
  2017-08-15 14:18           ` Ted Zlatanov
  1 sibling, 2 replies; 29+ messages in thread
From: Paul Eggert @ 2017-08-02 17:56 UTC (permalink / raw)
  To: rms, Tino Calancha; +Cc: eliz, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]

On 08/02/2017 10:26 AM, Richard Stallman wrote:
> But it is unreliable.  You can't rely on the user's having done 'make'
> in the repository before doing the git operations that use these
> settings.

You can pretty much rely on users running either Make or ./autogen.sh; 
otherwise they can't easily build or run Emacs. So the main problem here 
is ./autogen.sh.

Although last year I arranged for ./autogen.sh (when invoked with no 
arguments) to do Git settings like Make does, some other developers 
objected at the time that this might conflict with their own Git 
settings so I changed autogen.sh to not alter Git settings except on 
explicit request. Given the confusion on this topic on the meantime, 
though, I think the change was mistaken, and in that sense I believe 
that you and I are in agreement.

To help improve the situation I propose the attached patch, which 
reverts the default ./autogen.sh behavior to be './autogen.sh all', the 
way it used to be (briefly). Developers who want autogen.sh to leave 
their Git settings alone can continue to use './autogen.sh autoconf'.


[-- Attachment #2: 0001-Default-autogen.sh-to-all.patch --]
[-- Type: text/x-patch, Size: 1614 bytes --]

From 2c9b41624a7e32af0793eedc9d8a5e1278eb271f Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 2 Aug 2017 10:50:37 -0700
Subject: [PATCH] Default autogen.sh to 'all'

This addresses a problem noted by RMS in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00052.html
* autogen.sh (do_git): Set to true if this script is invoked
with no arguments and there is a .git subdirectory.
---
 CONTRIBUTE   | 2 +-
 INSTALL.REPO | 2 +-
 autogen.sh   | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/CONTRIBUTE b/CONTRIBUTE
index 365e423249..9b5fb090e7 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -14,7 +14,7 @@ Briefly, the following shell commands build and run Emacs from scratch:
 	git config --global transfer.fsckObjects true
 	git clone git://git.sv.gnu.org/emacs.git
 	cd emacs
-	./autogen.sh all
+	./autogen.sh
 	./configure
 	make
 	src/emacs
diff --git a/INSTALL.REPO b/INSTALL.REPO
index ce346bb246..e7bb3bba03 100644
--- a/INSTALL.REPO
+++ b/INSTALL.REPO
@@ -19,7 +19,7 @@ To use the autotools, run the following shell command to generate the
 'configure' script and some related files, and to set up your git
 configuration:
 
-  $ ./autogen.sh all
+  $ ./autogen.sh
 
 You can then configure your build as follows:
 
diff --git a/autogen.sh b/autogen.sh
index 76fde9e18d..70f9cbd245 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -127,7 +127,8 @@ do_git=
 
 case $do_autoconf,$do_git in
   false,false)
-    do_autoconf=true;;
+    do_autoconf=true
+    test -e .git && do_git=true;;
 esac
 
 # Generate Autoconf-related files, if requested.
-- 
2.13.3


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

* Re: Why does make run git?
  2017-08-02 17:56         ` Paul Eggert
@ 2017-08-02 18:31           ` Eli Zaretskii
  2017-08-02 18:42             ` Paul Eggert
  2017-08-15 14:18           ` Ted Zlatanov
  1 sibling, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2017-08-02 18:31 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel, rms, tino.calancha

> Cc: eliz@gnu.org, emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Wed, 2 Aug 2017 10:56:53 -0700
> 
> To help improve the situation I propose the attached patch, which 
> reverts the default ./autogen.sh behavior to be './autogen.sh all', the 
> way it used to be (briefly). Developers who want autogen.sh to leave 
> their Git settings alone can continue to use './autogen.sh autoconf'.

AFAIU, doing that will silently force the installation of the
Git-related stuff when I run just "make", and Make decides it needs to
invoke autogen.sh, because the fact that I originally used the
non-default argument isn't recorded anywhere, and thus cannot be
replayed.  Right?  If so, I don't think I will like this change.



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

* Re: Why does make run git?
  2017-08-02 18:31           ` Eli Zaretskii
@ 2017-08-02 18:42             ` Paul Eggert
  2017-08-02 19:10               ` Eli Zaretskii
  0 siblings, 1 reply; 29+ messages in thread
From: Paul Eggert @ 2017-08-02 18:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, rms, tino.calancha

On 08/02/2017 11:31 AM, Eli Zaretskii wrote:
>> To help improve the situation I propose the attached patch, which
>> reverts the default ./autogen.sh behavior to be './autogen.sh all', the
>> way it used to be (briefly). Developers who want autogen.sh to leave
>> their Git settings alone can continue to use './autogen.sh autoconf'.
> AFAIU, doing that will silently force the installation of the
> Git-related stuff when I run just "make", and Make decides it needs to
> invoke autogen.sh, because the fact that I originally used the
> non-default argument isn't recorded anywhere, and thus cannot be
> replayed.  Right?

No, if you run Make from a freshly-checked-out directory, Make calls 
"./autogen.sh all", which sets up Git. The proposed patch doesn't affect 
this.

And if you run "./autogen.sh autoconf" and then run Make, Make won't set 
up Git. The proposed patch doesn't affect this either.

The only thing that changes is what happens if you run plain "./autogen.sh".




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

* Re: Why does make run git?
  2017-08-02 18:42             ` Paul Eggert
@ 2017-08-02 19:10               ` Eli Zaretskii
  2017-08-02 20:04                 ` Paul Eggert
  0 siblings, 1 reply; 29+ messages in thread
From: Eli Zaretskii @ 2017-08-02 19:10 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel, rms, tino.calancha

> Cc: rms@gnu.org, tino.calancha@gmail.com, emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Wed, 2 Aug 2017 11:42:43 -0700
> 
> On 08/02/2017 11:31 AM, Eli Zaretskii wrote:
> >> To help improve the situation I propose the attached patch, which
> >> reverts the default ./autogen.sh behavior to be './autogen.sh all', the
> >> way it used to be (briefly). Developers who want autogen.sh to leave
> >> their Git settings alone can continue to use './autogen.sh autoconf'.
> > AFAIU, doing that will silently force the installation of the
> > Git-related stuff when I run just "make", and Make decides it needs to
> > invoke autogen.sh, because the fact that I originally used the
> > non-default argument isn't recorded anywhere, and thus cannot be
> > replayed.  Right?
> 
> No, if you run Make from a freshly-checked-out directory, Make calls 
> "./autogen.sh all", which sets up Git. The proposed patch doesn't affect 
> this.
> 
> And if you run "./autogen.sh autoconf" and then run Make, Make won't set 
> up Git. The proposed patch doesn't affect this either.

Maybe I'm confused, but top-level Makefile.in has this:

  $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/m4/*.m4
	  cd $(srcdir) && ./autogen.sh

This seems to say that if configure.ac or one of the *.m4 files become
newer than configure, either because I edit them or because I just
pulled from upstream, then Make will run "./autogen.sh", which under
the default you propose will configure Git.  If that's not true, then
what am I missing?



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

* Re: Why does make run git?
  2017-08-02 19:10               ` Eli Zaretskii
@ 2017-08-02 20:04                 ` Paul Eggert
  2017-08-12 16:11                   ` Paul Eggert
  0 siblings, 1 reply; 29+ messages in thread
From: Paul Eggert @ 2017-08-02 20:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, rms, tino.calancha

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

On 08/02/2017 12:10 PM, Eli Zaretskii wrote:
> Maybe I'm confused, but top-level Makefile.in has this:
>
>    $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/m4/*.m4
> 	  cd $(srcdir) && ./autogen.sh
>
Ah, you're right, that should say './autogen.sh autoconf', not plain 
'./autogen.sh', since the intent is only to build 'configure'. This is a 
typo regardless of whether my recently-proposed patch is accepted, and I 
fixed it with the attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Clarify-when-autogen.sh-should-run-only-autoconf.patch --]
[-- Type: text/x-patch; name="0001-Clarify-when-autogen.sh-should-run-only-autoconf.patch", Size: 1240 bytes --]

From 8aed1e9d1b7a4969039844163f6a89eee78510a9 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 2 Aug 2017 13:01:58 -0700
Subject: [PATCH] Clarify when autogen.sh should run only autoconf
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* Makefile.in (configure, bootstrap): Run ‘./autogen.sh autoconf’,
not plain ‘./autogen.sh’, to make it clear that only
autoconf-related tools should be run here.
---
 Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index a31d416bd7..8a08465c4a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -448,7 +448,7 @@ config.status:
 	fi
 
 $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/m4/*.m4
-	cd $(srcdir) && ./autogen.sh
+	cd $(srcdir) && ./autogen.sh autoconf
 
 # ==================== Installation ====================
 
@@ -1094,7 +1094,7 @@ .PHONY:
 #  * Rebuild Makefile, to update the build procedure itself.
 #  * Do the actual build.
 bootstrap: bootstrap-clean
-	cd $(srcdir) && ./autogen.sh
+	cd $(srcdir) && ./autogen.sh autoconf
 	$(MAKE) MAKEFILE_NAME=force-Makefile force-Makefile
 	$(MAKE) all
 
-- 
2.13.3


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

* Re: Why does make run git?
  2017-08-02 17:43         ` Radon Rosborough
@ 2017-08-03 19:43           ` Richard Stallman
  2017-08-03 20:02             ` Radon Rosborough
  0 siblings, 1 reply; 29+ messages in thread
From: Richard Stallman @ 2017-08-03 19:43 UTC (permalink / raw)
  To: Radon Rosborough; +Cc: eliz, emacs-devel, tino.calancha

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > That is true but it's much worse to rely on the user using VC. Hooking
  > into the build process isn't foolproof, but it's much better than
  > hooking into every possible version-control package for Emacs,
  > including ones like Magit which aren't built in to Emacs.

Not necessarily.  We could make it a documented Emacs facility,
which could be used by any repository, and all front-ends ought
to call it.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




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

* Re: Why does make run git?
  2017-08-03 19:43           ` Richard Stallman
@ 2017-08-03 20:02             ` Radon Rosborough
  0 siblings, 0 replies; 29+ messages in thread
From: Radon Rosborough @ 2017-08-03 20:02 UTC (permalink / raw)
  To: rms; +Cc: eliz, emacs-devel, tino.calancha

> We could make it a documented Emacs facility,
> which could be used by any repository, and all front-ends ought
> to call it.

I don't object, but this sounds a little bit like overkill to me. This
would be a significant amount of added complexity (e.g. notifying all
known authors of version-control packages [maybe not that many?] and
hoping they incorporate supporting changes; dealing with safety [is
safe-local-variable-values enough?]; working out the appropriate scope
[is this just for Git? can you also run arbitrary shell commands?];
designing an interface that will cover all common use cases; making
sure that this doesn't impact performance; deciding whether to
override existing configuration and hooks; etc.), and it still doesn't
really fix the problem since plenty of people will just use Git
directly.

I'd vote for leaving the situation as-is, since there's no general way
to prevent people from using Git without first configuring it. The
"right" solution is to not rely on the local Git configuration for
anything mission-critical.

OTOH, since this is a relatively common problem, maybe somebody has
already invented a general-purpose solution. In that case perhaps
Emacs should support that standard. I don't think Emacs should create
its own standard in this case.



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

* Re: Why does make run git?
  2017-08-02 20:04                 ` Paul Eggert
@ 2017-08-12 16:11                   ` Paul Eggert
  0 siblings, 0 replies; 29+ messages in thread
From: Paul Eggert @ 2017-08-12 16:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, rms, tino.calancha

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

Paul Eggert wrote:
> This is a typo regardless of whether my recently-proposed patch is accepted, and 
> I fixed it with the attached.

No further comment after the fix, and as the fix means that the proposed patch 
seems to be the right thing to do I installed it, along with a followup cleanup 
patch. Both patches are attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Default-autogen.sh-to-all.patch --]
[-- Type: text/x-patch; name="0001-Default-autogen.sh-to-all.patch", Size: 1658 bytes --]

From 7518b6a88d1da01066aa2fc7fb59b9308dc4d7e4 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 12 Aug 2017 08:56:52 -0700
Subject: [PATCH 1/2] Default autogen.sh to 'all'

This addresses a problem noted by RMS in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00052.html
* autogen.sh (do_git): Set to true if this script is invoked
with no arguments and there is a .git subdirectory.
---
 CONTRIBUTE   | 2 +-
 INSTALL.REPO | 2 +-
 autogen.sh   | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/CONTRIBUTE b/CONTRIBUTE
index 365e423..9b5fb09 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -14,7 +14,7 @@ Briefly, the following shell commands build and run Emacs from scratch:
 	git config --global transfer.fsckObjects true
 	git clone git://git.sv.gnu.org/emacs.git
 	cd emacs
-	./autogen.sh all
+	./autogen.sh
 	./configure
 	make
 	src/emacs
diff --git a/INSTALL.REPO b/INSTALL.REPO
index ce346bb..e7bb3bb 100644
--- a/INSTALL.REPO
+++ b/INSTALL.REPO
@@ -19,7 +19,7 @@ To use the autotools, run the following shell command to generate the
 'configure' script and some related files, and to set up your git
 configuration:
 
-  $ ./autogen.sh all
+  $ ./autogen.sh
 
 You can then configure your build as follows:
 
diff --git a/autogen.sh b/autogen.sh
index 76fde9e..70f9cbd 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -127,7 +127,8 @@ do_git=
 
 case $do_autoconf,$do_git in
   false,false)
-    do_autoconf=true;;
+    do_autoconf=true
+    test -e .git && do_git=true;;
 esac
 
 # Generate Autoconf-related files, if requested.
-- 
2.7.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Simplify-re-and-document-autoconf.sh-all.patch --]
[-- Type: text/x-patch; name="0002-Simplify-re-and-document-autoconf.sh-all.patch", Size: 1840 bytes --]

From 4c8996ded106007dee26508d23769933fc59a375 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 12 Aug 2017 09:06:55 -0700
Subject: [PATCH 2/2] Simplify re and document 'autoconf.sh all'

* GNUmakefile (ALL_IF_GIT): Remove; no longer needed, now that
./autogen.sh defaults to "all".  All uses removed.
* README: Mention autoconf.sh's effect on Git configuration.
---
 GNUmakefile | 7 ++-----
 README      | 3 ++-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 98d31f4..304a7b3 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -62,13 +62,10 @@ default $(ORDINARY_GOALS):
 # Execute in sequence, so that multiple user goals don't conflict.
 .NOTPARALLEL:
 
-# 'all' if a .git subdirectory is present, empty otherwise.
-ALL_IF_GIT = $(subst .git,all,$(wildcard .git))
-
 configure:
 	@echo >&2 'There seems to be no "configure" file in this directory.'
-	@echo >&2 Running ./autogen.sh $(ALL_IF_GIT) ...
-	./autogen.sh $(ALL_IF_GIT)
+	@echo >&2 Running ./autogen.sh ...
+	./autogen.sh
 	@echo >&2 '"configure" file built.'
 
 Makefile: configure
diff --git a/README b/README
index 494ee08..527e406 100644
--- a/README
+++ b/README
@@ -45,7 +45,8 @@ The file 'configure.ac' is the input used by the autoconf program to
 construct the 'configure' script.
 
 The shell script 'autogen.sh' generates 'configure' and other files by
-running Autoconf, which in turn uses GNU m4.  If you want to use it,
+running Autoconf (which in turn uses GNU m4), and configures files in
+the .git subdirectory if you are using Git.  If you want to use it,
 you will need to install recent versions of these build tools.  This
 should be needed only if you edit files like 'configure.ac' that
 specify Emacs's autobuild procedure.
-- 
2.7.4


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

* Re: Why does make run git?
  2017-08-02 17:56         ` Paul Eggert
  2017-08-02 18:31           ` Eli Zaretskii
@ 2017-08-15 14:18           ` Ted Zlatanov
  2017-08-15 15:52             ` Paul Eggert
  1 sibling, 1 reply; 29+ messages in thread
From: Ted Zlatanov @ 2017-08-15 14:18 UTC (permalink / raw)
  To: emacs-devel

On Wed, 2 Aug 2017 10:56:53 -0700 Paul Eggert <eggert@cs.ucla.edu> wrote: 

PE> To help improve the situation I propose the attached patch, which reverts the
PE> default ./autogen.sh behavior to be './autogen.sh all', the way it used to be
PE> (briefly). Developers who want autogen.sh to leave their Git settings alone can
PE> continue to use './autogen.sh autoconf'.

I had to modify the .gitlab-ci.yml file today because it was failing to
build Emacs in a clean checkout. I figured out the right command from
your post. I have no objections to this change, but perhaps CONTRIBUTE
and INSTALL should mention how to compile and run Emacs without running
Git or expecting a .git/hooks directory?

Maybe there could even be a more automatic way to avoid running the Git
commands inside an automated build, where there's no chance they will be
needed?

Thanks
Ted




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

* Re: Why does make run git?
  2017-08-15 14:18           ` Ted Zlatanov
@ 2017-08-15 15:52             ` Paul Eggert
  2017-08-15 16:58               ` Ted Zlatanov
  0 siblings, 1 reply; 29+ messages in thread
From: Paul Eggert @ 2017-08-15 15:52 UTC (permalink / raw)
  To: emacs-devel

Ted Zlatanov wrote:
> perhaps CONTRIBUTE
> and INSTALL should mention how to compile and run Emacs without running
> Git or expecting a .git/hooks directory?

Those files already attempt to do that. In what sense do they fall short? What 
wording needs to be changed?

Or perhaps a better way to put it: what went wrong with your build, exactly? Is 
it something that autogen.sh can detect and work around automatically? It'd be 
better to automate away any problems than to complicate CONTRIBUTE and INSTALL 
to work around them.

> Maybe there could even be a more automatic way to avoid running the Git
> commands inside an automated build, where there's no chance they will be
> needed?

That's easy, just run "rm -r .git". I don't think this is a good idea, though. 
Git might be needed in an automated build. I might run "git diff" at the end of 
such a build, for example, to test whether the build altered sources.



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

* Re: Why does make run git?
  2017-08-15 15:52             ` Paul Eggert
@ 2017-08-15 16:58               ` Ted Zlatanov
  2017-08-15 17:08                 ` Eli Zaretskii
  2017-08-15 20:39                 ` Paul Eggert
  0 siblings, 2 replies; 29+ messages in thread
From: Ted Zlatanov @ 2017-08-15 16:58 UTC (permalink / raw)
  To: emacs-devel

On Tue, 15 Aug 2017 08:52:30 -0700 Paul Eggert <eggert@cs.ucla.edu> wrote: 

PE> Ted Zlatanov wrote:
>> perhaps CONTRIBUTE
>> and INSTALL should mention how to compile and run Emacs without running
>> Git or expecting a .git/hooks directory?

PE> Those files already attempt to do that. In what sense do they fall short? What
PE> wording needs to be changed?

I guess INSTALL doesn't deal with autogen.sh so it doesn't need changes.

I think CONTRIBUTE should mention, right after saying to run autogen.sh,
that the above requires Git to be installed.

PE> Or perhaps a better way to put it: what went wrong with your build, exactly? Is
PE> it something that autogen.sh can detect and work around automatically? It'd be
PE> better to automate away any problems than to complicate CONTRIBUTE and INSTALL
PE> to work around them.

Agreed :) Hence my next paragraph.

What went wrong? https://gitlab.com/emacs-ci/emacs/-/jobs/29326689 says

#+begin_src text
$ ./autogen.sh
Checking whether you have the necessary tools...
(Read INSTALL.REPO for more details on building Emacs)
Checking for autoconf (need at least version 2.65) ... ok
Your system has the required tools.
Building aclocal.m4 ...
Running 'autoreconf -fi -I m4' ...
Configuring local git repository...
'.git/config' -> '.git/config.~1~'
git config transfer.fsckObjects 'true'
git config diff.elisp.xfuncname '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'
git config diff.m4.xfuncname '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
git config diff.make.xfuncname '^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'
git config diff.shell.xfuncname '^([[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*\(\)|[[:alpha:]_][[:alnum:]_]*=)'
git config diff.texinfo.xfuncname '^@node[[:space:]]+([^,[:space:]][^,]+)'
Installing git hooks...
'build-aux/git-hooks/commit-msg' -> '.git/hooks/commit-msg'
cp: cannot create regular file '.git/hooks/commit-msg': No such file or directory
ERROR: Job failed: exit code 1
#+end_src

So it looks like it assumes that `.git/hooks' exists. I don't know why
that's not true in the GitLab checkout. Maybe "Configuring local git
repository" could be changed to "Configuring local git repository (run
'autogen.sh autoconf' to skip this step)"? That would probably be the
most direct way to help users who don't read the docs :)

>> Maybe there could even be a more automatic way to avoid running the Git
>> commands inside an automated build, where there's no chance they will be
>> needed?

PE> That's easy, just run "rm -r .git". I don't think this is a good idea, though.

Yes, it's a radical surgery. I think the text change suggested above is
a gentler way.

Ted




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

* Re: Why does make run git?
  2017-08-15 16:58               ` Ted Zlatanov
@ 2017-08-15 17:08                 ` Eli Zaretskii
  2017-08-15 20:39                 ` Paul Eggert
  1 sibling, 0 replies; 29+ messages in thread
From: Eli Zaretskii @ 2017-08-15 17:08 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: emacs-devel

> From: Ted Zlatanov <tzz@lifelogs.com>
> Date: Tue, 15 Aug 2017 12:58:27 -0400
> 
> On Tue, 15 Aug 2017 08:52:30 -0700 Paul Eggert <eggert@cs.ucla.edu> wrote: 
> 
> PE> Ted Zlatanov wrote:
> >> perhaps CONTRIBUTE
> >> and INSTALL should mention how to compile and run Emacs without running
> >> Git or expecting a .git/hooks directory?
> 
> PE> Those files already attempt to do that. In what sense do they fall short? What
> PE> wording needs to be changed?
> 
> I guess INSTALL doesn't deal with autogen.sh so it doesn't need changes.

INSTALL is not relevant to building Emacs out of a Git checkout.  The
file you should be looking at is INSTALL.REPO.



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

* Re: Why does make run git?
  2017-08-15 16:58               ` Ted Zlatanov
  2017-08-15 17:08                 ` Eli Zaretskii
@ 2017-08-15 20:39                 ` Paul Eggert
  2017-08-16 12:30                   ` Andy Moreton
  2017-08-16 14:09                   ` Ted Zlatanov
  1 sibling, 2 replies; 29+ messages in thread
From: Paul Eggert @ 2017-08-15 20:39 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

Ted Zlatanov wrote:

> I think CONTRIBUTE should mention, right after saying to run autogen.sh,
> that the above requires Git to be installed.

autogen.sh is not supposed to require Git, so let's fix autogen.sh instead.


> 'build-aux/git-hooks/commit-msg' -> '.git/hooks/commit-msg'
> cp: cannot create regular file '.git/hooks/commit-msg': No such file or directory
> ERROR: Job failed: exit code 1
> #+end_src
> 
> So it looks like it assumes that `.git/hooks' exists. I don't know why
> that's not true in the GitLab checkout.

I don't know why either. I wonder what other compatibility mines remain 
unexploded in the GitLab field? Anyway, I installed the attached, which should 
work around this particular problem without having to complicate the 
configuration instructions.

[-- Attachment #2: 0001-Do-not-assume-regular-Git-.git-hooks-dir.txt --]
[-- Type: text/plain, Size: 2045 bytes --]

From e97aebd8fed255507fd17ef37a06b042ebed7e77 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 15 Aug 2017 13:31:03 -0700
Subject: [PATCH] Do not assume regular Git .git/hooks dir
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Apparently Gitlab doesn’t create .git/hooks, like regular Git does.
Problem reported by Ted Zlatanov in:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00380.html
* autogen.sh (git_sample_hook_src): New function.  Use it to work
even if .git/hooks or its samples do not exist.
---
 autogen.sh | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 70f9cbd..d454e41 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -327,8 +327,21 @@ sample_hooks=
     cmp -- build-aux/git-hooks/$hook "$hooks/$hook" >/dev/null 2>&1 ||
 	tailored_hooks="$tailored_hooks $hook"
 done
+
+git_sample_hook_src ()
+{
+    hook=$1
+    src=$hooks/$hook.sample
+    if test ! -r "$src"; then
+	case $hook in
+	    applypatch-msg) src=build-aux/git-hooks/commit-msg;;
+	    pre-applypatch) src=build-aux/git-hooks/pre-commit;;
+	esac
+    fi
+}
 for hook in applypatch-msg pre-applypatch; do
-    cmp -- "$hooks/$hook.sample" "$hooks/$hook" >/dev/null 2>&1 ||
+    git_sample_hook_src $hook
+    cmp -- "$src" "$hooks/$hook" >/dev/null 2>&1 ||
 	sample_hooks="$sample_hooks $hook"
 done
 
@@ -336,6 +349,11 @@ sample_hooks=
     if $do_git; then
 	echo "Installing git hooks..."
 
+	if test ! -d "$hooks"; then
+	    printf "mkdir -p -- '%s'\\n" "$hooks"
+	    mkdir -p -- "$hooks" || exit
+	fi
+
 	if test -n "$tailored_hooks"; then
 	    for hook in $tailored_hooks; do
 		dst=$hooks/$hook
@@ -346,8 +364,9 @@ sample_hooks=
 
 	if test -n "$sample_hooks"; then
 	    for hook in $sample_hooks; do
+		git_sample_hook_src $hook
 		dst=$hooks/$hook
-		cp $cp_options -- "$dst.sample" "$dst" || exit
+		cp $cp_options -- "$src" "$dst" || exit
 		chmod -- a-w "$dst" || exit
 	    done
 	fi
-- 
2.7.4


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

* Re: Why does make run git?
  2017-08-15 20:39                 ` Paul Eggert
@ 2017-08-16 12:30                   ` Andy Moreton
  2017-08-16 12:38                     ` Noam Postavsky
  2017-08-16 12:49                     ` Andreas Schwab
  2017-08-16 14:09                   ` Ted Zlatanov
  1 sibling, 2 replies; 29+ messages in thread
From: Andy Moreton @ 2017-08-16 12:30 UTC (permalink / raw)
  To: emacs-devel

On Tue 15 Aug 2017, Paul Eggert wrote:

> Ted Zlatanov wrote:
>
>> I think CONTRIBUTE should mention, right after saying to run autogen.sh,
>> that the above requires Git to be installed.
>
> autogen.sh is not supposed to require Git, so let's fix autogen.sh instead.
>
>
>> 'build-aux/git-hooks/commit-msg' -> '.git/hooks/commit-msg'
>> cp: cannot create regular file '.git/hooks/commit-msg': No such file or directory
>> ERROR: Job failed: exit code 1
>> #+end_src
>>
>> So it looks like it assumes that `.git/hooks' exists. I don't know why
>> that's not true in the GitLab checkout.
>
> I don't know why either. I wonder what other compatibility mines remain
> unexploded in the GitLab field? Anyway, I installed the attached, which should
> work around this particular problem without having to complicate the
> configuration instructions.

Is it possible that gitlab is using git worktrees, in which case .git in
the worktree is a regular file and not a directory ? See the DETAILS
section of the git-worktree manpage for an example.

    AndyM




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

* Re: Why does make run git?
  2017-08-16 12:30                   ` Andy Moreton
@ 2017-08-16 12:38                     ` Noam Postavsky
  2017-08-16 12:49                     ` Andreas Schwab
  1 sibling, 0 replies; 29+ messages in thread
From: Noam Postavsky @ 2017-08-16 12:38 UTC (permalink / raw)
  To: Andy Moreton; +Cc: Emacs developers

On Wed, Aug 16, 2017 at 8:30 AM, Andy Moreton <andrewjmoreton@gmail.com> wrote:

>>> 'build-aux/git-hooks/commit-msg' -> '.git/hooks/commit-msg'
>>> cp: cannot create regular file '.git/hooks/commit-msg': No such file or directory
>>> ERROR: Job failed: exit code 1
>>> #+end_src
>>>
>>> So it looks like it assumes that `.git/hooks' exists. I don't know why
>>> that's not true in the GitLab checkout.
>>
>> I don't know why either. I wonder what other compatibility mines remain
>> unexploded in the GitLab field? Anyway, I installed the attached, which should
>> work around this particular problem without having to complicate the
>> configuration instructions.
>
> Is it possible that gitlab is using git worktrees, in which case .git in
> the worktree is a regular file and not a directory ?

We already fixed autogen.sh for git worktrees last year.

[1: 403cc9f]: 2016-05-04 21:11:37 -0700
  Fix autogen.sh for separate worktrees
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=403cc9fad9534338050b0ce14941e3d9cd30079a



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

* Re: Why does make run git?
  2017-08-16 12:30                   ` Andy Moreton
  2017-08-16 12:38                     ` Noam Postavsky
@ 2017-08-16 12:49                     ` Andreas Schwab
  1 sibling, 0 replies; 29+ messages in thread
From: Andreas Schwab @ 2017-08-16 12:49 UTC (permalink / raw)
  To: Andy Moreton; +Cc: emacs-devel

On Aug 16 2017, Andy Moreton <andrewjmoreton@gmail.com> wrote:

> On Tue 15 Aug 2017, Paul Eggert wrote:
>
>> Ted Zlatanov wrote:
>>
>>> I think CONTRIBUTE should mention, right after saying to run autogen.sh,
>>> that the above requires Git to be installed.
>>
>> autogen.sh is not supposed to require Git, so let's fix autogen.sh instead.
>>
>>
>>> 'build-aux/git-hooks/commit-msg' -> '.git/hooks/commit-msg'
>>> cp: cannot create regular file '.git/hooks/commit-msg': No such file or directory
>>> ERROR: Job failed: exit code 1
>>> #+end_src
>>>
>>> So it looks like it assumes that `.git/hooks' exists. I don't know why
>>> that's not true in the GitLab checkout.
>>
>> I don't know why either. I wonder what other compatibility mines remain
>> unexploded in the GitLab field? Anyway, I installed the attached, which should
>> work around this particular problem without having to complicate the
>> configuration instructions.
>
> Is it possible that gitlab is using git worktrees, in which case .git in
> the worktree is a regular file and not a directory ?

.git must already exist as a directory, otherwise '.git/config' ->
'.git/config.~1~' wouldn't have worked.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



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

* Re: Why does make run git?
  2017-08-15 20:39                 ` Paul Eggert
  2017-08-16 12:30                   ` Andy Moreton
@ 2017-08-16 14:09                   ` Ted Zlatanov
  1 sibling, 0 replies; 29+ messages in thread
From: Ted Zlatanov @ 2017-08-16 14:09 UTC (permalink / raw)
  To: emacs-devel

On Tue, 15 Aug 2017 13:39:24 -0700 Paul Eggert <eggert@cs.ucla.edu> wrote: 

PE> Ted Zlatanov wrote:

>> 'build-aux/git-hooks/commit-msg' -> '.git/hooks/commit-msg'
>> cp: cannot create regular file '.git/hooks/commit-msg': No such file or directory
>> ERROR: Job failed: exit code 1
>> #+end_src
>> 
>> So it looks like it assumes that `.git/hooks' exists. I don't know why
>> that's not true in the GitLab checkout.

PE> I don't know why either. I wonder what other compatibility mines remain
PE> unexploded in the GitLab field?

The GitLab build is working now, and I'll try to fix or mention any
future CI issues when we migrate to our own GitLab CE server.

PE> Anyway, I installed the attached, which should
PE> work around this particular problem without having to complicate the
PE> configuration instructions.

Thank you very much for working on this.

Ted




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

end of thread, other threads:[~2017-08-16 14:09 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-01  1:19 Why does make run git? Richard Stallman
2017-08-01  3:07 ` Eli Zaretskii
2017-08-01 14:30   ` Richard Stallman
2017-08-01 14:49     ` Tino Calancha
2017-08-02 17:26       ` Richard Stallman
2017-08-02 17:43         ` Radon Rosborough
2017-08-03 19:43           ` Richard Stallman
2017-08-03 20:02             ` Radon Rosborough
2017-08-02 17:56         ` Paul Eggert
2017-08-02 18:31           ` Eli Zaretskii
2017-08-02 18:42             ` Paul Eggert
2017-08-02 19:10               ` Eli Zaretskii
2017-08-02 20:04                 ` Paul Eggert
2017-08-12 16:11                   ` Paul Eggert
2017-08-15 14:18           ` Ted Zlatanov
2017-08-15 15:52             ` Paul Eggert
2017-08-15 16:58               ` Ted Zlatanov
2017-08-15 17:08                 ` Eli Zaretskii
2017-08-15 20:39                 ` Paul Eggert
2017-08-16 12:30                   ` Andy Moreton
2017-08-16 12:38                     ` Noam Postavsky
2017-08-16 12:49                     ` Andreas Schwab
2017-08-16 14:09                   ` Ted Zlatanov
2017-08-01  3:14 ` Tino Calancha
2017-08-02 17:25   ` Richard Stallman
2017-08-01 15:10 ` Paul Eggert
2017-08-01 15:15   ` Kaushal Modi
2017-08-01 16:01 ` Radon Rosborough
2017-08-02 17:30   ` Richard Stallman

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).