git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC 00/13] git-apply --whitespace=fix updates
@ 2008-02-02 10:54 Junio C Hamano
  2008-02-02 10:54 ` [PATCH 01/13] builtin-apply.c: refactor small part that matches context Junio C Hamano
  0 siblings, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2008-02-02 10:54 UTC (permalink / raw)
  To: git

This mini-series teaches "git-apply --whitespace=fix" to cope
better with the whitespace changes it introduces to the context.

[PATCH 01/13] builtin-apply.c: refactor small part that matches context
[PATCH 02/13] builtin-apply.c: restructure "offset" matching
[PATCH 03/13] builtin-apply.c: push match-beginning/end logic down

These three are preparatory clean-ups to isolate the parts the
later patches need to update.

[PATCH 04/13] builtin-apply.c: make it more line oriented
[PATCH 05/13] builtin-apply.c: optimize match_beginning/end processing a bit.
[PATCH 06/13] builtin-apply.c: mark common context lines in lineinfo structure.

These introduce an array of hash values for each line in the
patch preimage, postimage and the target file, and simplifies
the code to find the place that the hunk applies.  The ultimate
motivation is to allow applying patches with whitespace
differences, but this step does not do that yet.

The matching logic that uses hash code of lines could also make
it faster to find the place the hunk applies to, but that is not
the primary purpose of the change.  We would however need to
bench it so that this does not at least slow it down too much.
I haven't done that yet.

[PATCH 07/13] builtin-apply.c: clean-up apply_one_fragment()

This reduces 3 variables (old, oldlines, oldsize) that keep
track of the preimage being built (and their "new" counterparts
for the postimage) to 2 variables (old, oldlines).  This cannot
be done cleanly without the conversion to a line oriented data
structure introduced by 04/13 (remove_first_line() is the most
problematic one).

[PATCH 08/13] builtin-apply.c: simplify calling site to apply_line()
[PATCH 09/13] builtin-apply.c: do not feed copy_wsfix() leading '+'
[PATCH 10/13] builtin-apply.c: move copy_wsfix() function a bit higher.

The function apply_line() reads one line of a patch and makes
whitespace corrections.  These three are preparatory steps to
make the function usable for correcting whitespaces in context
lines.  The function is renamed to copy_wsfix().

[PATCH 11/13] builtin-apply.c: pass ws_rule down to match_fragment()
[PATCH 12/13] git-apply --whitespace=fix: fix whitespace fuzz introduced by previous run

This actually implements the application of a patch whose
preimage context lines do not match the target file but do match
if the whitespace breakages in them are corrected.  The fixing
goes the other way as well.  We may still have files with
whitespace breakages, and the submitter may have based the patch
on a tree whose whitespace breakages have been fixed.  In such a
case, the lines in the target file needs to be cleaned up and
compared with the cleaned-up context lines from the preimage of
the patch.

[PATCH 13/13] core.whitespace: cr-at-eol

This introduces a new error mode "cr-at-eol" which tells git not
to treat a CR at the end of line as a trailing whitespace error.
This is from my earlier patch sent to the list, and does not
depend on "the whitespace correction in the context" topic
above, but rebased because it textually conflicts with the
series.

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

end of thread, other threads:[~2008-02-02 10:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-02 10:54 [PATCH/RFC 00/13] git-apply --whitespace=fix updates Junio C Hamano
2008-02-02 10:54 ` [PATCH 01/13] builtin-apply.c: refactor small part that matches context Junio C Hamano
2008-02-02 10:54   ` [PATCH 02/13] builtin-apply.c: restructure "offset" matching Junio C Hamano
2008-02-02 10:54     ` [PATCH 03/13] builtin-apply.c: push match-beginning/end logic down Junio C Hamano
2008-02-02 10:54       ` [PATCH 04/13] builtin-apply.c: make it more line oriented Junio C Hamano
2008-02-02 10:54         ` [PATCH 05/13] builtin-apply.c: optimize match_beginning/end processing a bit Junio C Hamano
2008-02-02 10:54           ` [PATCH 06/13] builtin-apply.c: mark common context lines in lineinfo structure Junio C Hamano
2008-02-02 10:54             ` [PATCH 07/13] builtin-apply.c: clean-up apply_one_fragment() Junio C Hamano
2008-02-02 10:54               ` [PATCH 08/13] builtin-apply.c: simplify calling site to apply_line() Junio C Hamano
2008-02-02 10:54                 ` [PATCH 09/13] builtin-apply.c: do not feed copy_wsfix() leading '+' Junio C Hamano
2008-02-02 10:54                   ` [PATCH 10/13] builtin-apply.c: move copy_wsfix() function a bit higher Junio C Hamano
2008-02-02 10:54                     ` [PATCH 11/13] builtin-apply.c: pass ws_rule down to match_fragment() Junio C Hamano
2008-02-02 10:54                       ` [PATCH 12/13] git-apply --whitespace=fix: fix whitespace fuzz introduced by previous run Junio C Hamano
2008-02-02 10:54                         ` [PATCH 13/13] core.whitespace: cr-at-eol 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).