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

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

 



On Sat, Aug 2, 2008 at 7:18 PM, Matt Pearson <404emailnotfound@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux