[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
- [lmi-commits] [lmi] master updated (f4054dc -> 9f235b6), Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 16a146d 03/14: Correct flaws in git script documentation, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 032d679 02/14: Reduce gratuitous differences between git scripts, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 655214a 01/14: Note progress on git FETCH_HEAD permission issue, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master c78c9aa 06/14: Reduce differences between git scripts,
Greg Chicares <=
- [lmi-commits] [lmi] master 02f33b5 07/14: Don't rely on a nondefault umask, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master d432bc8 09/14: Improve documentation of git scripts, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 28dbf67 08/14: Reduce differences between git scripts, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 063d24d 04/14: Reduce differences between git scripts, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 38a6c93 12/14: Let git create its own directory, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 9f235b6 14/14: Don't mess with GID or permissions of $PWD, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 3dace32 05/14: Check permissions more thoroughly, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master aedc8d0 11/14: Detect files that aren't group writable, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 03f3b23 10/14: Reorder statements in a git script; improve documentation, Greg Chicares, 2020/04/25
- [lmi-commits] [lmi] master 7944d8e 13/14: Detect files that have an unexpected GID, Greg Chicares, 2020/04/25