From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
plamen.totev@abv.bg, l.s.r@web.de,
"Eric Sunshine" <sunshine@sunshineco.com>,
tboegi@web.de, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 7/8] diff.h: extend "flags" field to 64 bits because we're out of bits
Date: Sat, 22 Aug 2015 08:11:14 +0700 [thread overview]
Message-ID: <1440205874-20295-1-git-send-email-pclouds@gmail.com> (raw)
In-Reply-To: <1440205700-19749-7-git-send-email-pclouds@gmail.com>
I renamed both "flags" and "touched_flags" fields while making this
patch to make sure I was aware of how these flags were manipulated
(besides DIFF_OPT* macros). So hopefully I didn't miss anything.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
builtin/commit.c | 2 +-
diff-lib.c | 4 ++--
diff.c | 2 +-
diff.h | 8 +++++---
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/builtin/commit.c b/builtin/commit.c
index 4cbd5ff..95f7296 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -895,7 +895,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
* submodules which were manually staged, which would
* be really confusing.
*/
- int diff_flags = DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG;
+ diff_flags_t diff_flags = DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG;
if (ignore_submodule_arg &&
!strcmp(ignore_submodule_arg, "all"))
diff_flags |= DIFF_OPT_IGNORE_SUBMODULES;
diff --git a/diff-lib.c b/diff-lib.c
index 241a843..ae09034 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -71,7 +71,7 @@ static int match_stat_with_submodule(struct diff_options *diffopt,
{
int changed = ce_match_stat(ce, st, ce_option);
if (S_ISGITLINK(ce->ce_mode)) {
- unsigned orig_flags = diffopt->flags;
+ diff_flags_t orig_flags = diffopt->flags;
if (!DIFF_OPT_TST(diffopt, OVERRIDE_SUBMODULE_CONFIG))
set_diffopt_flags_from_submodule_config(diffopt, ce->name);
if (DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES))
@@ -516,7 +516,7 @@ int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt)
return 0;
}
-int index_differs_from(const char *def, int diff_flags)
+int index_differs_from(const char *def, diff_flags_t diff_flags)
{
struct rev_info rev;
struct setup_revision_opt opt;
diff --git a/diff.c b/diff.c
index 7deac90..2485870 100644
--- a/diff.c
+++ b/diff.c
@@ -4912,7 +4912,7 @@ int diff_can_quit_early(struct diff_options *opt)
static int is_submodule_ignored(const char *path, struct diff_options *options)
{
int ignored = 0;
- unsigned orig_flags = options->flags;
+ diff_flags_t orig_flags = options->flags;
if (!DIFF_OPT_TST(options, OVERRIDE_SUBMODULE_CONFIG))
set_diffopt_flags_from_submodule_config(options, path);
if (DIFF_OPT_TST(options, IGNORE_SUBMODULES))
diff --git a/diff.h b/diff.h
index f7208ad..4241aa5 100644
--- a/diff.h
+++ b/diff.h
@@ -110,13 +110,15 @@ enum diff_words_type {
DIFF_WORDS_COLOR
};
+typedef uint64_t diff_flags_t;
+
struct diff_options {
const char *orderfile;
const char *pickaxe;
const char *single_follow;
const char *a_prefix, *b_prefix;
- unsigned flags;
- unsigned touched_flags;
+ diff_flags_t flags;
+ diff_flags_t touched_flags;
/* diff-filter bits */
unsigned int filter;
@@ -347,7 +349,7 @@ extern int diff_result_code(struct diff_options *, int);
extern void diff_no_index(struct rev_info *, int, const char **, const char *);
-extern int index_differs_from(const char *def, int diff_flags);
+extern int index_differs_from(const char *def, diff_flags_t diff_flags);
extern size_t fill_textconv(struct userdiff_driver *driver,
struct diff_filespec *df,
--
2.3.0.rc1.137.g477eb31
next prev parent reply other threads:[~2015-08-22 1:11 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-22 14:29 apply --cached --whitespace=fix now failing on items added with "add -N" Patrick Higgins
2015-06-22 14:45 ` Duy Nguyen
2015-06-22 17:06 ` Junio C Hamano
2015-06-23 12:34 ` [PATCH] apply: fix adding new files on i-t-a entries Nguyễn Thái Ngọc Duy
2015-06-23 16:50 ` Junio C Hamano
2015-06-23 17:37 ` Junio C Hamano
2015-06-24 4:48 ` Junio C Hamano
2015-06-24 10:11 ` Duy Nguyen
2015-06-24 17:05 ` Junio C Hamano
2015-06-25 12:26 ` Duy Nguyen
2015-06-25 13:07 ` Junio C Hamano
2015-08-22 1:08 ` [PATCH 0/8] Resurrect "diff-lib.c: adjust position of i-t-a entries in diff" Nguyễn Thái Ngọc Duy
2015-08-22 1:08 ` [PATCH 1/8] blame: remove obsolete comment Nguyễn Thái Ngọc Duy
2015-08-22 1:08 ` [PATCH 2/8] Add and use convenient macro ce_intent_to_add() Nguyễn Thái Ngọc Duy
2015-08-22 1:08 ` [PATCH 3/8] apply: fix adding new files on i-t-a entries Nguyễn Thái Ngọc Duy
2015-08-25 17:01 ` Junio C Hamano
2015-08-22 1:08 ` [PATCH 4/8] apply: make sure check_preimage() does not leave empty file on error Nguyễn Thái Ngọc Duy
2015-08-25 17:16 ` Junio C Hamano
2015-08-22 1:08 ` [PATCH 5/8] checkout(-index): do not checkout i-t-a entries Nguyễn Thái Ngọc Duy
2015-08-25 17:36 ` Junio C Hamano
2015-11-29 15:31 ` Duy Nguyen
2015-11-30 19:17 ` Junio C Hamano
2015-08-22 1:08 ` [PATCH 6/8] grep: make it clear i-t-a entries are ignored Nguyễn Thái Ngọc Duy
2015-08-22 1:11 ` Nguyễn Thái Ngọc Duy [this message]
2015-08-25 17:39 ` [PATCH 7/8] diff.h: extend "flags" field to 64 bits because we're out of bits Junio C Hamano
2015-08-31 10:22 ` Duy Nguyen
2015-08-25 17:37 ` [PATCH 6/8] grep: make it clear i-t-a entries are ignored Junio C Hamano
2015-08-25 17:37 ` Junio C Hamano
[not found] <1440205700-19749-1-git-send-email-pclouds>
2015-08-22 1:14 ` [PATCH 7/8] diff.h: extend "flags" field to 64 bits because we're out of bits Nguyễn Thái Ngọc Duy
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=1440205874-20295-1-git-send-email-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
--cc=plamen.totev@abv.bg \
--cc=sunshine@sunshineco.com \
--cc=tboegi@web.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.