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 21:15:53 -0400 [thread overview]
Message-ID: <706b4240808021815h68db2179y7ceb35501f7f4f66@mail.gmail.com> (raw)
In-Reply-To: <706b4240808021618y5604b7c9h915237c30d87dace@mail.gmail.com>
On Sat, Aug 2, 2008 at 7:18 PM, Matt Pearson <404emailnotfound@gmail.com> wrote:
> The working copy in r2 was not updated with the changes you pushed to
> it (both the content and the mode change).
Hm, your test case is more complicated than I originally thought. I
get that result with the git from Ubuntu Hardy, but current master
dies on the pull complaining B is not uptodate (has local changes). I
guess this was a bug that was fixed, but there's no way I'm going to
bisect or look at release notes over half a year (or more) of changes
:)
What it mainly comes down to is that git has only two possible file
modes: 644 and 755. These are the only ones that will ever be stored
in the object database. It seems like older git would ignore
permission changes to the working copy, and reset the permissions to
the "normalized" version when updating a file that was modified by the
pull.
Here's a blow-by-blow explanation. I'll use numbers to refer to the
commits, where 1 is the initial commit, 2 is the commit you pushed,
and 3 is the one you pulled. After the cp -r, both repos have a clean
working tree; the chmod dirties the working tree of r2.
The push causes both repos to have 2 be the HEAD commit, but r2 keeps
the dirty working tree changes, including (what now appears to be,
from git's POV) a change in the content of A from 'AA' to the 'A' in
the initial commit. (The content change will appear as a staged change
when running status in r2, because the index isn't updated either)
When pulling 3, git thinks that these changes were made on top of 2,
and you want to keep them. So it doesn't modify the contents of A
because A was not changed in commit 3---if it was, you'd get a "not
uptodate" message.
B, however, *was* changed in 3, so it tries to apply those changes.
With the older version, it seems to ignore the permissions change and
simply fast-forward to the state B was in after commit 3 (content
'BB', mode 644). With the newer version, it does see that the mode has
been changed, and aborts due to a conflict. In fact, it doesn't seem
to like any mode change---it still dies with a conflict if I change
the chmod to 'a+x'.
Hope that clears it up better---figuring this out helped me learn some
stuff about git. Now I'll wait for someone more knowledgeable than I
to tell me I'm wrong. :)
Matt
prev parent reply other threads:[~2008-08-03 1:17 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
2008-08-03 1:15 ` Matt Pearson [this message]
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=706b4240808021815h68db2179y7ceb35501f7f4f66@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).