From: Elijah Newren <newren@gmail.com>
To: <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
Phillip Wood <phillip.wood@dunelm.org.uk>,
Linus Nilsson <Linus.Nilsson@trimma.se>,
Elijah Newren <newren@gmail.com>
Subject: [PATCH v3 05/15] merge-recursive: use 'ci' for rename_conflict_info variable name
Date: Fri, 5 Apr 2019 08:00:16 -0700 [thread overview]
Message-ID: <20190405150026.5260-6-newren@gmail.com> (raw)
In-Reply-To: <20190405150026.5260-1-newren@gmail.com>
We used a couple different names, but used 'ci' the most. Use the same
variable name throughout for a little extra consistency.
Signed-off-by: Elijah Newren <newren@gmail.com>
---
merge-recursive.c | 41 ++++++++++++++++++-----------------------
1 file changed, 18 insertions(+), 23 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 4ed1b48630..ea5646debd 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -3098,7 +3098,7 @@ static int handle_content_merge(struct merge_options *opt,
struct object_id *o_oid, int o_mode,
struct object_id *a_oid, int a_mode,
struct object_id *b_oid, int b_mode,
- struct rename_conflict_info *rename_conflict_info)
+ struct rename_conflict_info *ci)
{
const char *reason = _("content");
const char *path1 = NULL, *path2 = NULL;
@@ -3118,17 +3118,17 @@ static int handle_content_merge(struct merge_options *opt,
oidcpy(&b.oid, b_oid);
b.mode = b_mode;
- if (rename_conflict_info) {
- struct diff_filepair *pair1 = rename_conflict_info->pair1;
+ if (ci) {
+ struct diff_filepair *pair1 = ci->pair1;
- path1 = (opt->branch1 == rename_conflict_info->branch1) ?
+ path1 = (opt->branch1 == ci->branch1) ?
pair1->two->path : pair1->one->path;
- /* If rename_conflict_info->pair2 != NULL, we are in
+ /* If ci->pair2 != NULL, we are in
* RENAME_ONE_FILE_TO_ONE case. Otherwise, we have a
* normal rename.
*/
- path2 = (rename_conflict_info->pair2 ||
- opt->branch2 == rename_conflict_info->branch1) ?
+ path2 = (ci->pair2 ||
+ opt->branch2 == ci->branch1) ?
pair1->two->path : pair1->one->path;
one.path = pair1->one->path;
a.path = (char *)path1;
@@ -3180,7 +3180,7 @@ static int handle_content_merge(struct merge_options *opt,
reason = _("submodule");
output(opt, 1, _("CONFLICT (%s): Merge conflict in %s"),
reason, path);
- if (rename_conflict_info && !df_conflict_remains)
+ if (ci && !df_conflict_remains)
if (update_stages(opt, path, &one, &a, &b))
return -1;
}
@@ -3206,7 +3206,7 @@ static int handle_content_merge(struct merge_options *opt,
}
}
- new_path = unique_path(opt, path, rename_conflict_info->branch1);
+ new_path = unique_path(opt, path, ci->branch1);
if (is_dirty) {
output(opt, 1, _("Refusing to lose dirty file at %s"),
path);
@@ -3251,8 +3251,8 @@ static int process_entry(struct merge_options *opt,
entry->processed = 1;
if (entry->rename_conflict_info) {
- struct rename_conflict_info *conflict_info = entry->rename_conflict_info;
- switch (conflict_info->rename_type) {
+ struct rename_conflict_info *ci = entry->rename_conflict_info;
+ switch (ci->rename_type) {
case RENAME_NORMAL:
case RENAME_ONE_FILE_TO_ONE:
clean_merge = handle_rename_normal(opt,
@@ -3260,13 +3260,11 @@ static int process_entry(struct merge_options *opt,
o_oid, o_mode,
a_oid, a_mode,
b_oid, b_mode,
- conflict_info);
+ ci);
break;
case RENAME_VIA_DIR:
clean_merge = 1;
- if (handle_rename_via_dir(opt,
- conflict_info->pair1,
- conflict_info->branch1))
+ if (handle_rename_via_dir(opt, ci->pair1, ci->branch1))
clean_merge = -1;
break;
case RENAME_ADD:
@@ -3276,19 +3274,17 @@ static int process_entry(struct merge_options *opt,
* two-way merged cleanly with the added file, I
* guess it's a clean merge?
*/
- clean_merge = handle_rename_add(opt, conflict_info);
+ clean_merge = handle_rename_add(opt, ci);
break;
case RENAME_DELETE:
clean_merge = 0;
- if (handle_rename_delete(opt,
- conflict_info->pair1,
- conflict_info->branch1,
- conflict_info->branch2))
+ if (handle_rename_delete(opt, ci->pair1,
+ ci->branch1, ci->branch2))
clean_merge = -1;
break;
case RENAME_ONE_FILE_TO_TWO:
clean_merge = 0;
- if (handle_rename_rename_1to2(opt, conflict_info))
+ if (handle_rename_rename_1to2(opt, ci))
clean_merge = -1;
break;
case RENAME_TWO_FILES_TO_ONE:
@@ -3298,8 +3294,7 @@ static int process_entry(struct merge_options *opt,
* can then be two-way merged cleanly, I guess it's
* a clean merge?
*/
- clean_merge = handle_rename_rename_2to1(opt,
- conflict_info);
+ clean_merge = handle_rename_rename_2to1(opt, ci);
break;
default:
entry->processed = 0;
--
2.21.0.211.g719c25afaf.dirty
next prev parent reply other threads:[~2019-04-05 15:01 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-27 12:47 [BUG] All files in folder are moved when cherry-picking commit that moves fewer files Linus Nilsson
2019-02-27 14:30 ` Phillip Wood
2019-02-27 16:02 ` Elijah Newren
2019-02-27 16:40 ` Jeff King
2019-02-27 17:31 ` Elijah Newren
2019-02-28 8:16 ` Linus Nilsson
2019-03-01 2:52 ` Junio C Hamano
2019-03-02 23:48 ` Elijah Newren
2019-03-03 1:33 ` Junio C Hamano
2019-03-06 0:27 ` Elijah Newren
2019-03-06 4:43 ` Junio C Hamano
2019-03-07 4:14 ` Elijah Newren
2019-03-07 5:45 ` Junio C Hamano
2019-03-07 5:45 ` Junio C Hamano
2019-03-30 0:33 ` [PATCH v2 00/15] Switch directory rename detection default Elijah Newren
2019-03-30 0:33 ` [PATCH v2 01/15] Use 'unsigned short' for mode, like diff_filespec does Elijah Newren
2019-03-30 0:33 ` [PATCH v2 02/15] merge-recursive: rename merge_options argument from 'o' to 'opt' Elijah Newren
2019-03-30 0:33 ` [PATCH v2 03/15] merge-recursive: rename diff_filespec 'one' to 'o' Elijah Newren
2019-03-30 0:33 ` [PATCH v2 04/15] merge-recursive: rename locals 'o' and 'a' to 'obuf' and 'abuf' Elijah Newren
2019-03-30 0:33 ` [PATCH v2 05/15] merge-recursive: use 'ci' for rename_conflict_info variable name Elijah Newren
2019-03-30 0:33 ` [PATCH v2 06/15] merge-recursive: move some struct declarations together Elijah Newren
2019-03-30 0:33 ` [PATCH v2 07/15] merge-recursive: shrink rename_conflict_info Elijah Newren
2019-03-30 0:33 ` [PATCH v2 08/15] merge-recursive: remove ren[12]_other fields from rename_conflict_info Elijah Newren
2019-03-30 0:33 ` [PATCH v2 09/15] merge-recursive: track branch where rename occurred in rename struct Elijah Newren
2019-03-30 0:33 ` [PATCH v2 10/15] merge-recursive: cleanup handle_rename_* function signatures Elijah Newren
2019-03-30 0:33 ` [PATCH v2 11/15] merge-recursive: switch from (oid,mode) pairs to a diff_filespec Elijah Newren
2019-03-30 0:33 ` [PATCH v2 12/15] t6043: fix copied test description to match its purpose Elijah Newren
2019-03-30 0:33 ` [PATCH v2 13/15] merge-recursive: track information associated with directory renames Elijah Newren
2019-03-30 0:33 ` [PATCH v2 14/15] merge-recursive: give callers of handle_content_merge() access to contents Elijah Newren
2019-03-30 0:33 ` [PATCH v2 15/15] merge-recursive: switch directory rename detection default Elijah Newren
2019-03-30 9:12 ` Ævar Arnfjörð Bjarmason
2019-04-01 15:41 ` Elijah Newren
2019-04-05 15:00 ` [PATCH v3 00/15] Switch " Elijah Newren
2019-04-05 15:00 ` [PATCH v3 01/15] Use 'unsigned short' for mode, like diff_filespec does Elijah Newren
2019-04-05 15:00 ` [PATCH v3 02/15] merge-recursive: rename merge_options argument from 'o' to 'opt' Elijah Newren
2019-04-05 15:00 ` [PATCH v3 03/15] merge-recursive: rename diff_filespec 'one' to 'o' Elijah Newren
2019-04-05 15:00 ` [PATCH v3 04/15] merge-recursive: rename locals 'o' and 'a' to 'obuf' and 'abuf' Elijah Newren
2019-04-05 15:00 ` Elijah Newren [this message]
2019-04-05 15:00 ` [PATCH v3 06/15] merge-recursive: move some struct declarations together Elijah Newren
2019-04-05 15:00 ` [PATCH v3 07/15] merge-recursive: shrink rename_conflict_info Elijah Newren
2019-04-05 15:00 ` [PATCH v3 08/15] merge-recursive: remove ren[12]_other fields from rename_conflict_info Elijah Newren
2019-04-05 15:00 ` [PATCH v3 09/15] merge-recursive: track branch where rename occurred in rename struct Elijah Newren
2019-04-05 15:00 ` [PATCH v3 10/15] merge-recursive: cleanup handle_rename_* function signatures Elijah Newren
2019-04-05 15:00 ` [PATCH v3 11/15] merge-recursive: switch from (oid,mode) pairs to a diff_filespec Elijah Newren
2019-04-05 15:00 ` [PATCH v3 12/15] t6043: fix copied test description to match its purpose Elijah Newren
2019-04-05 15:00 ` [PATCH v3 13/15] merge-recursive: track information associated with directory renames Elijah Newren
2019-04-05 15:00 ` [PATCH v3 14/15] merge-recursive: give callers of handle_content_merge() access to contents Elijah Newren
2019-04-05 15:00 ` [PATCH v3 15/15] merge-recursive: switch directory rename detection default Elijah Newren
2019-04-05 16:32 ` [PATCH v3 00/15] Switch " Jacob Keller
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=20190405150026.5260-6-newren@gmail.com \
--to=newren@gmail.com \
--cc=Linus.Nilsson@trimma.se \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=phillip.wood@dunelm.org.uk \
/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).