Re: make update-index --chmod work with multiple files and --stdin

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

 



Alex Riesen <raa.lkml@xxxxxxxxx> 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.

-
: 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]