Re: make update-index --chmod work with multiple files and --stdin
- From
Junio C Hamano <junkio@cox.net>
- Date
- Apr 23, 2006, 00:54 UTC
- Message-ID
- <7v1wvpi010.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20060422204642.GA7676@steel.home>
Alex Riesen <raa.lkml@gmail.com> writes:
> I had a project where lots of files were "accidentally" marked +x, and > doing plain "git-update-index --chmod=-x" for each file was too slow. > Besides, it's somewhat inconsistent, that --chmod does work only for > one subsequent file.
If you are doing that on the command line, people may want to have a way to mean "from here on do not do chmod, just do normal update-index and nothing else" by resetting the chmod_mode thing back to zero. Nothing major, and we do not do that to allow_add and allow_remove either, but just a thought.
> + char chmod_mode = 0;
Perhaps "set_executable_bit"?
> + if ( chmod_mode ) {Please lose ( extra ) whitespaces around parentheses.
> + if ( chmod_mode ) {Likewise.
> + if (chmod_path(chmod_mode, p))
> + die("git-update-index: cannot chmod %cx %s",
> + chmod_mode, p);
> + }Might make sense to die inside chmod_path() instead of repeating the if () { die() } sequence twice? I dunno.