From: Junio C Hamano <gitster@pobox.com>
To: Edward Thomson <ethomson@edwardthomson.com>
Cc: git@vger.kernel.org, Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH] add: add --chmod=+x / --chmod=-x options
Date: Tue, 31 May 2016 15:34:22 -0700 [thread overview]
Message-ID: <xmqqtwhd3lht.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160531220818.GB46739@zoidberg> (Edward Thomson's message of "Tue, 31 May 2016 17:08:18 -0500")
Edward Thomson <ethomson@edwardthomson.com> writes:
> +static char *chmod_arg = NULL;
> +
I'll drop " = NULL", as it is our convention to let BSS take care of
the zero initialization for global variables as much as possible.
Other than that, I did not see anything objectionable in this round,
but I did notice that you kept the "this takes two bits out of 32"
Dscho mentioned--I do not have a strong preference either way, so
I'll queue it (at least tentatively) on 'pu'.
> @@ -346,7 +354,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)
> (intent_to_add ? ADD_CACHE_INTENT : 0) |
> (ignore_add_errors ? ADD_CACHE_IGNORE_ERRORS : 0) |
> (!(addremove || take_worktree_changes)
> - ? ADD_CACHE_IGNORE_REMOVAL : 0));
> + ? ADD_CACHE_IGNORE_REMOVAL : 0)) |
> + (chmod_arg && *chmod_arg == '+' ? ADD_CACHE_FORCE_EXECUTABLE : 0) |
> + (chmod_arg && *chmod_arg == '-' ? ADD_CACHE_FORCE_NOTEXECUTABLE : 0);
>
> if (require_pathspec && argc == 0) {
> fprintf(stderr, _("Nothing specified, nothing added.\n"));
> diff --git a/cache.h b/cache.h
> index 6049f86..da03cd9 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -581,6 +581,8 @@ extern int remove_file_from_index(struct index_state *, const char *path);
> #define ADD_CACHE_IGNORE_ERRORS 4
> #define ADD_CACHE_IGNORE_REMOVAL 8
> #define ADD_CACHE_INTENT 16
> +#define ADD_CACHE_FORCE_EXECUTABLE 32
> +#define ADD_CACHE_FORCE_NOTEXECUTABLE 64
next prev parent reply other threads:[~2016-05-31 22:34 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 22:08 [PATCH] add: add --chmod=+x / --chmod=-x options Edward Thomson
2016-05-31 22:34 ` Junio C Hamano [this message]
2016-06-01 7:23 ` Johannes Schindelin
2016-06-01 10:19 ` Johannes Schindelin
2016-06-01 16:00 ` Junio C Hamano
2016-06-07 22:59 ` Edward Thomson
2016-06-08 0:39 ` Junio C Hamano
2016-06-08 11:46 ` Duy Nguyen
-- strict thread matches above, loose matches on Subject: below --
2016-05-25 2:06 Edward Thomson
2016-05-25 7:36 ` Junio C Hamano
2016-05-25 12:19 ` Johannes Schindelin
2016-05-25 16:10 ` Junio C Hamano
2016-05-25 16:49 ` Johannes Schindelin
2016-05-25 16:00 ` Junio C Hamano
2016-05-27 4:41 ` Edward Thomson
2016-05-27 5:12 ` Mike Hommey
2016-05-27 6:36 ` Junio C Hamano
2016-05-27 18:30 ` Junio C Hamano
2016-05-31 22:06 ` Edward Thomson
2016-05-25 7:46 ` Johannes Schindelin
2016-05-27 18:35 ` Junio C Hamano
2016-05-25 7:51 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqtwhd3lht.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=ethomson@edwardthomson.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
/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.
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).