git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Alex RiesenNext: Alex Riesen
Message 2 of 4 in “make update-index --chmod work with multiple files and --stdin”
  1. Alex RiesenApr 22, 2006
  2. Junio C HamanoApr 23, 2006
  3. Alex RiesenApr 23, 2006
  4. Alex RiesenApr 23, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.