lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 063d24d 04/14: Reduce differences between git


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

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

    Reduce differences between git scripts
    
    Instead of showing 'ls -l' for FETCH_HEAD only, show it for *HEAD, to
    make the difference obvious.
    
    Instead of fixing FETCH_HEAD permissions and then showing that git-fetch
    works for all users: show failure, fix permissions, then show success.
---
 gwc/share_git1.sh |  2 +-
 gwc/share_git2.sh | 18 ++++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/gwc/share_git1.sh b/gwc/share_git1.sh
index 2e693ba..44551a2 100755
--- a/gwc/share_git1.sh
+++ b/gwc/share_git1.sh
@@ -41,7 +41,7 @@ git -C manual.git fetch origin
 
 find ./manual.git ! -perm -g=w |sed -e'/objects\/pack/d'
 # Oops: FETCH_HEAD doesn't have group permissions:
-ls -l ./manual.git/FETCH_HEAD
+ls -l ./manual.git/*HEAD
 
 # This isn't really necessary; it just makes the result look more like
 # that of the second method, below.
diff --git a/gwc/share_git2.sh b/gwc/share_git2.sh
index 926dd5d..377a820 100755
--- a/gwc/share_git2.sh
+++ b/gwc/share_git2.sh
@@ -40,9 +40,7 @@ git -C nonbare fetch origin
 
 find ./nonbare ! -perm -g=w |sed -e'/objects\/pack/d'
 # Oops: FETCH_HEAD doesn't have group permissions:
-ls -l ./nonbare/.git/FETCH_HEAD
-chmod g+w nonbare/.git/FETCH_HEAD
-ls -l ./nonbare/.git/FETCH_HEAD
+ls -l ./nonbare/.git/*HEAD
 
 # This isn't really necessary; it just makes the result look more like
 # that of the second method, below.
@@ -53,7 +51,10 @@ git -C nonbare checkout master
 
 # This succeeds when run by owner:
 git -C nonbare fetch
-# This succeeds because FETCH_HEAD's permissions were fixed above:
+# this fails:
+sudo --user=pulse git -C nonbare fetch
+# but it succeeds if FETCH_HEAD's permissions are fixed:
+chmod g+w nonbare/.git/FETCH_HEAD
 sudo --user=pulse git -C nonbare fetch
 
 # Need to do this after fetching, for the worktree.
@@ -79,11 +80,12 @@ git -C zlib fetch
 
 find ./zlib ! -perm -g=w |sed -e'/objects\/pack/d'
 # Oops: FETCH_HEAD doesn't have group permissions:
-ls -l ./zlib/.git/FETCH_HEAD
-chmod g+w zlib/.git/FETCH_HEAD
-ls -l ./zlib/.git/FETCH_HEAD
+ls -l ./zlib/.git/*HEAD
 
-# This succeeds because FETCH_HEAD's permissions were fixed above:
+# This fails:
+sudo --user=pulse git -C zlib fetch
+# but it succeeds if FETCH_HEAD's permissions are fixed:
+chmod g+w zlib/.git/FETCH_HEAD
 sudo --user=pulse git -C zlib fetch
 
 # The two methods produce somewhat similar results. Sizes:



reply via email to

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