From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] mergetool: don't skip modify/remove conflicts
Date: Thu, 10 Feb 2011 21:46:12 -0500 (EST) [thread overview]
Message-ID: <alpine.DEB.2.00.1102102130040.29809@debian> (raw)
In-Reply-To: <7vzkq4opaw.fsf@alter.siamese.dyndns.org>
On Wed, 9 Feb 2011, Junio C Hamano wrote:
> Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:
>
> > +extern void *RERERE_UTIL_STAGED;
>
> This is for what kind? The contents on the filesystem is ready to go,
> added to the index, but still in MERGE_RR (i.e. "git rerere" not run yet)?
Correct.
> Is the real problem that git-mergetool is not running rerere when it
> should, I wonder...
You mean that maybe it should call rerere for files that are added to
the index?
> > it = string_list_insert(conflict, (const char *)e->name);
> > - it->util = NULL;
> > + it->util = RERERE_UTIL_PUNTED;
> > if (ce_stage(e) == 1) {
> > + it->util = RERERE_UTIL_STAGED;
>
> Hmm, I thought that you were taling about paths that the user
> hand-resolved and then ran "git add" on. Why is this marked "STAGED"?
Very good question. It shouldn't.
> Either your logic is wrong, or the name of the symbol is.
The former. What I really wanted to check is if the file has been
added to the index. I am currently struggling with how to do this
correctly. My inexperience with the git internals makes it a very slow
process with a lot of guesses and trial and error.
> > - if (!conflict.items[i].util)
> > - continue; /* punted */
> > + if (conflict.items[i].util == RERERE_UTIL_PUNTED ||
> > + conflict.items[i].util == RERERE_UTIL_STAGED)
> > + continue;
>
> There are a few repetition of "if it is marked with PUNTED or STAGED"; can
> you make it into a small helper function and give it a _meaningful_ name?
> What does it mean for an entry to be marked with either of these marks?
There is another big problem here. I had not realized that the util
field would be freed later (being spoilt by GCing languages, I guess)
and that will of course fail if it is one of the two constants I
defined. I stupidly did not run the commands manually, but relied only
on the test cases, so I didn't notice the segfault at the end. Somehow
all the test cases still pass.
I think this means that anyone intending to run rerere should not
build pu at the moment, right? I'm really sorry about the
inconvenience :-(.
/Martin
next prev parent reply other threads:[~2011-02-11 2:46 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 [this message]
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
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=alpine.DEB.2.00.1102102130040.29809@debian \
--to=martin.von.zweigbergk@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
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).