All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch add: previous hunk across file boundaries
@ 2018-05-11 14:53 Robert Dailey
  2018-05-11 17:47 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Dailey @ 2018-05-11 14:53 UTC (permalink / raw)
  To: Git

I noticed that when stepping into a new file while doing `git add -p`,
pressing `k` or `K` does not go back to the previous file. Is this a
bug? Is there a setting for it? I googled & checked out the git docs,
I didn't find any specific information on this.

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

* Re: Patch add: previous hunk across file boundaries
  2018-05-11 14:53 Patch add: previous hunk across file boundaries Robert Dailey
@ 2018-05-11 17:47 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2018-05-11 17:47 UTC (permalink / raw)
  To: Robert Dailey; +Cc: Git

On Fri, May 11, 2018 at 09:53:52AM -0500, Robert Dailey wrote:

> I noticed that when stepping into a new file while doing `git add -p`,
> pressing `k` or `K` does not go back to the previous file. Is this a
> bug? Is there a setting for it? I googled & checked out the git docs,
> I didn't find any specific information on this.

Nope, this is just the way that "-p" is implemented. It considers each
file independently (another artifact of this is that after completing
the hunks in a file the changes are staged, even if you quit while
looking at a hunk in another file).

I agree that it would be nicer to consider the whole set atomically,
with both "save and quit" and "quit but do not save" options. The way it
works now is mostly due to the way that "add -p" grew out of the whole
"add -i" interactive system, where you'd invoke the patch-adder on
specific files from a menu.

So no, there's not a way to do what you want right now short of writing
patch.

-Peff

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

end of thread, other threads:[~2018-05-11 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-11 14:53 Patch add: previous hunk across file boundaries Robert Dailey
2018-05-11 17:47 ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.