[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:
- [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, 2020/04/25
- [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 <=
- [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