git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Cc: git@vger.kernel.org, Thomas Rast <tr@thomasrast.ch>
Subject: Re: [PATCH v2 1/2] mergetool: don't skip modify/remove conflicts
Date: Mon, 14 Feb 2011 16:54:41 -0800	[thread overview]
Message-ID: <7v1v3aqfqm.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1297570198-21103-2-git-send-email-martin.von.zweigbergk@gmail.com> (Martin von Zweigbergk's message of "Sat\, 12 Feb 2011 23\:09\:57 -0500")

Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:

> diff --git a/builtin/rerere.c b/builtin/rerere.c
> index 081fccc..7b9fe18 100644
> --- a/builtin/rerere.c
> +++ b/builtin/rerere.c
> @@ -147,8 +147,6 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
>  	if (!strcmp(argv[0], "clear")) {
>  		for (i = 0; i < merge_rr.nr; i++) {
>  			const char *name = (const char *)merge_rr.items[i].util;
> -			if (!name)
> -				continue;
>  			if (!has_rerere_resolution(name))
>  				unlink_rr_item(name);
>  		}
> @@ -157,19 +155,22 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
>  		garbage_collect(&merge_rr);
>  	else if (!strcmp(argv[0], "status"))
>  		for (i = 0; i < merge_rr.nr; i++) {
> -			if (!merge_rr.items[i].util)
> -				continue;
>  			printf("%s\n", merge_rr.items[i].string);
>  		}
> -	else if (!strcmp(argv[0], "remaining"))
> -		for (i = 0; i < merge_rr.nr; i++)
> -			printf("%s\n", merge_rr.items[i].string);
> -	else if (!strcmp(argv[0], "diff"))
> +	else if (!strcmp(argv[0], "remaining")) {
> +		rerere_remaining(&merge_rr);
> +		for (i = 0; i < merge_rr.nr; i++) {
> +			if (merge_rr.items[i].util != RERERE_RESOLVED)
> +				printf("%s\n", merge_rr.items[i].string);
> +			else
> +				/* prepare for later call to
> +				 * string_list_clear() */
> +				merge_rr.items[i].util = NULL;
> +		}
> +	} else if (!strcmp(argv[0], "diff"))
>  		for (i = 0; i < merge_rr.nr; i++) {
>  			const char *path = merge_rr.items[i].string;
>  			const char *name = (const char *)merge_rr.items[i].util;
> -			if (!name)
> -				continue;
>  			diff_two(rerere_path(name, "preimage"), path, path, path);
>  		}
>  	else

By looking at the diff between the parent of f322b35 (my earlier "rerere
remaining" patch) and the result of applying this patch on top of the
patch, I think the basic idea of this is to correct my stupid mistake of
contaminating merge_rr unconditionally, and instead adding the "remaining"
entries only when handling the "rerere remaining" command (hence many
removal of special cases "if (!name) continue" introduced by my patch.
The result looks _much_ cleaner than the above patch shows and I am happy
with it.

But shouldn't you also revert the parts of my patch to do_plain_rerere()
and rerere_forget() that have similar special cases?

  reply	other threads:[~2011-02-15  0:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08  3:08 [PATCH] mergetool: don't skip modify/remove conflicts Martin von Zweigbergk
2011-02-09 21:45 ` Junio C Hamano
2011-02-11  2:46   ` Martin von Zweigbergk
2011-02-13  4:09 ` [PATCH v2 0/2] " Martin von Zweigbergk
2011-02-13  4:09   ` [PATCH v2 1/2] " Martin von Zweigbergk
2011-02-15  0:54     ` Junio C Hamano [this message]
2011-02-15  3:30       ` Martin von Zweigbergk
2011-02-15 20:12         ` Junio C Hamano
2011-02-16 10:47           ` [PATCH v3 0/2] " Martin von Zweigbergk
2011-02-16 10:47             ` [PATCH v3 1/2] rerere "remaining" Martin von Zweigbergk
2011-02-16 21:14               ` Junio C Hamano
2011-02-16 10:47             ` [PATCH v3 2/2] mergetool: don't skip modify/remove conflicts Martin von Zweigbergk
2011-02-13  4:09   ` [PATCH v2 2/2] rerere: factor out common conflict search code Martin von Zweigbergk

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=7v1v3aqfqm.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=martin.von.zweigbergk@gmail.com \
    --cc=tr@thomasrast.ch \
    /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).