lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master c78c9aa 06/14: Reduce differences between git


From: Greg Chicares
Subject: [lmi-commits] [lmi] master c78c9aa 06/14: Reduce differences between git scripts
Date: Sat, 25 Apr 2020 17:43:13 -0400 (EDT)

branch: master
commit c78c9aaa8eeb4773ec49acea36d72ace740de52a
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Reduce differences between git scripts
    
    Now both these scripts explain and test umask more similarly, making
    it more clear that only one of them alters umask.
---
 gwc/share_git1.sh | 22 ++++++++++------------
 gwc/share_git2.sh | 10 +++++++++-
 2 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/gwc/share_git1.sh b/gwc/share_git1.sh
index 3a58857..d65e9b9 100755
--- a/gwc/share_git1.sh
+++ b/gwc/share_git1.sh
@@ -7,9 +7,17 @@
 #   https://lists.nongnu.org/archive/html/lmi/2020-03/msg00016.html
 #   https://public-inbox.org/git/address@hidden/T/#u
 
+set -v
+
 # Like 'share_git2.sh', but creates a bare repository.
 
-set -v
+# Expect 022 here:
+umask
+# The FETCH_HEAD permission problem doesn't arise if umask is 002,
+# so one option is to execute
+#   umask 002
+# That affects only the shell in which this script runs, but it has a
+# persistent effect if run at the command line.
 
 # Start with a fresh throwaway directory.
 cd /tmp || exit
@@ -25,11 +33,6 @@ getent group audio
 # are treated as 'less' commands.
 sudo --user=pulse true
 
-# There would be no problem below if umask were 002, so one option
-# is to execute
-#   umask 002
-# so that FETCH_HEAD's permissions don't have to be changed below.
-
 # First method: emulate git-clone as three git commands, with
 # a single 'chgrp' call at exactly the right spot.
 
@@ -57,13 +60,8 @@ sudo --user=pulse git -C manual.git fetch
 
 # Second method: git-clone --bare --config core.SharedRepository=group
 
-# expect 022 here:
-umask
-# There is no problem below if umask is 002, so one option
-# is to execute
+# Instead of changing FETCH_HEAD's permissions below:
 umask 002
-# here. That affects only the shell in which this script runs,
-# though it has a persistent effect if run at the command line.
 
 chgrp audio .
 chmod g+ws .
diff --git a/gwc/share_git2.sh b/gwc/share_git2.sh
index 383ee99..2c7b9ed 100755
--- a/gwc/share_git2.sh
+++ b/gwc/share_git2.sh
@@ -7,9 +7,17 @@
 #   https://lists.nongnu.org/archive/html/lmi/2020-03/msg00016.html
 #   https://public-inbox.org/git/address@hidden/T/#u
 
+set -v
+
 # Like 'share_git1.sh', but creates a non-bare repository.
 
-set -v
+# Expect 022 here:
+umask
+# The FETCH_HEAD permission problem doesn't arise if umask is 002,
+# so one option is to execute
+#   umask 002
+# That affects only the shell in which this script runs, but it has a
+# persistent effect if run at the command line.
 
 # Start with a fresh throwaway directory.
 cd /tmp || exit



reply via email to

[Prev in Thread] Current Thread [Next in Thread]