Thread (1 message) 1 message, 1 author, 2022-06-21

Re: Feature Request: Custom split location for `git add --patch`

From: Junio C Hamano <hidden>
Date: 2022-06-21 15:49:37

Johannes Schindelin [off-list ref] writes:
Hi Dennis,

On Thu, 16 Jun 2022, Dennis van Gerwen wrote:

...
Note how the `-` line became a context line? It _has_ to be, otherwise the
second hunk could not be applied as-is. That is, until the first hunk has
been applied. In which case the second hunk needs to be modified:

	-- snip --
	@@
	 All journeys start with a first step.

	+Actually, some journeys, some interesting ones, end in a disaster
	+right at the start, because the first step was skipped.

	 And this concludes the chapter. Good night.
	-- snap --

Now the `[tbd]` line in the context has vanished.

This is really an important concept to keep in mind: if you split at
context lines, your hunks can remain immutable. If you want to split
elsewhere, after one of the hunks resulting from said split is a applied,
you have to recompute the other hunk.
Good write-up.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help