Skip to contentSkip to conversation

Fix wrong info in `INSTALL`

PATCH In review Shao-Ce SUN via GitGitGadget 5 participants 6 messages May 24, 2022 – May 25, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix wrong info in `INSTALL`

From: Shao-Ce SUN <[email protected]>

The user prompt should be $ instead of #.

---
Fix wrong info in INSTALL

The user prompt should be $ instead of #.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1241%2Fsunshaoce%2Finstall-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1241/sunshaoce/install-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1241

 INSTALL | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
INSTALL +6 -6
index 4140a3f5c8b..7bb3f48311d 100644
@@ -5,8 +5,8 @@ Normally you can just do "make" followed by "make install", and that
 will install the git programs in your own ~/bin/ directory.  If you want
 to do a global install, you can do
 
-	$ make prefix=/usr all doc info ;# as yourself
-	# make prefix=/usr install install-doc install-html install-info ;# as root
+	$ make prefix=/usr all doc info ; $ as yourself
+	# make prefix=/usr install install-doc install-html install-info ; # as root
 
 (or prefix=/usr/local, of course).  Just like any program suite
 that uses $prefix, the built results have some paths encoded,
@@ -20,10 +20,10 @@ config.mak file.
 Alternatively you can use autoconf generated ./configure script to
 set up install paths (via config.mak.autogen), so you can write instead
 
-	$ make configure ;# as yourself
-	$ ./configure --prefix=/usr ;# as yourself
-	$ make all doc ;# as yourself
-	# make install install-doc install-html;# as root
+	$ make configure ; $ as yourself
+	$ ./configure --prefix=/usr ; $ as yourself
+	$ make all doc ; $ as yourself
+	# make install install-doc install-html; # as root
 
 If you're willing to trade off (much) longer build time for a later
 faster git you can also do a profile feedback build with

base-commit: 7a3eb286977746bc09a5de7682df0e5a7085e17c

Signature · 1 line
gitgitgadget
#1 lore raw
Quoted 48 lines · Shao-Ce SUN via GitGitGadget

From: Shao-Ce SUN <[email protected]>

The user prompt should be $ instead of #.

---
Fix wrong info in INSTALL

The user prompt should be $ instead of #.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1241%2Fsunshaoce%2Finstall-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1241/sunshaoce/install-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1241

 INSTALL | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
INSTALL +6 -6
index 4140a3f5c8b..7bb3f48311d 100644
@@ -5,8 +5,8 @@ Normally you can just do "make" followed by "make install", and that
 will install the git programs in your own ~/bin/ directory.  If you want
 to do a global install, you can do
 
-	$ make prefix=/usr all doc info ;# as yourself
-	# make prefix=/usr install install-doc install-html install-info ;# as root
+	$ make prefix=/usr all doc info ; $ as yourself
+	# make prefix=/usr install install-doc install-html install-info ; # as root
 
 (or prefix=/usr/local, of course).  Just like any program suite
 that uses $prefix, the built results have some paths encoded,
@@ -20,10 +20,10 @@ config.mak file.
 Alternatively you can use autoconf generated ./configure script to
 set up install paths (via config.mak.autogen), so you can write instead
 
-	$ make configure ;# as yourself
-	$ ./configure --prefix=/usr ;# as yourself
-	$ make all doc ;# as yourself
-	# make install install-doc install-html;# as root
+	$ make configure ; $ as yourself
+	$ ./configure --prefix=/usr ; $ as yourself
+	$ make all doc ; $ as yourself
+	# make install install-doc install-html; # as root
 
 If you're willing to trade off (much) longer build time for a later
 faster git you can also do a profile feedback build with
Quoted 1 line

base-commit: 7a3eb286977746bc09a5de7682df0e5a7085e17c

This looks good to me, FWIW I dug into this slightly and didn't know that POSIX had this to say about it:

This variable is used for interactive prompts. Historically, the "superuser" has had a prompt of '#'. Since privileges are not required to be monolithic, it is difficult to define which privileges should cause the alternate prompt. However, a sufficiently powerful user should be reminded of that power by having an alternate prompt.

See https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_05_03

The one suggestion I have here is that the $subject should be clearer, e.g.:

INSTALL: use '#', not '$' for root-run command prompt

Which in this case would both be better in --oneline output, and be enough to get rid of the commit message body entirely (unless it wished to say something more on the subject).

#2 lore raw

Hi Shao-Ce,

Le 2022-05-24 à 17:39, Ævar Arnfjörð Bjarmason a écrit :

Quoted 28 lines · Shao-Ce SUN via GitGitGadget
Quoted 26 lines

From: Shao-Ce SUN <[email protected]>

The user prompt should be $ instead of #.

---
Fix wrong info in INSTALL

The user prompt should be $ instead of #.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1241%2Fsunshaoce%2Finstall-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1241/sunshaoce/install-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1241

 INSTALL | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
INSTALL +0 -0
index 4140a3f5c8b..7bb3f48311d 100644
@@ -5,8 +5,8 @@ Normally you can just do "make" followed by "make install", and that
 will install the git programs in your own ~/bin/ directory.  If you want
 to do a global install, you can do
 
Quoted 4 lines

INSTALL Normally you can just do "make" followed by "make install", and that · line 9

Quoted 4 lines
INSTALL +2 -2
-	$ make prefix=/usr all doc info ;# as yourself
-	# make prefix=/usr install install-doc install-html install-info ;# as root
+	$ make prefix=/usr all doc info ; $ as yourself
+	# make prefix=/usr install install-doc install-html install-info ; # as root

The prompt for the first invocation is already '$',
what you are changing in the first line is the '# as yourself' comment which is a shell comment and thus uses '#'. This allows
the whole line to be pasted as-is.

The second line is supposed to be ran as root and already has '#' as prompt, and also has '# as root' as a comment, which you simply prefix with a space.

I don't think there is anything to "fix" here...

Quoted 7 lines
Quoted 7 lines
INSTALL +0 -0
 (or prefix=/usr/local, of course).  Just like any program suite
 that uses $prefix, the built results have some paths encoded,
@@ -20,10 +20,10 @@ config.mak file.
 Alternatively you can use autoconf generated ./configure script to
 set up install paths (via config.mak.autogen), so you can write instead
 
Quoted 8 lines

INSTALL config.mak file. · line 26

Quoted 8 lines
INSTALL +4 -4
-	$ make configure ;# as yourself
-	$ ./configure --prefix=/usr ;# as yourself
-	$ make all doc ;# as yourself
-	# make install install-doc install-html;# as root
+	$ make configure ; $ as yourself
+	$ ./configure --prefix=/usr ; $ as yourself
+	$ make all doc ; $ as yourself
+	# make install install-doc install-html; # as root

Same here.

#3 lore raw
In reply to Shao-Ce SUN via GitGitGadget

INSTALL Normally you can just do "make" followed by "make install", and that · line 8

Quoted 3 lines · Shao-Ce SUN via GitGitGadget
INSTALL +1 -2
-	$ make prefix=/usr all doc info ;# as yourself
-	# make prefix=/usr install install-doc install-html install-info ;# as root
+	$ make prefix=/usr all doc info ; $ as yourself

This and all the changes in the patch is wrong, but it is not entirely your fault. You need to know the shell syntax.

The semicolon in ";#" is an end of one command (i.e. "make"), and the hash is "start of comment--ignore the rest of the line.

If you replace # with $, then "$ as yourself" would be fed to the shell because $ is not a comment introducer. The command line no longer can be copied and pasted, starting from "make" to the end of the line.

Thanks.

#4 lore raw
In reply to Shao-Ce SUN via GitGitGadget
Quoted 4 lines · Shao-Ce SUN via GitGitGadget

From: Shao-Ce SUN <[email protected]>

The user prompt should be $ instead of #.

On the following lines:

$ make prefix=/usr all doc info ;# as yourself
# make prefix=/usr install install-doc install-html install-info ;# as root

the '$' or '#' before "make" is indeed a prompt, but the '#' before "as" starts a single line comment. So there is no need to change it into a '$'.

See for example:

https://tldp.org/LDP/abs/html/abs-guide.html#SPECIAL-CHARS

One issue with the above lines could be that there is no space character before the '#' that starts the comments. The ';' is a command separator character though, and I think that when a new command starts with '#' it's considered a comment.

So we could perhaps get rid of the ';', but on the other hand ";#" should make it extra clear that the command before it ended and that the rest of the line is a comment.

Quoted 3 lines

---
Fix wrong info in INSTALL

Instead of "info" you could say something more specific like "prompt character".

Also we start commit subjects with the area of the code, so maybe "INSTALL: fix wrong prompt character".

INSTALL Normally you can just do "make" followed by "make install", and that · line 8

Quoted 11 lines
INSTALL +1 -2
index 4140a3f5c8b..7bb3f48311d 100644
@@ -5,8 +5,8 @@ Normally you can just do "make" followed by "make install", and that
 will install the git programs in your own ~/bin/ directory.  If you want
 to do a global install, you can do
 
-       $ make prefix=/usr all doc info ;# as yourself
-       # make prefix=/usr install install-doc install-html install-info ;# as root
+       $ make prefix=/usr all doc info ; $ as yourself

Here a '#' is changed into a '$' but also a space character is inserted before the '$' without any explanation.

INSTALL Normally you can just do "make" followed by "make install", and that · line 9

Quoted 1 line
INSTALL +1 -0
+       # make prefix=/usr install install-doc install-html install-info ; # as root

Here only a space character is inserted before the second '#' without any explanation.

#5 lore raw
Quoted 3 lines · Christian Couder

So we could perhaps get rid of the ';', but on the other hand ";#" should make it extra clear that the command before it ended and that the rest of the line is a comment.

True. In modern shells, ";" in the ";#" sequence may not be necessary, but consistently writing ";#" as if it were a single token would probably be a good idea in the documentation.

Of course, if we can declare that the usefulness of the monospace plain text document does not matter, we could do without ";#" and typeset the comment (and the prompt) in different font and/or color. It would make it easier to see which part of the line is what is to be typed verbatim.

Thanks.