Re: [PATCH 08/18] git notes merge: Initial implementation handling trivial merges only

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jonathan Nieder
Date: Saturday, October 9, 2010 - 10:29 am

Johan Herland wrote:


Sounds good. :)



Hmm --- isn't the point of output() that it indents to the appropriate
level to portray a recursive merge?

Similarly, show() prevents those confusing messages from the internal
merge between ancestors from being printed when the user is not
interested.

But if you think they are important abstractions to maintain, I won't
stop you. :)

[...]

get_sha1() can return -1 in the following cases:

 - starts with :/, regex does not match.
 - starts with :, entry not present in index
 - in form <rev>:<path>, <path> does not exist in <rev>
 - in form <rev>^, <rev> does not exist or that parent does not
   exist
 - tag being used as commit points to a tree instead
 - et c.

Especially if the caller tries

	git notes merge 'afjkdlsa^{gobbledeegook'

I would not like the merge to succeed.

So as I see it, there are four cases:

 - get_sha1() succeeds and returns a commit ==> merge that rev
 - get_sha1() succeeds and returns a non-commit ==> fail
 - get_sha1() fails, but resolve_ref() indicates a ref valid
   for writing ==> merge empty tree
 - get_sha1() fails, invalid refname ==> fail

The current code does not notice case 4, does it?


I think 'resolve' should be good enough for now.  We can always add
'recursive' later.

The cases where 'recursive' might help are those in which both sides
made a lot of changes to the same notes.  It helps in two ways:
signaling conflicts that might have been otherwise missed and merging
cleanly in cases that might otherwise produce spurious conflicts.
In theory, it makes the result less "arbitrary"; in practice, it seems
to help avoid some conflicts in ugly cases like merging one week's pu
with the next week's pu.

[...]

What kind of caller would care about the distinction between 1 and -1
here (just curious)?

Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/18] git notes merge, Johan Herland, (Tue Sep 28, 5:23 pm)
Re: [PATCH 00/18] git notes merge, Sverre Rabbelier, (Wed Sep 29, 7:56 am)
Re: [PATCH 00/18] git notes merge, Johan Herland, (Wed Sep 29, 8:16 am)
Re: [PATCH 00/18] git notes merge, Sverre Rabbelier, (Wed Sep 29, 8:20 am)
Re: [PATCH 00/18] git notes merge, Johan Herland, (Wed Sep 29, 9:04 am)
Re: [PATCH 14/18] git notes merge: Manual conflict resolut ..., Ævar Arnfjörð Bjarmason, (Wed Sep 29, 9:19 am)
Re: [PATCH 10/18] git notes merge: Handle real, non-confli ..., Ævar Arnfjörð Bjarmason, (Wed Sep 29, 9:20 am)
Re: [PATCH 08/18] git notes merge: Initial implementation ..., Jonathan Nieder, (Sat Oct 9, 10:29 am)