git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-pull sets write bit, git-push does not
@ 2008-08-02 22:32 Alexander E Genaud
  2008-08-02 23:18 ` Matt Pearson
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander E Genaud @ 2008-08-02 22:32 UTC (permalink / raw)
  To: git

git-pull sets write bit, git-push does not

Hello,

Background: I am using Git locally with ClearCase upstream. I
initialized a Git repository on top of a ClearCase snapshot view,
while my work branches are in a clone. As ClearCase is particular
about the write bit, I have come to depend on an undocumented feature
of Git. Namely, that git-push preserves read only permissions, while
git-pull sets modified files writable.

Can git-push be relied upon to preserve the write bit (readonly)? Why
is git-pull different? Is it a side effect of the plumbing?

Thanks,
Alex

http://genaud.net/2008/08/clearcase-globally-git-locally/


Simplified case:

echo --
echo create a repo r1 with files A and B committed
echo --
mkdir r1
cd r1
echo A > A
echo B > B
git init
git add .
git commit -m init

echo --
echo create an identical repo r2 whose files are readonly
echo --
cp -r ../r1 ../r2
chmod u-w ../r2/[AB]

echo --
echo push a modification of A from r1 to r2
echo --
echo AA > A
git commit -a -m modA
git push ../r2

echo --
echo pull a modification of B from r1 to r2
echo --
echo BB > B
git commit -a -m modB
cd ../r2
git pull ../r1

echo --
echo notice that pushed A remains readonly
echo while pulled B has become writable
echo --
ls -l


-- 
[ alex@genaud.net ][ http://genaud.net ]
[ B068 ED90 F47B 0965 2953 9FC3 EE9C C4D5 3E51 A207 ]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-03  1:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-02 22:32 git-pull sets write bit, git-push does not Alexander E Genaud
2008-08-02 23:18 ` Matt Pearson
2008-08-03  1:15   ` Matt Pearson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).