Re: tracking perms/ownership

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Friday, August 24, 2007 - 1:37 pm

"Josh England" <jjengla@sandia.gov> writes:


But to use that data you would need extra code to move things
from there to gitattributes, wouldn't you?  I can see that you
could "stage" change of ownership in the index and attempt to
commit by nonexisting

	git update-index --chown root foo.c

which would say "foo.c is now owned by uid #0", but before the
next git-commit-tree runs, somebody (namely, "git-commit") has
to run a possibly enhanced "git diff-files" (traditionally
uid/gid are NOT part of contents at all, so diff-files would not
say ownership has changed between the filesystem and index in
what way at all) to notice that ownership has changed, and
update .gitattributes.

Then you need to also "git update-index" the .gitattributes as
well, to record the ownership change in the commit.  What if the
user had unrelated changes that the user does not want to commit
in .gitattributes?

It will quickly become a mess.

It would rather be more effective for the user action "I want to
change the ownership of foo.c to root" to cause a direct
manipulation of .gitattributes file.  For this, we can add a
nice wrapper if there is a need, but the initial cut could be
just running "${EDITOR-${VISUAL-vi}} .gitattributes", nothing
more.

The user can say "git diff" to view .gitattributes changes, and
if that is what he wants (maybe he wants to do "git add -i" to
pick only the hunk about the ownership change for the next
commit), the change to .gitattributes can be committed.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
empty directories, Josh England, (Tue Aug 21, 10:14 am)
Re: empty directories, Sean, (Tue Aug 21, 10:40 am)
Re: empty directories, Salikh Zakirov, (Tue Aug 21, 9:31 pm)
Re: empty directories, Linus Torvalds, (Wed Aug 22, 11:46 am)
Re: empty directories, Josh England, (Wed Aug 22, 2:25 pm)
Re: empty directories, Linus Torvalds, (Wed Aug 22, 4:25 pm)
Re: empty directories, David Kastrup, (Wed Aug 22, 4:55 pm)
Re: empty directories, Josh England, (Thu Aug 23, 8:24 am)
tracking perms/ownership [was: empty directories], Josh England, (Thu Aug 23, 2:51 pm)
Re: tracking perms/ownership, Junio C Hamano, (Thu Aug 23, 3:08 pm)
Re: tracking perms/ownership, Linus Torvalds, (Thu Aug 23, 4:30 pm)
Re: tracking perms/ownership, David Kastrup, (Thu Aug 23, 11:16 pm)
Re: tracking perms/ownership, Linus Torvalds, (Thu Aug 23, 11:37 pm)
Re: tracking perms/ownership, Josh England, (Fri Aug 24, 12:22 am)
Re: tracking perms/ownership, Josh England, (Fri Aug 24, 12:38 am)
Re: tracking perms/ownership, Junio C Hamano, (Fri Aug 24, 12:39 am)
Re: tracking perms/ownership, David Kastrup, (Fri Aug 24, 12:50 am)
Re: tracking perms/ownership, Josh England, (Fri Aug 24, 1:19 am)
Re: tracking perms/ownership [was: empty directories], Johannes Schindelin, (Fri Aug 24, 2:38 am)
Re: tracking perms/ownership [was: empty directories], Josh England, (Fri Aug 24, 8:50 am)
Re: tracking perms/ownership, Josh England, (Fri Aug 24, 9:11 am)
Re: tracking perms/ownership, Josh England, (Fri Aug 24, 9:27 am)
RE: empty directories, Jason Garber, (Fri Aug 24, 10:10 am)
Re: tracking perms/ownership, Linus Torvalds, (Fri Aug 24, 10:51 am)
Re: tracking perms/ownership, Josh England, (Fri Aug 24, 11:15 am)
Re: tracking perms/ownership, Linus Torvalds, (Fri Aug 24, 11:23 am)
Re: tracking perms/ownership, Josh England, (Fri Aug 24, 11:56 am)
Re: tracking perms/ownership, Robin Rosenberg, (Fri Aug 24, 12:33 pm)
Re: tracking perms/ownership, Junio C Hamano, (Fri Aug 24, 1:37 pm)
Re: tracking perms/ownership, Josh England, (Fri Aug 24, 2:26 pm)
Re: tracking perms/ownership, David Kastrup, (Fri Aug 24, 2:30 pm)
Re: tracking perms/ownership [was: empty directories], Johannes Schindelin, (Sat Aug 25, 7:30 am)
Re: tracking perms/ownership [was: empty directories], Johannes Schindelin, (Sat Aug 25, 7:31 am)
Re: tracking perms/ownership, Junio C Hamano, (Sat Aug 25, 7:46 am)
Re: tracking perms/ownership, Junio C Hamano, (Sat Aug 25, 12:35 pm)