From: "Matt Pearson" <404emailnotfound@gmail.com>
To: "Alexander E Genaud" <alex@genaud.net>
Cc: git@vger.kernel.org
Subject: Re: git-pull sets write bit, git-push does not
Date: Sat, 2 Aug 2008 19:18:15 -0400 [thread overview]
Message-ID: <706b4240808021618y5604b7c9h915237c30d87dace@mail.gmail.com> (raw)
In-Reply-To: <ee521d6f0808021532k66bc5b24ma2eeb51021fb5f36@mail.gmail.com>
On Sat, Aug 2, 2008 at 6:32 PM, Alexander E Genaud <alex@genaud.net> wrote:
> 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?
Push and pull are not opposite operations: the opposite of push is
fetch. This is because pull updates the working copy, while push does
not (like fetch, it only modifies the ref).
>
> 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
>
After running this:
$ cat A
A
$ cat ../r1/A
AA
The working copy in r2 was not updated with the changes you pushed to
it (both the content and the mode change).
next prev parent reply other threads:[~2008-08-02 23:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-02 22:32 git-pull sets write bit, git-push does not Alexander E Genaud
2008-08-02 23:18 ` Matt Pearson [this message]
2008-08-03 1:15 ` Matt Pearson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=706b4240808021618y5604b7c9h915237c30d87dace@mail.gmail.com \
--to=404emailnotfound@gmail.com \
--cc=alex@genaud.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).