git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] saving and replaying multiple variants with rerere
@ 2015-09-14 23:57 Junio C Hamano
  2015-09-14 23:57 ` [PATCH 1/7] rerere: split conflict ID further Junio C Hamano
                   ` (7 more replies)
  0 siblings, 8 replies; 32+ messages in thread
From: Junio C Hamano @ 2015-09-14 23:57 UTC (permalink / raw)
  To: git

This is a continuation of jc/rerere topic that is now in 'next'.
The old topic is purely about refactoring and code cleaning and this
series builds on top of it.

We record a previously seen conflict and its resolution in a
subdirectory of $GIT_DIR/rr-cache, and the name of the subdirectory
is computed by hashing the "shape" of the conflicted hunk.  When a
similar-looking conflict is encountered later in the working tree,
"git rerere" tries to replay the recorded resolution by running a
three-way merge to apply the change to go from the previous conflict
to the previous resolution to the current conflicted state.

Depending on what appears in the context around the conflicted hunk,
however, this three-way merge itself can conflict and fail to apply
to a seemingly identical conflict.  You _could_ argue that you could
merge with reduced context lines to work around the problem, but
that is a risky proposition.

As a safer approach, these patches allow us to keep more than one
pairs of <preimage,postimage> (i.e. conflicted state and its
resolution) in the same "shape".  If two paths have identical
looking conflict and one's resolution does not cleanly replay to the
other's conflicted state, we now save the resolutions of these two
paths as different "variants" so that they can be applied when we
see these conflicts again.

I think the basic "record and replay" part is done with this round,
but I haven't really reviewed the part that deals with garbage
collection of old rerere database entries, which probably needs more
work (and could use help, hints hints...).

Junio C Hamano (7):
  rerere: split conflict ID further
  rerere: scan $GIT_DIR/rr-cache/$ID when instantiating a rerere_id
  rerere: handle leftover rr-cache/$ID directory and postimage files
  rerere: delay the recording of preimage
  rerere: allow multiple variants to exist
  t4200: rerere a merge with two identical conflicts
  rerere: do use multiple variants

 rerere.c          | 270 +++++++++++++++++++++++++++++++++++++++++++++---------
 rerere.h          |   4 +-
 t/t4200-rerere.sh |  92 ++++++++++++++++++-
 3 files changed, 321 insertions(+), 45 deletions(-)

-- 
2.6.0-rc2-164-gdcd5d00

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2016-04-06 23:06 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-14 23:57 [PATCH 0/7] saving and replaying multiple variants with rerere Junio C Hamano
2015-09-14 23:57 ` [PATCH 1/7] rerere: split conflict ID further Junio C Hamano
2015-09-14 23:57 ` [PATCH 2/7] rerere: scan $GIT_DIR/rr-cache/$ID when instantiating a rerere_id Junio C Hamano
2015-09-14 23:57 ` [PATCH 3/7] rerere: handle leftover rr-cache/$ID directory and postimage files Junio C Hamano
2015-09-14 23:57 ` [PATCH 4/7] rerere: delay the recording of preimage Junio C Hamano
2015-09-14 23:57 ` [PATCH 5/7] rerere: allow multiple variants to exist Junio C Hamano
2015-09-14 23:57 ` [PATCH 6/7] t4200: rerere a merge with two identical conflicts Junio C Hamano
2015-09-14 23:57 ` [PATCH 7/7] rerere: do use multiple variants Junio C Hamano
2016-03-28 22:42 ` [PATCH v2 00/11] saving and replaying multiple variants with rerere Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 01/11] rerere: split conflict ID further Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 02/11] rerere: scan $GIT_DIR/rr-cache/$ID when instantiating a rerere_id Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 03/11] rerere: handle leftover rr-cache/$ID directory and postimage files Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 04/11] rerere: delay the recording of preimage Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 05/11] rerere: allow multiple variants to exist Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 06/11] t4200: rerere a merge with two identical conflicts Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 07/11] rerere: do use multiple variants Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 08/11] rerere: gc and clear Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 09/11] rerere: move code related to "forget" together Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 10/11] rerere: split code to call ll_merge() further Junio C Hamano
2016-03-28 22:42   ` [PATCH v2 11/11] rerere: adjust 'forget' to multi-variant world order Junio C Hamano
2016-04-06 23:05   ` [PATCH v3 00/11] saving and replaying multiple variants with rerere Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 01/11] rerere: split conflict ID further Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 02/11] rerere: scan $GIT_DIR/rr-cache/$ID when instantiating a rerere_id Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 03/11] rerere: handle leftover rr-cache/$ID directory and postimage files Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 04/11] rerere: delay the recording of preimage Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 05/11] rerere: allow multiple variants to exist Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 06/11] t4200: rerere a merge with two identical conflicts Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 07/11] rerere: do use multiple variants Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 08/11] rerere: gc and clear Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 09/11] rerere: move code related to "forget" together Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 10/11] rerere: split code to call ll_merge() further Junio C Hamano
2016-04-06 23:05     ` [PATCH v3 11/11] rerere: adjust 'forget' to multi-variant world order Junio C Hamano

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 NNTP newsgroup(s).