git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [Request] Git reset should be able to ignore file permissions
@ 2013-06-18 13:25 Alexander Nestorov
  2013-06-18 13:34 ` Matthieu Moy
  2013-06-18 14:01 ` John Keeping
  0 siblings, 2 replies; 18+ messages in thread
From: Alexander Nestorov @ 2013-06-18 13:25 UTC (permalink / raw)
  To: git

Recently I had to write some automation scripts and I found
that git reset --hard actually restores each file's permissions.

That is causing both the created and the last-modified dates
of the file to get changed to the time of the git reset.

This behavior is easy to demonstrate:

echo "test" > myfile
chmod 777 myfile
git add myfile && git commit -m "Test" && git push
chmod 775 myfile
git reset --hard origin/master

After the git reset --hard command, the entire file was
checkout-ed. Instead, git should be able to check if the
content of the file changed and only if it did, check it out.

I do realize that checking the content of each file in a big
repo could result in a slow operation, but there should be a
switch/argument/option to make git reset actually check the
content of each file instead of blindly replacing it.

After reading man a few times I didn't saw any option
that'd let me do this; the only solution I'm able to think about
is actually restoring the permissions of each file to the ones
git thinks they should have before doing the git reset.

Maybe I'm wrong and there is a way for doing what I want, if
so, please correct me.
But if there isn't, should this be implemented? Are there any
reasons for not doing it?


Thank you for your attention
Regards

--
alexandernst

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

end of thread, other threads:[~2013-06-20 13:29 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-18 13:25 [Request] Git reset should be able to ignore file permissions Alexander Nestorov
2013-06-18 13:34 ` Matthieu Moy
2013-06-18 13:48   ` Alexander Nestorov
2013-06-18 14:06     ` Matthieu Moy
2013-06-18 14:22       ` Alexander Nestorov
2013-06-18 14:33         ` Matthieu Moy
2013-06-18 14:39           ` Alexander Nestorov
2013-06-18 15:51             ` Alexander Nestorov
2013-06-18 16:00               ` Matthieu Moy
2013-06-18 17:03                 ` Alexander Nestorov
2013-06-19  5:40                   ` Matthieu Moy
2013-06-19  8:00                     ` Alexander Nestorov
2013-06-19 11:37                       ` Matthieu Moy
2013-06-19 18:43                         ` Junio C Hamano
2013-06-20 13:28                           ` Alexander Nestorov
2013-06-19 16:40                       ` Hilco Wijbenga
2013-06-18 14:01 ` John Keeping
2013-06-18 14:05   ` Alexander Nestorov

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).