Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: make update-index --chmod work with multiple files and --stdin
Date: Sat, 22 Apr 2006 17:54:51 -0700	[thread overview]
Message-ID: <7v1wvpi010.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20060422204642.GA7676@steel.home> (Alex Riesen's message of "Sat, 22 Apr 2006 22:46:42 +0200")

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.

  reply	other threads:[~2006-04-23  0:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-22 20:46 make update-index --chmod work with multiple files and --stdin Alex Riesen
2006-04-23  0:54 ` Junio C Hamano [this message]
2006-04-23  7:01   ` Alex Riesen
2006-04-23  7:08   ` Alex Riesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v1wvpi010.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox