lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 032d679 02/14: Reduce gratuitous differences


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 032d679 02/14: Reduce gratuitous differences between git scripts
Date: Sat, 25 Apr 2020 17:43:12 -0400 (EDT)

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

    Reduce gratuitous differences between git scripts
---
 gwc/share_git1.sh | 14 +++++++++++---
 gwc/share_git2.sh |  7 +++++--
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/gwc/share_git1.sh b/gwc/share_git1.sh
index 46e4795..a68a040 100755
--- a/gwc/share_git1.sh
+++ b/gwc/share_git1.sh
@@ -7,6 +7,8 @@
 #   https://lists.nongnu.org/archive/html/lmi/2020-03/msg00016.html
 #   https://public-inbox.org/git/address@hidden/T/#u
 
+# Like 'share_git2.sh', but creates a bare repository.
+
 set -v
 
 # Start with a fresh throwaway directory.
@@ -15,7 +17,7 @@ rm -rf /tmp/eraseme
 mkdir -p /tmp/eraseme
 cd /tmp/eraseme || exit
 
-# expect group users to include 'pulse' as well as normal user:
+# Expect group users to include 'pulse' as well as normal user:
 getent group audio
 
 # Get this over with early. Reason: if script is piped into 'less',
@@ -31,6 +33,7 @@ sudo --user=pulse true
 # First method: emulate git-clone as three git commands, with
 # a single 'chgrp' call at exactly the right spot.
 
+# The crux of this method is 'git init':
 git init --bare --shared manual.git
 chgrp -R audio manual.git
 git -C manual.git remote add origin https://github.com/wxWidgets/zlib.git
@@ -44,7 +47,7 @@ ls -l ./manual.git/FETCH_HEAD
 # that of the second method, below.
 git -C manual.git pack-refs --all
 
-# this succeeds when run by owner:
+# This succeeds when run by owner:
 git -C manual.git fetch
 # this fails:
 sudo --user=pulse git -C manual.git fetch
@@ -65,8 +68,9 @@ umask 002
 chgrp audio .
 chmod g+ws .
 
+# The crux of this method is 'git clone':
 git clone --jobs=32 --bare --config core.SharedRepository=group 
https://github.com/wxWidgets/zlib.git
-# this succeeds when run by owner:
+# This succeeds when run by owner:
 git -C zlib.git fetch
 # this succeeds (but not without 'umask 002' above):
 sudo --user=pulse git -C zlib.git fetch
@@ -85,3 +89,7 @@ du -sb zlib.git manual.git
 git -C zlib.git fsck
 git -C manual.git fsck
 
+# List all files' permissions for comparison, e.g.:
+#   meld /srv/chroot/bullseye0/tmp/eraseme/ls-* &
+cd /tmp/eraseme/manual.git && ls -alR >/tmp/eraseme/ls-manual.git
+cd /tmp/eraseme/zlib.git   && ls -alR >/tmp/eraseme/ls-zlib.git
diff --git a/gwc/share_git2.sh b/gwc/share_git2.sh
index 8d2beac..4f19558 100755
--- a/gwc/share_git2.sh
+++ b/gwc/share_git2.sh
@@ -7,7 +7,7 @@
 #   https://lists.nongnu.org/archive/html/lmi/2020-03/msg00016.html
 #   https://public-inbox.org/git/address@hidden/T/#u
 
-# Unlike 'share_git1.sh', this script creates a non-bare repository.
+# Like 'share_git1.sh', but creates a non-bare repository.
 
 set -v
 
@@ -29,8 +29,10 @@ sudo --user=pulse true
 # a single 'chgrp' call at exactly the right spot.
 
 mkdir nonbare
-# Need to run 'chmod' because git didn't create this directory.
+# Need to run 'chmod' because git doesn't create this directory.
 chmod g+sw nonbare
+
+# The crux of this method is 'git init':
 git init --shared nonbare
 chgrp -R audio nonbare
 git -C nonbare remote add origin https://github.com/wxWidgets/zlib.git
@@ -59,6 +61,7 @@ chmod -R g=u nonbare
 
 # Second method: git-clone, and fix up permissions manually
 
+# The crux of this method is 'git clone':
 git clone --jobs=32 --config core.SharedRepository=group 
https://github.com/wxWidgets/zlib.git
 chgrp -R audio zlib
 # This is better than 'chmod -R g+s' (it affects only directories):



reply via email to

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